How to use the PDF Rasterizer

The PDF Rasterizer was designed to support non-image PDF files. There are merely 3 APIs

Addon.PDF.Download, Addon.PDF.SetResolution, Addon.PDF.SetConvertMode

There are 3 JS files and 2 zip files directly related to this add-on, they are found under /Resources/addon/


In order to use this add-on, the steps are

1.  Reference the file dynamsoft.webtwain.addon.pdf.js in your code.

<script type="text/javascript" src="Resources/dynamsoft.webtwain.initiate.js"> </script>
<script type="text/javascript" src="Resources/dynamsoft.webtwain.config.js"> </script>
<script type="text/javascript" src="Resources/addon/dynamsoft.webtwain.addon.pdf.js"> </script>

2.  Download the necessary DLL file and Set up the add-on

function Dynamsoft_OnReady() {
     DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
     if (DWObject) {

           function () { console.log('Successfully Downloaded PDF add-on');},
           function (errorCode, errorString) {alert(errorString); }

How it works

Dynamsoft has optimized this PDF Rasterizer internally so that when you have done the 2 steps above, the PDF rasterizer will be ready to work in your application. Basically, when you try to load or download any PDF file, the rasterizer will be called automatically to convert the PDF into images before loading them. In other words, the feature is turned on and you don’t need to write any extra code to use it.

Here is how the 'download' method works

.Addon.PDF.Download(remoteFile, [optionalAsyncSuccessFunc, optionalAsyncFailureFunc])



Is this page helpful?

Leave a Reply

Your email address will not be published.