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

I want the Thumbnail tab in PrizmDoc Viewer to be open by default. How can this be done?

Answer

A simple solution could be to simply implement a ‘click-on-the-button’ when you first open the Viewer, if you’re fine with the user being able to close the thumbnail pane:

$("[data-pcc-toggle=\"dialog-thumbnails\"]").click();

If you’d rather have the tab always open, in viewer.js there’s a function called toggleDialogs(opts) that checks for whether the thumbnail pane is being toggled through the opts.toggleID, and if so, adds openClass to the thumbDialog. You could modify this logic so that the thumbnail pane is permanently open.

PDF viewers

Few file formats are as widely recognized and used as PDF. In fact, PDFs have become so commonplace that it’s hard to imagine a time when they didn’t exist. Most users don’t even give them much thought, knowing that all they need to do is click on the file and trust that their PDF file viewer will be able to open and render it accurately. But things weren’t always quite so simple before PDF viewers.

Origins of PDF

It’s easy to take document viewing and printing for granted today, but to understand the development of the PDF format, it’s important to look back at the document challenges facing organizations in the early 1990s. Businesses, government agencies, and universities were already using local area networks to share digital documents, but there was no guarantee that a document would display the same way on every machine. In addition to multiple competing word processor formats (such as Microsoft Word and Corel WordPerfect), there was no reliable way of viewing files containing images or other layout elements across different software and operating systems.

Around that time, Adobe co-founder John Warnock became focused on the idea of creating a standardized document format that would work across all operating systems and effectively function like digital paper. The primary goal was to ensure that the document contents would look the same no matter where they were viewed. That meant solving complex challenges like replacing unsupported fonts without distorting the document’s layout and distilling graphic parameters to flatten the file so it would load within seconds instead of minutes.

Adobe released the first version of the Portable Document Format (PDF) in 1993, but it would take some time for the format to catch on. “The world didn’t get it,” Warnock recalled in a 2010 interview. “They didn’t understand how important sending documents around electronically was going to be.”

The early years were rocky, largely because PDF was just slightly ahead of its time. Early PDFs had limited functionality and were slightly too large to be sent quickly over the early internet connections. That began to change in 1996, however, when the Internal Revenue Service (IRS) used PDFs to provide downloadable tax return forms and instructions online. The IRS also started using PDF files to digitize their internal document processes, largely phasing out their reliance upon paper documents for auditing. This adoption convinced many hesitant organizations that if the format was good enough for the IRS, then it was good enough for them as well.

The Growth of PDF File Viewers

In the years following the introduction of PDF as an open format, a unique “freemium” model emerged that helped to promote its use across a variety of industries. While developers sold software that could be used to create, convert, edit, and secure PDFs, they also offered more streamlined PDF file viewers for free. This ensured that anyone could easily open and view PDF files no matter what kind of computer or operating system they were using. 

Although early readers were offered as separate software applications, they quickly became available as libraries that could be integrated into an existing application. By integrating a PDF file viewer directly into an application, developers could provide secure PDF support without having to rely upon any external software.

Today, there are multiple PDF file viewers available, which often makes it difficult to identify the one that provides the right combination of rendering performance and security for a particular industry’s needs.

The Rendering Challenge

Rendering a PDF file accurately is a deceptively complex task because not every file is constructed in the same way. In fact, prior to the PDF standard being taken over by the International Standards Organization (ISO) in 2007, Adobe’s documentation surrounding the format was rather infamously vague, resulting in the creation of poorly optimized PDFs that third party readers had difficulty viewing properly. Some PDF file viewers address this challenge by adding new code to accommodate known issues, but this has the unpleasant side effect of giving the reader a larger footprint and potentially impacting performance.

This challenge has become even more complex in recent years given the popularity of mobile devices. Effective PDF file viewers must be able to deliver a responsive viewing experience that can adjust their user interface (UI) to different sizes and types of screens.

The Security Challenge

Security has always been an important consideration for PDF file viewers, but it has become a much more prominent concern since the first virus capable of embedding itself in PDF files was uncovered in 2001. Unfortunately, security vulnerabilities continue to be a problem with third party PDF readers, as evidenced by the multiple vulnerabilities discovered in Adobe’s PDF products in 2020. While developers have more PDF file viewers to choose from than ever before, finding a solution that doesn’t introduce security risks has become a high priority when building a new application.

One of the best solutions for resolving security challenges is to build PDF capabilities directly into their already secure applications. Viewing or creating a PDF file in an external program, such as third party software or even within a web browser, introduces a potential functionality and control gap. It’s difficult to control what can be done with a PDF once it travels outside the confines of a secure application environment, allowing it to be downloaded, viewed, and potentially altered. With PDFs set to continue as the de facto standard for digital documents, it makes more sense than ever for developers to give their applications the ability to manage those files natively, without having to interface with external software dependencies.

Find the PDF File Viewer That’s Best for You

Developers have many choices when it comes to integrating PDF viewing capabilities, which is why Accusoft has developed a broad range of PDF integrations to address every potential use case. Our Accusoft PDF Viewer delivers a high-speed, lightweight JavaScript library that offers out-of-the-box mobile support and requires only a few lines of code to install. Available as a free-to-use integration, it’s the fastest way to add dynamic PDF viewing capabilities to your application without any configuration headaches. 

If your application needs more than just support for PDF viewing, PrizmDoc Viewer provides production-scale annotation, redaction, and conversion for multiple file types. As an HTML5 viewer, PrizmDoc Viewer easily integrates into applications to create a secure environment for documents and images. Try it today using an online demo or download a free trial to see how PrizmDoc Viewer can transform the way your application handles and views documents. 

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.

scalable vector graphics

The scalable vector graphic (SVG) format continues to enjoy steady adoption across the web. According to data from W3Techs, SVG now accounts for 25 percent of website images worldwide. But it wasn’t always this way. In 1998, it became apparent that vector-based graphics had a future on the web, and the W3C received six different file format submissions from technology companies that year. Some were mere proposals ready for a complete revamp, while others were proprietary products that W3C wasn’t permitted to modify. Instead of forging a format from one of the submissions, however, W3C’s SVG working group decided to start from the ground up — and SVG was born.

While the file format had lofty ambitions, focusing on common use rather than specific syntax, the original iteration was cumbersome and complex. However, SVG has improved year after year after year. With increased support came more streamlined functionality and usable features. Now, SVG is often the first choice for meeting the evolving demands of scalable, responsive, and accessible web content.


What is a Scalable Vector Graphic (SVG) and how does it work?

Today, SVG is the de-facto standard for vector-based browser graphics. But what exactly is this file format, and how does it work?

Based on XML, SVG supports three broad types of objects: 

  • Vector graphics including paths and outlines that are both straight and curved
  • Bitmap images such as .jpeg, .gif, and .png
  • Text

What sets SVG apart from bitmap-based images is the use of lines and curves along the edges of graphical objects. Because bitmap images use a fixed set of pixels, scaling them up creates blurriness where the edges of pixels meet. In the case of vector images, meanwhile, a fixed-shape approach allows the preservation of smooth lines and curves no matter the image size.

SVG also offers the benefit of interoperability. Because it’s a W3C open standard, SVG plays well with both other image format and web markup languages including JavaScript, DOM, CSS, and HTML. This allows the format to easily support responsive design approaches that scale websites and web content based on the user device rather than defining standardized size parameters. Thanks to the curves and lines of SVG, scaling presents no problem for responsive designers looking to ensure consistency across device types.


The Benefits of SVG

While scalability is often cited as the biggest benefit of SVG, this format also offers other advantages, including:

  • Responsiveness — Images can be easily scaled up or down and modified as necessary to meet web design and development demands.
  • Accessibility — Since SVG is text-based, content can be indexed and searched, allowing both users and developers to quickly find what they’re looking for.
  • Performance Image rendering is quick and doesn’t require substantive resources, allowing sites to load quickly and completely.
  • Use in Web ApplicationsBrowser incompatibilities and missing functions often frustrate web design efforts, forcing developers to use multiple tool sets and spend time checking content and images for potential format conflicts. SVG, meanwhile, offers powerful scripting and event support, in turn allowing developers to leverage it as a platform for both graphically rich applications and user interfaces. The result? Better-looking sites that enhance the overall user experience.
  • InteroperabilityBecause SVG is based on W3C standards, the format is entirely interoperable, meaning developers aren’t tied to any specific implementation, vendor, or authoring tool. From building their own framework from the ground up to leveraging third-party SVG applications, web developers can find their format best-fit.

SVG in PrizmDoc Viewer

Accusoft’s PrizmDoc Viewer offers multiple ways for developers to make the most of SVG elements at scale, such as:

  • File TransformationConversion is critical for effective and efficient web design. If development teams need different file transformation tools for every format, the timeline for web projects expands significantly. PrizmDoc Viewer streamlines this process with support for the conversion of more than 100 file types — including PDFs, Microsoft Office files, HTML, EML, rich text, and images — into browser-compliant SVG outputs. In practice, this permits near-native document and image rendering that’s not only fast, but also accessible anytime, anywhere, and from any device.
  • HTML5 FunctionalityUsing SVG in PrizmDoc Viewer is made easier thanks to native HTML5 design. The use of HTML5-native framework not only improves load times with smaller document sizes but means that PrizmDoc Viewer works in all modern web browsers — while also dramatically enhancing document display quality.
  • Pre-Conversion One of the biggest challenges with viewing large documents in a browser is delay. Pages toward the end of the document may take longer to load and frustrate users looking to quickly find a specific image or piece of information. PrizmDoc Viewer solves this problem with a pre-conversion API that returns the first page as an SVG while the rest of the document is being converted, allowing users to interact with documents as conversion takes place and lowering the chance that files will experience format-based delays.

SVG hasn’t always been the go-to web image format. Despite a promising start based on open, interoperable standards, the lack of early support and specific use cases for vector-based file formats saw SVG sitting on the sidelines for decades. 

The advent of on-demand access requirements and mobile-first development realities has changed the conversation. SVG is now continuously gaining ground as companies see the benefit in this scalable, streamlined, and superior-quality file format. Get the big picture and see SVG in action with our online document viewing demo, or start a free PrizmDoc Viewer trial today!

Question

In PrizmDoc, my document appears to be small on the page relative to the viewer. How can I fix this?

enter image description here

Answer

By default, PrizmDoc renders a PDF file according to the MediaBox, which is normally the same as CropBox, though sometimes this is not the case. The larger area you see in the PrizmDoc Viewer is the size of the MediaBox. Please note that the product provides the fileTypes.pdf.pageBoundaries control option (or useCropBox in the older versions) to change the default behavior. Try setting the option to cropBox in the Central Configuration File in order to get the PDF content rendered according to the CropBox. You can read more about configuring image frame rendering in our documentation here.

For additional reading, see 7.7.3.3 on “User Space” of Adobe’s PDF 1.7 specification:

https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf

Note: In some older versions of PrizmDoc, there exists an issue where setting the pageBoundaries field to cropBox can cause light blurring/distorting on the page. This issue was addressed in version 13.4.

Question

How can I remove the scroll bar/disable scrolling in PrizmDoc Viewer?

Answer

A quick way to do this would be to have something like the code below. Make sure to do this after this DOM element has loaded, so after the viewer is ready.

$('.pccPageListContainerWrapper').css('overflow', 'hidden');

The following will both remove the scroll bar, and disable scrolling:

$('.pccPageListContainerWrapper').css('overflow', 'unset');
Question

No matter what CSS I use, the viewer’s div always consumes the full screen. How can I fix it?

Answer

If you’re trying to modify the PrizmDoc Viewer samples, then your CSS is most likely being overridden by the setting fullScreenOnInit: true. Change this property to false and you should be able to use any of the scaling CSS that you would use on a normal div.

Question

What file formats does PrizmDoc Viewer currently support?

Answer

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

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