Technical FAQs for "PrizmDoc"

Question

When using Content Conversion Services, what are the supported input formats that it takes for conversion?

Answer

When using Content Conversion Services, you can input any image and document source type that PrizmDoc supports.

Here’s a link to the Content Conversion Services API for more information.

Question

What features does PAS provide that I don’t get from exclusively using the backend?

Answer

The following features are provided through PAS:

  • Viewing Packages
  • Annotation storage/retrieval
  • Form Definition storage/retrieval
  • Simplified API to communicate with the backend
  • Affinity token management (clustered mode)

It is also important to note that all new feature development will involve PAS.

Features not offered through PAS include:

  • Content Conversion output to anything other than PDF.
Question

In PrizmDoc Viewer, when viewing Excel documents that have pictures on certain spreadsheets within that document, the pictures are not displayed.

This appears to happen only if PrizmDoc has the Microsoft Office Conversion (MSO) feature enabled. This issue does not occur if PrizmDoc is using LibreOffice.

Why is this happening?

Answer

The issue is related to an Excel “Page Setup” option called “Black and white”. The option is located in Excel under File, Print, Page Setup and is only respected when PrizmDoc has the MSO feature enabled.

When using LibreOffice, this setting does not exist and is ignored, which is why you can see the pictures.

By default, this option is disabled in Excel, so that specific option would have to be manually set by the creator of the document.

As a workaround, ensure that the “Page Setup” option for “Black and white” is not checked on any spreadsheets in an Excel document that has pictures.

Question

Why am I receiving a 500 error when making a Viewing Session PUT request?

Answer

This issue can occur if you forget to prefix the {viewingSessionId} portion of the URL with u, or if you simply request an invalid {viewingSessionId} in the call.

For example, the PUT call should look like the following:

PUT /ViewingSession/u{viewingSessionId}/SourceFile

For more information on syntax and other API calls related to Viewing sessions, please see:

https://help.accusoft.com/PrizmDoc/latest/HTML/webframe.html#pas-viewing-sessions.html

Question

Normally, when I create a viewer in my own application, I do:

viewer = $("#some-div").pccViewer({ ...options });

Then I can make calls like:

viewer.viewerControl.search("Some search term.");

But in the legacy samples the Viewer isn’t set to a global variable. How can I access the viewerControl object?

Answer

If you call $("#some-div").pccViewer(); without any arguments, it will access the existing Viewer in the relevant <div> instead of creating a new one. For example, in the WebForms sample, var viewer = $("#viewer1").pccViewer(); will create a reference to the sample’s existing Viewer.

Question

I would like to remove the mark selection handles from the marks (annotations and redactions) in the viewer so that my users can’t resize marks, but so they can still move the marks around. How can I do this?

Answer

The easiest way to achieve the functionality you’re looking for would be to simply change the CSS for the mark handles to set their display to none !important. The CSS for the mark handles can be found in viewercontrol.css. See the following code for an example:

/* mark selection handles */
.pccMarkHandleTopLeft,
.pccMarkHandleTopCenter,
.pccMarkHandleTopRight,
.pccMarkHandleMidLeft,
.pccMarkHandleMidRight,
.pccMarkHandleBottomLeft,
.pccMarkHandleBottomCenter,
.pccMarkHandleBottomRight,
.pccMarkHandlePoint,
.pccMarkHandleTextSelectionStart,
.pccMarkHandleTextSelectionEnd {
    position: absolute;
    width: 40px;
    height: 40px;
    display: none !important;
    background-image: url(data:image/png;base64,iVBORw...);
}

@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 2dppx),
       screen and (min-resolution: 192dpi) {
    .pccMarkHandleTopLeft, 
    .pccMarkHandleTopCenter, 
    .pccMarkHandleTopRight, 
    .pccMarkHandleMidLeft, 
    .pccMarkHandleMidRight, 
    .pccMarkHandleBottomLeft, 
    .pccMarkHandleBottomCenter, 
    .pccMarkHandleBottomRight, 
    .pccMarkHandlePoint, 
    .pccMarkHandleTextSelectionStart, 
    .pccMarkHandleTextSelectionEnd {
        -webkit-background-size: 40px 40px;
                background-size: 40px;
        display: none !important;
        background-image: url(data:image/png;base64,iVBORw...);
    }
}

You will want to set the !important flag so that the functions inside viewercontrol don’t set the display back to block.

One thing you may want to do is separate out pccMarkHandleTextSelectionStart and pccMarkHandleTextSelectionEnd to not include display: none. This way, the text selection annotations are able to be edited, since they are reliant on the handles for "movement" because they select a portion of the text signified by the handles. 

Question

PAS appears to be unable to retrieve my document. What could be the issue?

Answer

If PAS is trying to retrieve documents from a source with a bad SSL certificate or a self-signed certificate and it is not configured to allow bad SSL certificates, it will fail to retrieve the document and log a generic 580 error.

For more information about Viewing Session creation parameters, including acceptBadSslCertificate see here:

https://help.accusoft.com/PrizmDoc/latest/HTML/webframe.html#pas-viewing-sessions.html

Question

What are the technical details/process of “Flattening” a PDF document?

Answer

It is possible to “Flatten” PDF documents in PrizmDoc Viewer. You can do this by converting the document to a raster format (TIFF is recommended for PDF conversion) using PrizmDoc’s Content Conversion Service, and then converting it back to PDF format. This will result in a PDF with a single layer and no hidden objects. However, this will usually lower the quality and increase the file size of PDFs that are largely text.

Here is an example workflow using the Workfile API and the Content Conversion Service API:

1. Create a WorkFile from PDF

POST {{pccisUrl}}/PCCIS/V1/WorkFile
Content-Type: application/octet-stream

{{file bytes}}

2. Initiate Conversion to TIFF

POST {{pccisUrl}}/v2/contentConverters
Content-Type: application/json

{
    "input": {
        "sources": [
            {
                "fileId": "{{fileId}}"
            }
        ],
        "dest": {
            "format": "tiff"
        }
    }
}

3. Poll until response[“state”] === “complete”

GET {{pccisUrl}}/v2/contentConverters/{{processId}}

4. Initiate Conversion from TIFF back to PDF

POST {{pccisUrl}}/v2/contentConverters
Content-Type: application/json

{
    "input": {
        "sources": [
            {
                "fileId": "{{fileId_from_Step3_output}}"
            }
        ],
        "dest": {
            "format": "pdf"
        }
    }
}

5. Poll again

GET {{pccisUrl}}/v2/contentConverters/{{processId}}

6. Download

GET {{pccisUrl}}/PCCIS/V1/WorkFile/{{fileId}}?ContentDispositionFileName={{desiredFileNameWithExtension}}
Question

What causes Session Expired errors in PrizmDoc?

Answer

Session expired errors normally occur when a viewing session is open for longer than 20 minutes. 20 minutes is the default value of viewing.sessionLifetime in the PrizmDoc central configuration file, and you can increase it if you would like your Viewing Sessions to be active longer. On PrizmDoc Cloud this value is set to 5 hours.

You can find the relevant config file using the following file paths:

  • Linux: /usr/share/prizm/prizm-services-config.yml
  • Windows: C:\Prizm\prizm-services-config.yml
Question

We are trying to create new viewing packages, however, in the [prizmdoc_process] table we see the process is 100% complete. However, the error code field indicates an Internal Error.

The document does not display in the viewing session and gives a 480 error. The following error code is:

{errorCode: “ViewingPackageNotUsable”}

What might be the issue?

Answer

When creating viewing packages, the PrizmDoc Application Services (PAS) uses the PrizmDoc Server to do the conversion work. In order for the viewing package to be created successfully, the PrizmDoc Server needs to be licensed and healthy.

If you see an error “ViewingPackageNotUsable” this can be related to the PrizmDoc Server either not being healthy or specifically not being licensed.

To verify the PrizmDoc Server status and if it is licensed, you can run the following command on the PrizmDoc Server in a web browser:

http://localhost:18681/admin

Question

My PrizmDoc Cloud hosted server is reporting as unlicensed even though the license lease file is being written to the S3 bucket, what could be causing this?

Answer

This issue can occur when using a single S3 bucket for both licensing files as well as additional document storage. When our cloud licensing module attempts to search for the expected lease file inside of this S3 bucket, it requests the list of objects in that directory. However, whenever there are more than 1,000 objects in this bucket, this call only returns a list of the first 1,000 objects.

If there are over 1,000 objects in the bucket, then this could cause the Licensing Service to not see the license lease file when it gets the list of files. The result is that no lease file is found, which in turn causes the service to go unlicensed.

The solution for this issue is to make sure the bucket you are using for licensing is only used for that purpose. Should you encounter this issue, try moving all other files out of the bucket. If that is not possible, you may need to contact Accusoft Support to request changing the bucket your license uses for licensing.

Question

We are using the Webforms Samples and want to know how to enable the “Always User Raster” feature. Which file needs to be modified and how should it be modified?

Answer

In order to enable the “Always Use Raster” option for our Webforms sample, you will need to do the following:

  • Modify the Default.aspx file
  • Update the Central Configuration file

How To:

  1. In the Sample, before modifying, make a backup of the following file for safekeeping:

\Prizm\Samples\dotnet\webforms\full-viewer-sample\Default.aspx

  1. In the original file, modify the code that is located close to line 115:

\Prizm\Samples\dotnet\webforms\full-viewer-sample\Default.aspx

Line to Replace:

} else {
        sessionData.source = getDocumentSource(query.document || '');
        }

Replace with:

} else {
        sessionData.source = getDocumentSource(query.document || '');
        sessionData.render = {
          html5: {
             alwaysUseRaster: true
          }
       };
}
  1. Next, to update the Central Configuration file you will need to stop the Prizm Services.

  2. Make a backup of the prizm\prizm-services-config.yml file.

  3. Edit the .yml file and remove the leading # for the following line and add true to the array so that it looks like the following:

viewing.sessionConstraints.render.alwaysUseRaster.allowedValues:
[true, false]

  1. Restart the Prizm Services.