Technical FAQs for "PrizmDoc Viewer"

Question

Can I use all of the features and configuration options in PrizmDoc Cloud-Hosted that I can in PrizmDoc Self-Hosted?

Answer

Currently, PrizmDoc Cloud does not allow for editing the server central configuration parameters, but the defaults have been set to allow for more complex documents that might otherwise fail in order to account for the lack of ability to modify these options.

Question

Why is the searchTasks endpoint returning an invalid JSON from very large requests?

Answer

Though no official size limit has been published, PAS will return a misleading invalid JSON error if you send in several thousand search terms at once. The exact maximum seems to vary across different installs. We have logged a story in our backlog about making a more explicit size limit possible, but there is no current plan to allow for PrizmDoc to handle search requests of unbounded size.

The best workaround for this behavior is to split your search terms between multiple requests, rather than packing them into one request.

Question

Where does PrizmDoc store E-Signatures and how can I retrieve them?

Answer

PrizmDoc does not store E-Signatures on the server. However, PrizmDoc does store them in the browser’s local storage so that an end user can use the same signature across multiple documents and multiple sessions within the same browser.

In the Viewer Sample, end users are able to save their individual signatures for their own record using the “Download Signature” button under the Manage E-Signatures menu. This will download a plain-text JSON file of the selected signature.

In the E-Signing Sample, if you want to retrieve the E-Signature from your own browser, you can open the developer tools (F12 on Chrome), go to the application tab, select local storage, and inside you can find the JSON of the E-Signature in the value of pccvEsignSignatures.

Question

With a fully-running PrizmDoc environment (version prior to v10.5), I’m noticing times where the system becomes unresponsive. That is, at some point, it no longer processes requests being made to the backend and I have to restart PrizmDoc in order to alleviate it. What could be causing this?

Answer

Prior to version 10.5, PrizmDoc used ProxyServer as its image processing system. Our Development Team eventually began seeing that the ProxyServer exhibited architectural problems that lead to a multitude of issues, such as unresponsiveness.

Starting in version 10.5, the Development Team created the Prizm Content Connect Imaging Service (PCCIS), which is far more stable.

To resolve this issue we suggest upgrading to the latest revision of PrizmDoc. Please see the product page for more information found here: https://www.accusoft.com/products/prizmdoc/overview/

Question

Can I host multiple PrizmDoc viewers on a single page?

Answer

It is possible to host multiple viewers on a single page. The following example leverages Bootstrap’s tab implementation:

<!DOCTYPE html>

<html lang="en">
<head>
    <!-- Metadata -->
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <meta name="description" content="" />

    <!-- Title -->
    <title>AccuSample</title>

    <!-- Libraries -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css">

    <!-- PrizmCSS -->
    <link rel="stylesheet" href="https://pcc-demos.accusoft.com/static/viewer-latest/css/viewercontrol.css">
    <link rel="stylesheet" href="https://pcc-demos.accusoft.com/static/viewer-latest/css/viewer.css">

    <!-- Inline Stylesheet -->
    <style>
        body {
            overflow-y: hidden;
        }
        #viewer1, #viewer2 {
            height: calc(100vh - 3em);
            width: 100%;
        }
    </style>

</head>
<body>
    <!-- #main -->
    <main class="container">
        <ul class="nav nav-tabs" role="tablist">
            <li class="nav-item">
                <a class="nav-link active" id="viewer1-tab" data-toggle="tab" href="#viewer1">Viewer 1</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" id="viewer2-tab" data-toggle="tab" href="#viewer2">Viewer 2</a>
            </li>
        </ul>

        <div class="tab-content">
            <div class="tab-pane fade show active" id="viewer1" role="tabpanel">
                <div id="viewer1">
                </div>
            </div>
            <div class="tab-pane fade" id="viewer2" role="tabpanel">
                <div id="viewer2">
                </div>
            </div>
        </div>
    </main>

    <!-- Libraries -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.1/umd/popper.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>

    <!-- PrizmJS -->
    <script src="https://api.accusoft.com/v1/docstore/viewer/assets/classic/bundle.js"></script>
    <script src="https://pcc-demos.accusoft.com/static/viewer-latest/js/jquery.hotkeys.min.js"></script>
    <script src="https://pcc-demos.accusoft.com/static/viewer-latest/js/viewercontrol.js"></script>
    <script src="https://pcc-demos.accusoft.com/static/viewer-latest/js/viewer.js"></script>

    <!-- Inline Script -->
    <script>
        var viewingSessionId1;
        var viewerControl1;
        var viewingSessionId2;
        var viewerControl2;

        $(document).ready(function() {
            $.ajax({
                "type": "post",
                "url": "https://api.accusoft.com/PAS/V1/ViewingSession",
                "headers": {
                    "acs-api-key": ""
                },
                "data": JSON.stringify({
                    "source": {
                        "type": "url",
                        "url": ""
                    }
                })
            }).done(function(response) {
                viewingSessionId1 = response["viewingSessionId"];

                // Initialize viewer
                viewerControl1 = $("#viewer1").pccViewer({ 
                    documentID: viewingSessionId1,
                    imageHandlerUrl: "https://api.accusoft.com/v2/viewers/proxy",
                    language: languageItems,
                    template: htmlTemplates
                }).viewerControl;
            });

            $.ajax({
                "type": "post",
                "url": "https://api.accusoft.com/PAS/V1/ViewingSession",
                "headers": {
                    "acs-api-key": ""
                },
                "data": JSON.stringify({
                    "source": {
                        "type": "url",
                        "url": ""
                    }
                })
            }).done(function(response) {
                viewingSessionId2 = response["viewingSessionId"];

                // Initialize viewer
                viewerControl2 = $("#viewer2").pccViewer({ 
                    documentID: viewingSessionId2,
                    imageHandlerUrl: "https://api.accusoft.com/v2/viewers/proxy",
                    language: languageItems,
                    template: htmlTemplates
                }).viewerControl;
            });
        });
    </script>
</body>
</html>
Question

Why am I seeing requests sent through pcc.ashx when they shouldn’t be?

Answer

The default option for the imageHandlerUrl is pcc.ashx so if, for instance, you misspelled imageHandlerUrl or in some other way do not have the setting properly implemented, you will see requests sent through pcc.ashx.

This has been seen when trying to set up the pas-service reverse proxy redirect for Prizm Application Services (PAS).

A sample implementation of this setting can be found in the viewer.js around line 288.

options.imageHandlerUrl = options.imageHandlerUrl || "../pcc.ashx";
Question

In PrizmDoc, why do I fail to load/convert Excel documents with the error “Exception from HRESULT: 0x800AC472”?

Answer

The error message Exception from HRESULT: 0x800AC472 is usually associated with a failure involving an Excel document, found in the MsOfficeConverter.log. Below are some known triggers of it:

If the user is logged in as "SYSTEM", "LocalSystem", or any other non-user-account variant, this will cause PrizmDoc to fail when using MSO services. This is expected behavior when working with Microsoft Office documents in PrizmDoc. Please see step 6 of the Windows Installation documentation regarding this:

http://help.accusoft.com/PrizmDoc/latest/HTML/webframe.html#windows-installation.html

"Specify the login account (account name and password) that PrizmDoc Server will run under. If you are using the Microsoft Office (MSO) Conversion add-on, please make sure that the "login account" is a real user account with Administrator rights. Running PrizmDoc under the LocalSystem user or another Microsoft Windows integrated service account is not supported for this option."

It’s also crucial that the copy of Microsoft Office on the system has been activated. A not-licensed, not-activated, expired, or trial license will all cause Microsoft Office to not work with PrizmDoc.

More information: https://help.accusoft.com/PrizmDoc/latest/HTML/windows-requirements.html

"The installed copy of Microsoft Office must be activated in order for PrizmDoc’s Microsoft Office Conversion Service to work properly. Not licensed, not activated, an expired or trial version of Microsoft Office will not work with PrizmDoc."

Your default printer must be the Microsoft XPS Document Writer when working with Excel documents in PrizmDoc. Specifying another printer could possibly lead to this exception.

More information: http://help.accusoft.com/PrizmDoc/latest/HTML/natively-render-mso-documents.html

"The Microsoft Office Conversion Service requires the Microsoft XPS Document Writer printer driver to be installed for the best conversion performance and rendering fidelity of MS Excel documents"

Ensure the Print Spooler service is started and the Microsoft XPS Document Writer is the default printer.

There is a known issue with version 13.3 of PrizmDoc where completely blank Excel files are not loadable in the Viewer. They will fail to load and throw the aforementioned HRESULT exception. This has been fixed in PrizmDoc version 13.6.

In short, please set up the PrizmDoc service correctly to run with a real user account, ensure the copy of Microsoft Office has been activated, and make sure the default printer is set to "Microsoft XPS Document Writer", then restart the service. This should fix this particular issue in most cases.


For more reading on considerations that Microsoft recommends when running their client-side MSO applications on the server, see this article:

Considerations for server-side Automation of Office

Question

How do I get Viewing Packages working in PrizmDoc?

Answer

Viewing Package Full Setup Instructions

We recommend pre-converting documents through a feature called viewing packages and it can be turned on in PAS Configuration.

viewingPackagesdefault: disabled – Enable Pre-Conversion Services and APIs, which allow you to pre-convert documents and cache on-demand document views in PAS, to improve the speed at which documents can be viewed, as well as reduce the processing time in PrizmDoc Server for repeat document views.

Enable Viewing Packages Feature

feature.viewingPackages: enabled

Since viewing packages also use a database you will need to create a database for PAS, configure a database, and run the scripts that are included to create the tables necessary for viewing packages to work.

Configuring Database


Install Microsoft SQL Express

Note 1: If you have Visual Studio installed, you might have to uninstall the recent versions of C++ that are installed before MSSQL Express will successfully install.

Remove Visual Studio C++ Redistributables

Note 2: When installing, use all default install settings except for setting a custom database instance id and set mixed mode authentication so a custom password can be set.

Turn On TCP/IP For Database Instance

Step 1:

step 1 enable tcp/ip

Step 2:

enable tcp/ip

Set Port 1433 for TCP/IP Connection

set port 1433 for tcp/ip connection

Restart SQL Express Instance

Right-click and select "Restart" or double-click and select "Restart".

restart sql express instance

Install Microsoft SQL Management Studio

Install from this downloads page

Connect To Database Instance In Microsoft SQL Management Studio

Connect To Database Instance In Microsoft SQL Management Studio

Create A Database In Microsoft SQL Management Studio

Create A Database In Microsoft SQL Management Studio

PAS Config Database Settings

feature.viewingPackages: "enabled"

database.adapter: "sqlserver"
database.host: "localhost"
database.port: 1433
database.user: "sa"
database.password: "Password1"
database.database: "prizmdb"


# Default timeout for the duration of a viewing session

defaults.viewingSessionTimeout: "20m"

viewingPackagesData.storage: "database"
viewingPackagesProcesses.storage: "database"
viewingSessionsData.storage: "database"
viewingSessionsProcessesMetadata.storage: "database"

viewingPackagesArtifactsMetadata.storage: "database"
viewingPackagesArtifacts.storage: "filesystem"
viewingPackagesArtifacts.path: "%ALLUSERSPROFILE%\\Accusoft\\Prizm\\ViewingPackages"

Create the database tables

Create the database tables

Restart PAS

Restart PAS


Create Viewing Package

viewing-package-creator

Get State of Viewing Package Creator Processing

viewing package creator process

Get Viewing Package Info With Document Id

viewing package info with document id

Create Viewing Session From Viewing Package With Document Id

Create Viewing Session From Viewing Package

View Document In Viewing Package With The Created Viewing Session Id

View Document In Viewing Package With The Created Viewing Session Id

For examples of creating viewing packages, click on the link below to see the various ways of using them:

Viewing Package Creators

Question

What are the absolute essentials for embedding the PrizmDoc Viewer into my web page/application?

Answer

Viewer API (viewercontrol.js)

The Viewer API is the base building block of the Viewer. We ensure that API changes are backward compatible with point releases (for example, PrizmDoc v13.5 → PrizmDoc v13.6) and will not introduce breaking changes unless critical. With major releases we also endeavor to ensure backward compatibility with previous releases of the Viewer API.

HTML Templates (viewerCustomization.js) and CSS (viewercontrol.css, viewer.css)

The Viewer that is shipped with the product will be maintained and enhanced from release to release. The Viewer HTML and CSS markup will change with each release. Once you have begun to modify your markup, it is recommended that you consider subsequent PrizmDoc releases as sample code, in which you would evaluate product changes and choose to incorporate all or parts of those changes into your customization.

JavaScript files (viewer.js)

The Viewer JavaScript that lies above the Viewer API is unobfuscated and open for customization. While we expect many developer needs will be satisfied through configuration parameters and minor HTML or styling changes, some developers will desire to modify viewer.js for more advanced customization. You should carefully consider your development and ongoing maintenance strategy to ensure that future releases of PrizmDoc are easy to integrate into your customizations. We cannot guarantee backward compatibility of viewer.js in future releases as it is central to the functionality of the Viewer.

For information on integrating PrizmDoc Viewer, see the Getting Started section of the documentation.

For more in depth customization, see the PrizmDoc Customization section of the documentation.

Question

What browsers does PrizmDoc support?

Answer

Please refer to our latest documentation for the most up-to-date list of supported browsers:

For documentation on older versions of PrizmDoc, please see our documentation archive.

Question

Why are the fonts in my CAD files showing up garbled/unrecognizable/not as expected?

Answer

Some CAD/DWG files may include fonts that are not included in PrizmDoc Viewer’s default font set. PrizmDoc will choose the most appropriate substitute font to use in its place. The substitution process isn’t always perfect, and as a result, you will see garbled/unrecognizable characters in the Viewer.

In order to provide additional .SHX fonts for PrizmDoc to pull from, you can copy the necessary .SHX font files into the cad-fonts folder, located at:

Windows: ‪C:\Prizm\modules\cad-fonts
Linux: /usr/share/prizm/modules/cad-fonts

Alternatively, if you want to use fonts from that are located in a different directory, you can add the environment variable, ACAD, to explicitly specify the filepath of these fonts. his variable can be added under System Properties > Advanced > Environment Variables > System Variables > New... > ACAD. For the variable’s Value, specify a folder path that contains additional CAD font files for PrizmDoc to pull from.

* It is important to note that the Linux filesystem is case-senstive, so when adding custom CAD fonts on Linux, make sure that the fonts are named with case-sensitivity in mind. If you still see unexpected output after adding the fonts to the cad-fonts folder, try renaming the fonts to all lowercase.

** Note that the cad-fonts folder was added in PrizmDoc 13.20, so to add custom cad fonts on earlier versions of Prizm, use the environmental variable approach.

Question

When viewing .csv files in PrizmDoc Viewer, the dates in the CSV file are in UK format (DD/MM/YYYY). However, if the DD is lower than 13 it is converted to US date format (MM/DD/YYYY).

Answer

Workaround:

The suggested workaround is to use Excel files instead of CSV to avoid this situation. Excel file format stores date/time format in the file.

Issue:

This is a bug in the MS Excel COM Interop that is being used by the product (MsOfficeConverter). Here is the related Excel bug: https://social.msdn.microsoft.com/Forums/vstudio/en-US/82248560-dabd-4c90-b1e2-793b2f32b257/excel-bug-handling-dates-in-csv-files-using-microsoftofficeinteropexcel?forum=exceldev

Problem description:

When using MS Excel Interop to open CSV files, all date/times there are being interpreted with “en-US” locale, regardless of actual system locale. Here is the description from the bug link above:

Excel interpreting dates when its reads csv files via .NET Interop. It is not a excel formatting issue per say. When excel accesses information such as dates (which are stored as numbers in memory to support arithmetic operations) from text files, it has to convert the date from textual representation (within the csv file, such as 2012-09-12) to the equivalent number in Excel memory (e.g. 41164 which represents 2012-09-12). When we use Interop to access this number in memory, many are interpreted incorrectly – swapping days with months and vice versa. This is a bug, as Excel is not abiding by the system culture on interpreting local date formats.