Technical FAQs

Question

With PrizmDoc Viewer, can I have more than a single viewer on the same page?

Answer

Yes, just initialize a second viewer on another <div> in the page. You can use the initialization code here more than once within the same page.

Question

What file types are supported by Accusoft PDF Viewer?

Answer

The viewer currently supports only PDF file formats based on the PDF32000 specification. If you need more wide ranging document support our PrizmDoc Server platform can help!

Question

If I have a PDF document that only has an embedded image in it (no text objects, etc.), can PrizmDoc Viewer take it and create a searchable PDF file from it?

Answer

Yes. PrizmDoc’s Content Conversion Services can take an image-only PDF and create a searchable PDF file from it. This can be done by modifying the input.dest.pdfOptions.ocr options object; see our documentation here.

If you are attempting to make a searchable PDF from an existing PDF document, please note that the source PDF file should be an image-only PDF. PrizmDoc will not create a searchable file from already-existing vector content.

This feature was introduced in PrizmDoc 13.1, please see our Release Notes for more information.

Question

If I have a PDF document that only has an embedded image in it (no text objects, etc.), can PrizmDoc Viewer take it and create a searchable PDF file from it?

Answer

Yes. PrizmDoc’s Content Conversion Services can take an image-only PDF and create a searchable PDF file from it. This can be done by modifying the input.dest.pdfOptions.ocr options object; see our documentation here.

If you are attempting to make a searchable PDF from an existing PDF document, please note that the source PDF file should be an image-only PDF. PrizmDoc will not create a searchable file from already-existing vector content.

This feature was introduced in PrizmDoc 13.1, please see our Release Notes for more information.

How Accusoft’s PrizmDoc Improves Upon PDF.js

The ability to view PDF files has become an essential feature for web-based applications. While dedicated desktop readers are still common, the average user justifiably expects to be able to view documents without switching between applications. Thanks to browser-based PDF libraries like PDF.js, developers can both integrate the viewing features they need and build the next generation of PDF viewing integrations.

What Is PDF.js?

An open-source JavaScript PDF library, PDF.js was originally developed by the Mozilla Foundation in 2011 to serve as the built-in PDF viewer for the Firefox web browser. At the time, web browsers depended upon separate reader applications or browser plug-ins to view PDFs.

Unfortunately, this created several security risks. External plug-ins can contain malicious code or gather data that could endanger privacy. Downloading PDFs for local viewing is also potentially hazardous because it means the file must be removed from a secure application environment.

PDF.js uses Asynchronous JavaScript and XML (Ajax) to render PDFs as an HTML5 <canvas> element directly within a web application. Since it uses JavaScript for rendering, PDF.js is compatible with all modern browsers and doesn’t require any additional plug-ins.

In addition to being integrated into Firefox, the software was also made available as open-source code. This made it possible for independent developers to expand upon the core capabilities of PDF.js in the years since its release.

Should You Build or Buy a PDF.js Viewer?

The open-source availability of the PDF.js library makes it an attractive solution for software teams looking to add native viewing functionality to their applications. As with many open-source frameworks, however, developers may quickly run up against a few complications when building out a viewing solution from scratch.

Out-of-the-box, PDF.js consists of three basic layers:

  • Core Layer: The heart of the JavaScript PDF library, this layer parses and interprets binary instructions from the file itself.
  • Display Layer: This interface handles the actual rendering of the PDF into a <canvas> element.
  • Viewer Layer: The primary viewing interface that allows users to view and interact with the document.

While the core and display layers can handle most documents, PDF.js doesn’t support the full PDF specification and sometimes struggles with rendering lengthy, complex, or image-heavy files. Overall performance is often on the slow side, and the way text is rendered makes text search somewhat unreliable.

More importantly, PDF.js lacks out-of-the-box mobile support. The included viewer doesn’t provide essential mobile UI features like pinch-to-zoom. It also doesn’t respond dynamically to mobile screens to ensure that menus and tools remain usable on all devices.

Any developer looking to add PDF viewing and editing capabilities to their web applications using PDF.js will need to solve these core issues. While features like responsive, mobile-friendly viewing may have been less important when PDF.js first released in 2011, they are considered essential by most users today. Unfortunately, building out these capabilities takes time and resources, which is something that few development teams have in abundance.

Integrating a ready-made viewer that combines the solid foundation of PDF.js with the innovative features users expect allows developers to quickly meet their project needs without pulling attention away from key aspects of their application.

Integrate PDF Solutions with Accusoft

While PDF.js has long served as an adequate open-source PDF viewing solution for web applications, today’s average user simply requires more functionality than PDF.js can provide on its own. For developers who lack the time, resources, or expertise necessary to build those additional features, Accusoft can help.

For over 30 years, Accusoft has helped organizations add essential features like viewing, file conversion, document assembly, and image compression to their applications through an innovative line of SDKs and APIs. 

Our document lifecycle technologies are backed by multiple patents and have been incorporated successfully into a wide range of applications. Accusoft’s dedicated engineers provide ongoing support and work closely with customers to implement their specific use cases, ensuring that their software platform is delivering the best possible experience.

To learn more about PDF viewing and editing solutions from Accusoft, talk to one of our technology experts today.

Question

Why am I unable to see the full menu bar with annotation and eSignature options?

Answer

These features are part of our Professional version. If you would like to evaluate the full feature set, please submit a request for a trial key here.

Banks and financial technology (fintech) companies commonly use document life-cycle management solutions to make their back-office functions run more smoothly. To take full advantage of these systems, organizations must be able to transform documents into a format they can work with.

Question

How can I tell which server has the cache for a specific document in a clustered PrizmDoc environment?

Answer

When a document is viewed, it creates a Viewing Session ID. That Viewing Session ID has information regarding which server in the cluster is doing the work, however, it is encoded and cannot be read directly.

In order to determine which PrizmDoc cluster server is doing the work for a specific document in a specific viewing session, you can do a text search for the Viewing Session ID in the plb.sep_multi.log on all servers. Only one server in the cluster will be a match for that Viewing Session ID.

Question

Can PrizmDoc handle password-protected files, such as PDFs or Excel files?
How would a user specify a password for a particular document?

Answer

It is possible to specify the password for a password-protected document when creating a viewing session in PrizmDoc. When sending a request to create a viewing session, you’ll use the password field in the request body to specify the password. For example…

POST http://localhost:3000/ViewingSession
Content-Type: application/json
{
    "source": {
        "type": "url",
        "url": "https://www.usability.gov/sites/default/files/creating-wireframes.pdf"
    },
    "password": "hunter2"
}

(Replace "hunter2" with the actual password)

Please note that even if a file needs a password and is not provided one (or is provided one that’s incorrect), the viewing session should still be created successfully. The easiest method to determine whether the password is needed/correct is to make a call to get the page. You can do this by making a GET request to the GetPage route using the viewingSessionId created earlier, like so…

GET pas_base_url/Page/q/0?DocumentID=u{viewingSessionId}

…be sure to replace pas_base_url with the root of your Prizm Application Services (PAS) instance (usually this is http://localhost:3000) and replace {viewingSessionId} with the actual value for viewingSessionId created in the previous step.

The above call will return 200 OK if the page load is successful. If a password is required/incorrect, you should see a return status code 480. There will be additional response headers called accusoft-status-number and accusoft-status-message, which should be 4001 and "Document requires a password", respectively.

You can see the above in greater detail in the product documentation here.

You can use this information to re-create a viewing session with the correct password.

Currently, there is a feature request planned for a potential future release of PrizmDoc to prompt the user for a password if one is required.