Technical FAQs

Question

How do I ensure temp files are deleted when closing ImageGear .NET?

Answer

All PDF objects are based on underlying low-level PDF objects that are not controlled by .NET resource manager and garbage collector. Because of this, each PDF object that is created from scratch should be explicitly disposed of using that object’s Dispose() method.

Also, any ImGearPDEContent object obtained from ImGearPDFPage should be released using the ImGearPDFPage.ReleaseContent() in all cases.

This should cause all temp files to be cleared when the application is closed.

Question

How do I ensure temp files are deleted when closing ImageGear .NET?

Answer

All PDF objects are based on underlying low-level PDF objects that are not controlled by .NET resource manager and garbage collector. Because of this, each PDF object that is created from scratch should be explicitly disposed of using that object’s Dispose() method.

Also, any ImGearPDEContent object obtained from ImGearPDFPage should be released using the ImGearPDFPage.ReleaseContent() in all cases.

This should cause all temp files to be cleared when the application is closed.

Developers have plenty of options for viewing PDFs in their applications. With so many solutions to choose from, it’s easy to put off thinking about PDF support until much later in the development process. But doing so is often a recipe for trouble, resulting in ad hoc workarounds and settling for third-party plug-ins or native browser support that could impact application performance and security.

Directly embedding a web-based PDF viewer provides developers with much more flexibility and control over how their application manages and presents PDFs. By integrating a PDF JavaScript (PDF JS) viewer early in the development process, it’s easier to build a better user experience that doesn’t force users to take additional steps in order to interact with PDFs.

5 Benefits of an Embedded Web PDF Viewer

1. Consistent Viewing Experience

One of the original intentions of the PDF format was to ensure that documents would look the same no matter where or how they were being viewed. Unfortunately, not every viewer renders documents in the same way. More importantly, there are so many different ways of building a PDF that it can be difficult to know if it contains certain elements that are difficult for certain viewers to manage. This is typically the case with fonts and other formatting issues. While flattening the PDF can often address many of these issues, there are many instances where rasterizing the document robs it of valuable functionality (fillable form fields, for example).

By embedding a web PDF viewer directly into an application with a PDF JS integration, developers can ensure that users will always have a consistent viewing experience. Since the application will automatically open PDFs rather than handing the viewing task off to a browser plug-in or an external program on the user’s device, the document should render exactly as it was intended to look. This helps to avoid confusion and helps to enhance the user’s overall experience within the application.

2. Control Over Files

Organizations put a lot of time and resources into safeguarding confidential assets, but they can quickly undermine those efforts by failing to maintain control over their documents when sharing them. Many PDF viewing solutions allow or even require someone to download the document without having to obtain any special permissions. While this typically isn’t a major concern for public-facing documents, it could be disastrous for any shared PDFs that contain sensitive data or private information.

When developers use an embedded web PDF viewer, they allow document owners to maintain control over what people can and cannot do with shared PDFs. If they simply want someone to be able to view a document, but not edit it or download it, they can set the right permissions and restrictions to maintain control over the file. Embedding a PDF JS viewer is essential to this approach because it creates the conditions of the viewing experience.

3. Responsive Viewing

Today’s PDF viewing solutions need to account for what the viewing experience looks like on multiple screen sizes and devices. Not everyone will be reading a document on a conventional computer screen. They may want to view PDFs on a tablet or smartphone, both of which call for different viewing controls due to the nature of the device interface.

Without an embedded web PDF viewer, mobile users may not be able to readily access PDF-based content within an application. For customer facing solutions, this can seriously compromise the user experience. It’s also a major obstacle for organizations seeking to leverage an application to support a collaborative workplace. By integrating that viewing support, developers can ensure that users will be able to view PDF documents easily no matter what device they’re using.

4. No Dependencies

Many PDF viewing solutions offer extensive features, but at the cost of impacting application performance and security. That’s because they require cumbersome, memory-intensive plug-ins or complex server configurations. Even worse, they may be completely separate third-party solutions that require PDF files to be shared outside a developer’s secure application environment.

With the right PDF JS library, developers can easily integrate web PDF viewing capabilities directly into the browser without resorting to any external dependencies. Since JavaScript PDF viewers are so lightweight, they can be installed with a small amount of code that doesn’t have an impact on application performance. And since a PDF JS viewer can render PDFs within the solution, there’s no reason to risk exposing them to external software environments.

5. Easy Annotation and eSignature

Many organizations have understandably come to expect PDF viewers to come fully equipped with annotation tools that allow them to mark up files without having to transfer them to another program. They also frequently need the ability to sign documents as part of ongoing business dealings. For customer facing applications, these features are incredibly valuable because they streamline many processes for users. 

By embedding a web PDF viewer capable of supporting annotations and eSignatures, developers can quickly provide that functionality without having to build a new solution from scratch. Many annotation tools require complex backend server dependencies, so having those essential features integrated within a lightweight JavaScript PDF library can greatly improve web application performance.

Embed a Web PDF Viewer Today with Accusoft PDF Viewer

As a lightweight JavaScript PDF library, Accusoft PDF Viewer allows developers to add dynamic PDF support to their applications in a snap. While many PDF JS solutions require complicated coding to integrate properly, Accusoft PDF Viewer delivers PDF functionality to a web application with just ten lines of code.

See for yourself:

<div id="viewer">
</div> <script>
   (async () => {
     const pdfViewer = await window.Accusoft.PdfViewerControl.create({
       sourceDocument: 'https://MyURL.com/MyPDF.pdf',
       container: document.getElementById('viewer')
     });
   })();
 </script>

Accusoft PDF Viewer builds upon the versatility and reliability of the popular PDF.js open-source library, which serves as the foundation of many commercial PDF viewing solutions. From there, we used our extensive imaging technology expertise to push the boundaries in terms of rendering performance and usability. Optimized for speed and ease of use, the Standard Version of this JavaScript-based PDF viewer provides multiple benefits to developers looking to add robust viewing support without bogging down their development cycle:

  • Responsive UI: Easily view and interact with PDFs on any screen size thanks to optimized mobile controls.
  • Powerful Rendering: Smart rendering technology ensures that images remain crisp at all zoom levels.
  • Lightning-Fast Search: Get near-instant search results when trying to locate specific text, even when viewing large documents.
  • 100% Client-Side: With no server configurations or plug-ins, all viewing sessions remain entirely within a secure application environment.

For developers looking for expanding functionality, Accusoft PDF Viewer Professional version adds a number of important features:

  • UI Customization: Adjust the PDF viewer UI by adding or removing toolbar elements to create a better viewing experience.
  • Annotation: Markup PDF files with multiple annotation tools, then store or retrieve markups with an API.
  • eSignature: Create freehand signatures to sign documents on computers, tables, or smartphones.
  • White Labeling: Add customized branding to the viewer for a more consistent experience.

Accusoft PDF Viewer Standard Version can be downloaded today at no cost to quickly embed PDF features into any web-based application with just a few lines of code. When it’s time to add expanded functionality, we make it quick and easy to upgrade to Professional Version.

Check out the Accusoft PDF Viewer fact sheet for a detailed breakdown of the two versions. If you’re ready to get started, you can download Standard Version right now to try it for yourself.

Accusoft PDF Viewer builds upon the versatility and reliability of the popular PDF.js open-source library, which serves as the foundation of many commercial PDF viewing solutions. From there, we used our extensive imaging technology expertise to push the boundaries in terms of rendering performance and usability. Optimized for speed and ease of use, the Standard Version of this JavaScript-based PDF viewer provides multiple benefits to developers looking to add robust viewing support without bogging down their development cycle:

  • Responsive UI: Easily view and interact with PDFs on any screen size thanks to optimized mobile controls.
  • Powerful Rendering: Smart rendering technology ensures that images remain crisp at all zoom levels.
  • Lightning-Fast Search: Get near-instant search results when trying to locate specific text, even when viewing large documents.
  • 100% Client-Side: With no server configurations or plug-ins, all viewing sessions remain entirely within a secure application environment.

For developers looking for expanding functionality, Accusoft PDF Viewer Professional version adds a number of important features:

  • UI Customization: Adjust the PDF viewer UI by adding or removing toolbar elements to create a better viewing experience.
  • Annotation: Markup PDF files with multiple annotation tools, then store or retrieve markups with an API.
  • eSignature: Create freehand signatures to sign documents on computers, tables, or smartphones.
  • White Labeling: Add customized branding to the viewer for a more consistent experience.

Accusoft PDF Viewer Standard Version can be downloaded today at no cost to quickly embed PDF features into any web-based application with just a few lines of code. When it’s time to add expanded functionality, we make it quick and easy to upgrade to Professional Version.

Check out the Accusoft PDF Viewer fact sheet for a detailed breakdown of the two versions. If you’re ready to get started, you can download Standard Version right now to try it for yourself.

Question

When using OCR in ImageGear .NET, is there any way to distinguish between a capital/uppercase letter O and the number 0?

Answer

Not without context or a font that makes the difference clear (such as one with a slashed 0). ImageGear will properly recognize Oliver and 1530 as containing O and 0, respectively, but cannot reliably distinguish it when letters and numbers are mixed. That is, ImageGear may not reliably distinguish between 1ABO0F3 and 1AB0OF3.

Question

The logging for ImageGear C & C++ Deployment Packaging Wizard (DPW) is showing different output for some components since v19.3, why is this?

In ImageGear C & C++ v19.2 and prior, the DPW had additional logging information for the ARTX component in its deployment.log:

Deploying an application that uses the ARTXGUI library of ImageGear
ARTX Component requires the following merge modules to be installed:

Microsoft_VC90_CRT_x86_x64.msm

Microsoft_VC90_MFC_x86_x64.msm

But since v19.3, the logs are no longer telling me to install these modules. Is this a mistake, or are they no longer necessary?

Answer

This was an intentional change on our end, and the Deployment Packaging Wizard (DPW) is working as intended. We made some updates to the DPW in the latest release; one update is that the CRM requirements for CORE (which is required in every project) now also covers the ARTX component. If the DPW is not saying you need additional components to use the ARTX component, then you’ll be fine.

Question

Why do I get a “File Format Unrecognized” exception when trying to load a PDF document in ImageGear .NET?

Answer

You will need to set up your project to include PDF support if you want to work with PDF documents. Add a reference to ImageGear24.Formats.Pdf (if you’re using another version of ImageGear, make sure you’re adding the correct reference). Add the following line of code where you specify other resources:

using ImageGear.Formats.PDF;

Add the following lines of code before you begin working with PDFs:

ImGearFileFormats.Filters.Insert(0, ImGearPDF.CreatePDFFormat());
ImGearPDF.Initialize();

The documentation page linked here shows how to add PDF support to a project.

Question

How do I use a Network Drive path for Image and ART storage in my ImageGear .NET web application?

Answer

In an ImageGear .NET web application, you have to define the location of the images and annotations directory in the storageRootPath and artStorageRootPath configuration property.
In the current version of ImageGear .NET, the storageRootPath and artStorageRootPath do not work with a network drive path \\SERVER-NAME\sharefilename.

The workaround for this would be to create a Symbolic link from a local directory to the network drive directory.

  • To create a symbolic link: Open “Command Prompt” as Administrator and type in > mklink /d "local path" \\SERVER-NAME\sharefilename
  • Pass in the path of the symbolic link as image or art storage root path in your web.config: storageRootPath="local path" artStorageRootPath="local path"
Question

How do I use a Network Drive path for Image and ART storage in my ImageGear .NET web application?

Answer

In an ImageGear .NET web application, you have to define the location of the images and annotations directory in the storageRootPath and artStorageRootPath configuration property.
In the current version of ImageGear .NET, the storageRootPath and artStorageRootPath do not work with a network drive path \\SERVER-NAME\sharefilename.

The workaround for this would be to create a Symbolic link from a local directory to the network drive directory.

  • To create a symbolic link: Open “Command Prompt” as Administrator and type in > mklink /d "local path" \\SERVER-NAME\sharefilename
  • Pass in the path of the symbolic link as image or art storage root path in your web.config: storageRootPath="local path" artStorageRootPath="local path"
Question

Why do I get a “File Format Unrecognized” exception when trying to load a PDF document in ImageGear .NET?

Answer

You will need to set up your project to include PDF support if you want to work with PDF documents. Add a reference to ImageGear24.Formats.Pdf (if you’re using another version of ImageGear, make sure you’re adding the correct reference). Add the following line of code where you specify other resources:

using ImageGear.Formats.PDF;

Add the following lines of code before you begin working with PDFs:

ImGearFileFormats.Filters.Insert(0, ImGearPDF.CreatePDFFormat());
ImGearPDF.Initialize();

The documentation page linked here shows how to add PDF support to a project.