PDFTron Systems Inc. | Documentation (2023)

How to save rasterized files in a given folder?

By default, PDF2Image saves rasterized files in the current workingfolder. To specify another output location, use the '-o' (or --output)parameter. For example:

pdf2image --o "c:\My Output" 1.pdf 2.pdf 3.pdf

Note: If the specified path does not exist, PDF2Image will attempt tocreate the necessary folders.

How can I control the output name for rasterized/converted images?

By default, PDF2Image creates a separate image file for every page inthe document. The output filename is constructed using the name of theinput PDF file, page counter, and appropriate image extension. Forexample, the following command-line generates a sequence of image filesstarting with mydoc_1.jpg, mydoc_2.jpg, etc.:

pdf2image -f jpg mydoc.pdf

PDF2Image allows output filename customizations using the '--prefix'and '--digits' options. For example, the following command-linegenerates a sequence of image files starting with newname_0001.jpg,newname_0002.jpg, etc.:

pdf2image -f jpg --prefix newname --digits 4 mydoc.pdf

The '--digits' parameter specifies the number of digits used in thepage counter portion of the output filename. By default, new digits areadded as needed, however this parameter could be used to format the pagecounter field to a uniform width (e.g. myfile0001.jpg, myfile0010.jpg,instead of myfile_1.jpg, myfile_10.jpg, etc).

To avoid any ambiguities in file naming, the prefix option should beused only for conversion of individual documents.

If your output image format is TIFF, you can convert PDF to a single,multi-page TIFF document using the '--multipage' option (See 'How do Iconvert PDF to multi-page TIF?' for an example).

How do I convert PDF to JPEG, PNG, TIF or some other image format?

By default, PDF2Image automatically converts PDF to PNG. The outputimage format can be modified using the '-f' (or --format) option. Forexample,

pdf2image -f jpg in.pdf

will convert PDF to JPEG.

The '--format' parameter accepts any of the following output formats:

  • png - (Portable Network Graphics)

  • png8 -- (Palletized PNG)

  • jpg or jpeg (Joint Photographic Expert Group)

  • tif or tiff (Tagged Image File Format)

    (Video) PDFTron SDK Demo -5 minute overview- View PDF, MS Office, images, customization, redaction, editing

  • bmp (Windows Bitmap Format)

  • raw (raw RGB or Gray data)

How do I convert PDF to multi-page TIF?

If your output image format is TIFF, you can convert PDF to a single,multi-page TIFF document instead of a separate file for every page usingthe '--multipage' option.

For example:

pdf2image --multipage -f tif --verb 3 mypdf.pdf

How do I open a password protected PDF?

PDF2Image will, without user intervention, decrypt and convert documentssecured with a master/owner password. If the document is secured using auser (or file open) password, PDF2Image will prompt you to enter thepassword.

For unattended conversion, the password can also be specified directlyon the command-line using the '-p' (or --password) option. For example:

pdf2image -p secret -f png secured.pdf

The above command line will convert PDF to PNG and will use the providedpassword ('secret') to open the secured document (i.e. 'secured.pdf').

Note: PDF2Image supports all standard security options available in PDF,including 40 and 128 bit RC4 encryption, Crypt filters, and 128 AES(Advanced Encryption Standard) encryption.

How do I create grayscale images?

By default, PDF2Image uses the RGB color model for rasterization andimage export. You can instruct PDF2Image to use single channel DeviceGray color model for rasterization and image export using the '--gray'option. For example:

pdf2image -f tiff --gray in.pdf

How do I specify which pages to convert?

By default, PDF2Image will rasterize and convert all PDF pages to outputimage format. You can specify a subset of pages to convert using the'-a' or '--pages' options. For example:

pdf2image -a 1,3,10 in.pdf

will convert only pages 1, 3, and 10. Please note that PDF2Image assumesthat all pages are numbered sequentially starting from page 1.

To specify a range of pages, use dash character between numbers. Forexample:

pdf2image -a 1,10-20,50- in.pdf

(Video) How to View and Compare PDFs, Office Files, and Images Side by Side - PDFTron Fall 2022 Release

will render the first page, pages in the range from 10 to 20 and allpages starting with page 50 to the last page in the document.

All even pages can be selected using the 'e' (or 'even') string. Forexample, the following line renders all even pages:

pdf2image --pages even in.pdf

Similarly odd pages can be selected using the 'o' (or 'odd') string. Thefollowing line renders all odd pages in the document and every page inthe range from 100 to the last page:

pdf2image --pages odd,100- in.pdf

How do I specify the resolution of the output image?

Using PDF2Image output image resolution can be specified explicitly(using the '--d' or '--dpi' option) or implicitly (using the '--hres'and '--vres' parameters). In this section, we cover the use of the'--dpi' parameter. For more information on the '--hres' and '--vres'parameters, see 'How do I specify dimensions of the output image inpixels?'

By default, PDF2Image uses resolution of 92 Dots Per Inch (DPI), whichis the typical screen resolution. Smaller DPI numbers result in smallerimages (e.g. suitable for use as thumbnails), while larger DPI numbersgenerate larger images (e.g. suitable for high-quality output).

For example, to convert a PDF document to a multi-page TIF at 300 DPI(Dots Per Inch), use the following line:

pdf2image -f tif --multipage --dpi 300 in.pdf

Depending on the dimensions of the input page, high DPI/resolutionrasterization requires lots of memory. For example, rasterization of asingle A4 page (8x11) at 1000 DPI will require more than 350MB ofmemory. If PDF2Image fails to allocate enough memory, you can render theimage in stripes or tiles, as described in 'How do I renderhigh-resolution images', or by trying to decrease DPI value.

A 'typical' range of acceptable DPI values is between 1 and 1000 DPI.PDF2Image can rasterize images beyond 1000 or 2000 DPI using tiled orstriped rendering.

How do I specify dimensions of the output image in pixels?

To specify absolute dimensions of the output image in pixels, use the'--hres' and '--vres' parameters.

When these parameters are specified, PDF2Image will automaticallydetermine the DPI (Dots Per Inch) ratio required to match the pixeldimensions of the output image.

For example, to generate 100 by 100 pixels thumbnails for a given PDF,you can use the following line:

pdf2image -f jpg --hres 100 --vres 100 in.pdf

Because the input PDF page may not perfectly fit the absolute pixel sizeof the output image, PDF2Image will also center the page and preservethe aspect ratio during rendering.

To generate images that are proportional in their size to the input PDFpages, simply omit one of the parameters (either --hres or --vres).For example,

pdf2image -f jpg --hres 100 in.pdf

will convert all PDF pages to images that are 100 pixels wide, withheight proportional to the dimensions of the input page.

(Video) Desktop-Caliber PDF Editing in a Web App - PDFTron Fall 2022 Release

Similarly, the following line will create images with fixed height (100pixels) and variable width (to preserve the aspect ratio).

pdf2image -f jpg --vres 100 in.pdf

How do I render only a subset of a given page?

Using PDF2Image you can rasterize a subset of a page using the '--clip'parameter. The parameter accepts a list of four numbers, separated usingcommas, giving the coordinates of a pair of diagonally opposite corners.Typically, the list takes the form: llx, lly, urx, ury specifying thelower-left x, lower-left y, upper-right x, and upper-right ycoordinates of the rectangle, in that order. The other two corners ofthe rectangle are then assumed to have coordinates (llx, ury) and(urx, lly). All coordinates need to be expressed in points (a basicunit of PDF 'user' coordinate system). One PDF point is 1⁄72 of an inchand is approximately the same as a point (unit commonly used in theprinting industry).

The '--clip' parameter is not only useful for cropping pages, but itcan be also used to speed up the rendering process and to reduce memoryconsumption (see 'How to I render very large images?' fordetails).

PDF2Image also supports clipping to predefined page regions, such aspage media, crop, trim, bleed, and art box. For more information onclipping to predefined regions, see 'How can I show/hide crop marksor the trim region?

How do I render very large images?

Depending on the dimensions of the input page, high DPI/resolutionrasterization requires lots of memory. For example, rasterization of asingle A4 page (8x11) at 1000 DPI will require more than 350MB ofmemory. If PDF2Image fails to allocate enough memory (a singlecontiguous block of memory), you can render the image in stripes ortiles by repeatedly rendering different regions of the page using the'--clip' parameter (also see 'How do I render only a subset of agiven page?').

For example, if the input page has a media box 0,0,595,842, you couldrender the page at 2000 DPI (Dots Per Inch) in four stripes (using 210.5point increments along the Y axis) as follows:

pdf2image --dpi 2000 --clip 0,0,595,210.5 --prefix t01 Test/tiger.pdf

pdf2image --dpi 2000 --clip 0,210.5,595,421 --prefix t02 Test/tiger.pdf

pdf2image --dpi 2000 --clip 0,421,595,631.5 --prefix t03 Test/tiger.pdf

pdf2image --dpi 2000 --clip 0,631.5,595,842 --prefix t04 Test/tiger.pdf

Rendering of the same image in a single pass would require more than 1.4GB in memory.

How do I batch convert files?

PDF2Image supports batch conversion of many PDF files in a single pass.To convert all PDF files in a given folder(s) you can use the followingsyntax:

pdf2image myfolder1

The '--subfolders' option can be used to recursively process allsubfolders. For example, the following line will convert all documentsin 'myfolder1' and 'myfolder2' as well as all subfolders:

pdf2image --subfolders myfolder1 myfolder2

By default, PDF2Image will convert all files with the extension '.pdf'.To select different files based on the extension use the '--extension'parameter. For example, to convert all PDF documents with a customextension '.blob', you could use the following line:

pdf2image --extension .blob --subfolders myfolder1

(Video) How to Edit PDF Tables of Contents and Create Custom Bookmarks - PDFTron Fall 2022 Release

How do I specify compression ratio for JPEG format?

The JPEG image format offers a lossy type of compression and the optionto trade between the loss in image quality and compression ratio. Tofine-tune JPEG compression quality, use the '--quality' parameter asillustrated in the following sample:

pdf2image --quality 80 -f jpg Test/tiger.pdf

Compression quality is a number in the range from 1 to 100. Lowernumbers usually result in better compression at the expense of imagequality. The default in 80.

How can I rotate pages?

By default, PDF2Image respects page rotation attribute. Image rotationcan be modified using the '-r' (or --rotate) option. For example, thefollowing line rotates all pages 90 degrees counterclockwise:

pdf2image --rotate 90 Test/tiger.pdf

Similarly, the following line rotates the page 270 degreescounterclockwise (or 90 degrees clockwise):

pdf2image --rotate 270 Test/tiger.pdf

How can I show/hide crop marks or the trim region?

A PDF page can define as many as five separate boundaries to controlvarious aspects of the imaging process:

  • The media box defines the boundaries of the physical medium on whichthe page is to be printed. It may include any extended areasurrounding the finished page for bleed, printing marks, or othersuch purposes. It may also include areas close to the edges of themedium that cannot be marked because of physical limitations of theoutput device. Content falling outside this boundary can safely bediscarded without affecting the meaning of the PDF file.

  • The crop box defines the region to which the contents of the pageare to be clipped (cropped) when displayed or printed. Unlike theother boxes, the crop box has no defined meaning in terms ofphysical page geometry or intended use; it merely imposes clippingon the page contents. The default value is the page's media box.

  • The bleed box defines the region to which the contents of the pageshould be clipped when output in a production environment. This mayinclude any extra bleed area needed to accommodate the physicallimitations of cutting, folding, and trimming equipment. The defaultvalue is the page's crop box.

  • The trim box defines the intended dimensions of the finished pageafter trimming. It may be smaller than the media box to allow forproduction related content, such as printing instructions, cutmarks, or color bars. The default value is the page's crop box.

  • The art box defines the extent of the page's meaningful content(including potential white space) as intended by the page's creator.The default value is the page's crop box.

By default, PDF2Image uses the page crop box as a default clip region.Different page regions can be selected as the default clip region usingthe -b (or --box) parameter. For example, the following line willinstruct PDF2Image to use the media box for rasterization:

pdf2image --box media in.pdf

How do I render PDF as CCITT Group 4 FAX TIFF or monochrome PNG?

To render the PDF as a monochrome (1 bit per pixel) image compressedusing G4 CCITT, simply add the option '--mono' within the command-linestring. For example,

pdf2image --mono -f TIFF --verb 10 --dpi 300 in.pdf

(Video) PDFTron Salesforce customization: Built-in, full-functioning document lifecycle capability

Does PDF2Image have any dependencies on third party components/software?

PDF2Image is a completely stand alone application and does not includeany dependencies on third-party components or software.


What is PDFTron used for? ›

PDFTron SDK is a technology platform that brings PDF, CAD, and MS Office capabilities to any software. It's an easier and faster way to build document functionality, making your developers more productive and your users happier.

Is PDFTron free? ›

We provide you with the full SDK for a free trial, with technical support included, to help you throughout your testing phase. We also provide consultation on how to tailor the SDK to fit your requirements and guarantee an effective and successful evaluation.

Is SaaS a PDFTron? ›

PDFTron's versatile commercial SDK was used to create this powerful, consumer-friendly SaaS suite of PDF viewing, annotating, editing and conversion tools.

What is PDFTron WebViewer? ›

WebViewer is a JavaScript library for viewing, annotating, and editing documents. At its simplest, you can view a document by passing a DOM element where WebViewer will be placed inside your app and provide WebViewer a document URL. JavaScript.

Is Netflix example of SaaS? ›

Everything You Need To Know About Netflix a SaaS

Yes, Netflix is a SaaS company that sells software to observe permitted videos on demand. It follows a subscription-based model whereby the user selects a subscription plan and pays a stable sum of money to Netflix monthly or annually. What is Netflix?

Does Netflix count as SaaS? ›

First of all, to answer the question in the title: Yes, Netflix is a SaaS company that sells software to watch licensed videos on demand. It follows a subscription-based model whereby the user chooses a subscription plan and pays a fixed sum of money to Netflix monthly or annually.

Is Tesla a SaaS? ›

Tesla Third Row - Ross: Tesla becoming a Software as a Service (SAAS) Company. Tesla's tech opportunities seem endless. CEO Ross Gerber joins the podcast Third Row Tesla to discuss the reality of the car manufacturer becoming a Software as a Service (SAAS) Company.

What is Web Viewer? ›

The Web Viewer app allows you to insert secure web pages into your presentation. Secure web pages are those that start with https://. Non-secure web pages are not supported for security reasons. Most popular websites allow secure access.

How do I update my Webviewer? ›

Update Android System Webview
  1. Launch the Settings app.
  2. Tap Apps.
  3. Select Android System WebView.
  4. Tap App details in store.
  5. Tap Update. Then, restart the device.
25 Mar 2022

What category is SaaS? ›

SaaS is one of three main categories of cloud computing, alongside infrastructure as a service (IaaS) and platform as a service (PaaS). A range of IT professionals, business users and personal users use SaaS applications. Products range from personal entertainment, such as Netflix, to advanced IT tools.

Are SaaS licenses capitalizable? ›

The main idea is that the direct costs during the development phase associated with the SAAS application, including the ongoing license or service fees, should be capitalized. The other costs should be expensed as incurred, including any pre- or post-implementation costs.

Is Experian a SaaS? ›

That's why we've worked tirelessly to provide a new solution that brings the efficiency and scalability of software-as-a-service (SaaS) technology to your credit and loan decision software. Our SaaS platform automates loan origination through cloud computing so you can quickly acquire high-value customers.

What type of architecture is SaaS? ›

SaaS architecture refers to a method of software delivery, in which a vendor hosts an application on a remote server for an organization before delivering the app's capabilities to that organization's end users over the Internet.


1. How to build a scalable document generation solution for tedious contracts, invoices and reports
2. How to improve document experience in Financial software
3. PDFTron + Salesforce: Native document viewing, generating, collaborating and signing capabilities
4. PDFTron Live Demo for Fall 2021
5. React App for signing PDFs - PDFTron Sign App
6. How to generate PDF with PDFTron PDFNet Node.js SDK
Top Articles
Latest Posts
Article information

Author: Maia Crooks Jr

Last Updated: 12/28/2022

Views: 5636

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Maia Crooks Jr

Birthday: 1997-09-21

Address: 93119 Joseph Street, Peggyfurt, NC 11582

Phone: +2983088926881

Job: Principal Design Liaison

Hobby: Web surfing, Skiing, role-playing games, Sketching, Polo, Sewing, Genealogy

Introduction: My name is Maia Crooks Jr, I am a homely, joyous, shiny, successful, hilarious, thoughtful, joyous person who loves writing and wants to share my knowledge and understanding with you.