You can run PDF2IMG with a few as two command line arguments, including the name of the input PDF document and the graphic format you want to convert it to (such as TIF or JPG). But you have many other options and additional command line arguments you can use to create an argument.
Note: You can always enter the command pdf2img -help to list details of the command line syntax.
Required
inputFile
inputFile
The inputFile argument is the name of your input PDF or XPS file. Specify a path to its location if it is not in your present working directory.
Note: By default the software will place your output files in the same folder as your input file, unless you specify otherwise using the -output option. See Redirecting Output to Another Location. If an existing version of the same output file is stored in the output directory, PDF2IMG will overwrite that earlier version of the file with the new output file if the two files share the same name.
outputForm
outputForm
This argument defines the output graphic format you request: BMP, EPS, GIF, JPG, PDF, PNG, RAW or TIF.
Note: The limit for JPEG output image size is 65535 x 65535 pixels. TIF output has been tested up to a band of 68898 x 34449 pixels in size.
Optional
asprinted
-asprinted
By default, PDF2IMG renders the document to image format in the form as you would see it on screen, not as you would see it on paper. Normally, print annotations are omitted from the rendering process and only those annotations intended for viewing on screen are included, but -asprinted allows you to override that and reverse the distinction. That way you can render printable annotations, or those annotations which have been flagged as printable by the document author, when converting the document to an image.
Further, the use of -asprinted will suppress annotations flagged by the document author as for viewing on screen only (non-printing). Those will no longer appear in output images if this argument is selected.
Note: This command can be overridden by the -noannot flag.
blackisone
-blackisone
(TIFF Only: No default)
Use the -blackisone argument to direct PDF2IMG to declare a reversed PhotometricInterpretation value of black=1;white=0 in the header of TIFF image file. The TIFF image file is defined with an output of 1-bit (black and white). This argument corrects a problem existing in some third-party PDF documents, where the converted TIFF output may unexpectedly display in reversed (negative) format when viewed via certain display utilities.
Consider the Windows Explorer screenshot below. The white on black thumbnail image at right shows one such problem document which was converted without the -blackisone flag. The corrected equivalent is on the left:
You normally will not need this switch. Also, -blackisone will have no visible effect on systems or utilities that read and understand the Photometric Interpretation setting in the image header, since they will reverse their interpretation to correspond to that setting, and their output will look the same either way. This only affects systems having a fixed interpretation that does not agree with the original encoding of the image, and gives you the ability to reverse the image encoding if needed.
Note: This switch is intended to correct a problem of unwanted display reversals seen in documents produced by some third-party PDF products. It is not intended for generating negative output. If you want to generate reverse or negative images, use the reverse switch.
blendingspace
–blendingspace=[description|.icc file name]
-blendingspace=“Adobe RGB (1998)”
-blendingspace=c:\Windows\System32\spool\drivers\color\CoatedFOGRA39.icc
(Default: CMYK)
Users can specify a blending color space, by naming a profile description, or providing a name and path of the profile (.icc) file.
PDF files can have objects that are partially or fully transparent, and thus can blend in various ways with objects behind them. Transparent graphics or images can be stacked in a PDF file, with each one contributing to the final result that appears on the page. With a stack of transparent images, the final colors shown are the result of blending the colors of all of the overlapping objects. The flattening process merges a stack of transparent objects or graphics images into a single image on the page. Flattening images in a PDF file is necessary before you can render the page as a graphics image.
If a page in a PDF document has transparencies that need to be flattened, the page must go through an intermediate blending space before it can be rendered as a graphic output file. By default that blending space is CMYK in PDF2IMG, but you can use the blendingspace option to select your own color profile for flattening transparencies, in the form of an .icc file.
bpc
-bpc=[1 | 8]
-bpc=1
-bpc=8
(Default: 8)
This argument refers to the Image Depth expressed as Bits per Color channel, or the number of bits used to represent a color channel sample in the selected output format. Typically the bpc is 8 for color or grayscale images, and 1 for black and white.
This dictates the number of different values or levels that each color channel may have, by specifying how many bits can be allocated for the color channel value. Thus a bpc of 1 indicates that the color can only be either all present or all absent (such as black and white), since the single bit can only represent 0 or 1, the presence or absence of that color. A bpc of 8 indicates that eight bits are allocated for each color channel level, representing 256 gradients from None to full saturation (from 0 to 255) for that color.
Note: When producing TIFF g3 or g4 compressed output, you must include a colormodel argument (colormodel=gray) and a bpc argument (bpc=1).
In color images, each pixel is made up of three color channels, in the form of RGB (Red/Green/Blue), or four color channels, as CMYK (Cyan/Magenta/Yellow/Black). Bit depth for each of these is always 8, and indicates that there may be 256 shades of each color.
colormodel
-colormodel=[cmyk | gray | lab | rgb | rgba]
-colormodel=gray
(Default: rgb)
The colormodel will be cmyk, gray, lab, rgb, or rgba. The valid colormodel choices are determined by the output format selected.
Output Format | Color Models Available |
BMP | gray or rgb |
GIF | gray or rgb |
JPG | cmyk, gray, or rgb |
PNG | gray, rgb, or rgba |
TIFF | cmyk, gray, lab, rgb, or rgba |
For lab (valid in TIFF output only), 24-bit CIELAB images will be drawn, using 8 bits per channel. Values in that device-independent color model are relative to the D50 white point. PDF2IMG will return an error message if the requested colormodel is invalid for the selected format.
Note: When producing TIFF g3 or g4 compressed output, you must include a colormodel argument (colormodel=gray) and a bpc argument (bpc=1).
Note: Adobe Photoshop reads and writes CMYK JPEG files in a slightly non-standard format. As a result, if you use PDF2IMG to generate a JPEG in CMYK, the image may appear somewhat discolored when viewed in Photoshop.
colorprofile
-colorprofile =[filename or description]
-colorprofile=AdobeRGB1998.icc
(Default determined by colorspace)
Color profiles are standards for managing colors, used to guarantee that the colors for text or graphics in a file remain the same regardless of the hardware or software used to display, edit, or print that file. A color profile is usually included in the software or driver for an installed printer, scanner or other hardware device, or in software used to edit a file that is to be displayed or printed. The hardware device or software product uses the color profile to interpret the colors provided in a file, so that those colors can be presented accurately across more than one platform.
PDF2IMG selects default color profiles for both the input PDF and the target image rendering. The default input profiles (working spaces) apply to PDF elements that are not explicitly calibrated, such as DeviceCMYK, DeviceGray, DeviceRGB. The default output profile is chosen based on the target colormodel specified. The default ICC color profiles are provided in this table:
Colorspace | ICC Color Profile (Input) | ICC Color Profile (Output) |
CMYK | Adobe Reader 9 CMYK | Adobe Reader 9 CMYK |
Gray | Gray Gamma 2.2 | Grau Gamma 2.2 |
L*a*b | CIE 1976 (l*a*b*) color specification with a D50 white point | |
RGB/RGBA | sRGB | sRGB |
Use the colorprofile option to select the output profile, and profileCMYK/profileRGB/profileGray to select the input profile. The profile’s filename refers to the name of the ICC Color Profile file, usually ending with an “.icc” suffix, as in "AdobeRGB1998.icc." If the program is calling an ICC file from another directory, provide the path name for the file as well.
For the colorprofile option, you will probably want to enter the ICC filename, but you can also enter the profile description, corresponding to the description field of the selected ICC profile, as in "Adobe RGB (1998).”
Learn more about color management.
compression
-compression=[no | jpg | lzw | g3 | g4 ]
-compression=no
-compression=jpg
-compression=lzw
-compression=g3
-compression=g4
(TIFF Only)
(Default: lzw)
Note: When producing TIFF g3 or g4 compressed output, you must include a colormodel argument (colormodel=gray) and a bpc argument (bpc=1).
Use this option to specify output compression of TIFF images as needed. Valid values depend on the type of TIFF images being processed.
For color images you can select "no" (no compression), jpg, or lzw, to turn compression on or off.
For black and white images (1 channel, 1 bit), you can also specify g3 or g4 compression.
digits
-digits=[0 to 9]
The -digits command line argument allows you to specify the number of digits to be used for the sequential output filename numbering suffix. For example, if you enter:
-digits=3
as part of a command, the export files generated from your input PDF document will be named FILE001.JPG, FILE002.JPG, and so on.
Normally, leading zeroes are only added as required in order to maintain the sorting order of the files. That is, a PDF input file with 200 pages will be processed to create a series of JPG or PNG output files with names like FILE_001.JPG and FILE_002. But you can use the digits argument to force a specific number of digits regardless of the input page count. So if you enter -digits=4 the system will generate graphics output files with file names like FILE0001 and FILE0002, even if the PDF input file only has 12 pages, making the extra leading zeroes, strictly speaking, unnecessary.
Note: If you use the digits command line argument the system will not include the underscore character ("_") in the output file names, even though this would normally come before the sequence number otherwise (as in "FILE_001.JPG").
If you set the -digits value equal to zero (-digits=0) the system will return to normal sequential numbering and file naming logic.
If you enter a -digits value equal to one (-digits=1) the system will not add any leading zeroes to the output file names, and it will also suppress the use of the underscore character (FILE1.JPG, FILE2.JPG).
Note: You must specify a -digits value at least as high as what the input file would require by default. For example, a 200-page input file requires a digits value of 3 or higher (-digits=3). No error will occur, but later file names in the output sequence may be one or more digits longer than earlier file names as a result, leading to problems listing the files in order. For example, you might see FILE98, FILE99, and FILE100 instead of FILE098, FILE099, and FILE100.
firstonly
-firstonly
The firstonly command directs PDF2IMG to convert only the first page of the input PDF file rather than every page found. This option does not accept a value.
fontlist
-fontlist="directory1;directory2;directoryN"
-fontlist="C:\Test\Client\Fonts"
-fontlist="C:\Alternate\Fonts\Test;C:\Application\Resources"
(Adobe Systems standard search locations)
The -fontlist argument passes to the PDF2IMG system an alternate list of directories where the system can find font files. PDF2IMG will use the first instance of each font that it finds. The following rules apply:
- The values included in the -fontlist argument--that is, the names of font directories--must be separated by semicolons.
- Wildcard characters such as tildes (~) or asterisks (*) are not allowed.
- The list of values must be enclosed in double quotes.
- You can list up to 16 locations with the -fontlist argument.
You generally do not need the -fontlist option unless you are using font files not actually installed on your machine. For example, this might be font files that are stored on your machine but not installed, or recognized as fonts by the operating system. Also, you might want to use the -fontlist option if you have also specified the -ignoredefaultfonts flag with a PDF document that may not have embedded all its necessary font resources.
In addition, the -fontlist option will replace the default search for fonts. For example, if the -fontlist option is not given, PDF2IMG on a Windows machine will look for font files in the folders provided with the PDF2IMG software installation:
C:\Program Files\Datalogics\PDF2IMG Pro\Resources\Font
C:\Program Files\Datalogics\PDF2IMG Pro\Resources\Cmap
Regardless of whether the -fontlist option is given, both Windows and UNIX versions always search the following locations, relative to the present installation directory, unless the -ignoredefaultfonts flag was also specified:
- Resources
- Resources/Cmap
- Resources/Font
Note: A list of directories given here replaces the default Adobe search locations; it does not append to them. Platform default resource locations such as C:\Windows\Fonts or similar on Windows platforms, or X-Windows and OpenWindows font locations on Solaris platforms are always searched. The -fontlist argument only overrides the Adobe location search.
help
-help
Use the -help option to display a list of basic information about proper syntax and accepted values for all of the PDF2IMG command line arguments. This option does not accept a value.
For this option no other statement is needed, just type "pdf2img -help."
ignoredefaultfonts
-ignoredefaultfonts
Normally, when PDF2IMG starts it searches for local font resources, looking in the default system font directories and the current working directory. Use the -ignoredefaultfonts option to suppress this search. Instead, the system will only use the resources specified in the supplied -fontlist option statement. This option does not accept a value.
ignorewarn
-ignorewarn
The -ignorewarn command suppresses the warning normally returned whenever non-renderable content is encountered in the input file. This option does not accept a value.
intent
-intent=[perceptual | relative | saturation | absolute | profile]
(Default: profile if a profile is supplied; otherwise perceptual)
-intent=relative
Use the -intent option to specify the color translation method for colors that are outside the gamut of the color profile. The intent feature is useful if you are converting a PDF page to a graphic file. If the resulting file includes a color or colors that cannot be represented directly on a specific hardware device, the intent lets the PDF2IMG software determine how to substitute a color that can be written to the file.
With the intent option, when you use PDF2IMG to convert a PDF document to a graphic file or files, you can select from a list of standard strategies to apply when converting the colors in that original PDF document. Thus, when you print or display a graphic output file, the colors in the output file will match as closely as possible the original color found in the source PDF document.
You can provide both colorprofile and intent options with your request, or either one. You do not need to define a colorprofile with your intent option. See the description of “Rendering Intents” in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.6.5.8, page 154.This document is found on the web store of the International Standards Organization.
Values you can enter for intent include:
Value | Description |
perceptual | Generally used for photography. This method does not map colors one for one but estimates to match colors. Hence it often provides the most pleasing result but not necessarily the most accurate. If you do not specify a color profile in the colorprofile option the intent value defaults to perceptual. |
relative | Generally used for photography. The relative method uses an algorithm to select the closest possible color map to be true to the specified color. |
saturation | Commonly used in charts and diagrams with a limited palette of colors where hue is not as important. |
absolute | Often used to select a specific color or set of colors for drawings or designs. For PDF2IMG absolute will serve to reproduce the exact colors provided in the original PDF document. A common reason for using absolute would be to reproduce the color used in a corporate logo such as IBM Blue. The color is changed by selecting a defined match. This method does not use a conversion algorithm to select the closest color available. |
profile | If you specify a color profile in the colorprofile option the intent value defaults to profile. In that case PDF2IMG will use the rendering intent provided with the ICC color profile currently in use.
For example the Adobe RGB 1998 color profile uses Relative Colormetric as its rendering intent. So if PDF2IMG specifies Adobe RGB 1998 as the color profile (and an alternate intent option is not specified) the PDF2IMG software will use relative. |
jpegquality
-jpegquality=[1 to 100]
-jpegquality=50
(Default: 75)
The jpegquality option is a value from 1 to 100, representing the quality/size value for the JPEG compressor. A higher value will produce a better quality image, though also a larger output file. Lower values will produce lower-quality images but smaller and more efficient output graphic files.
Note: Lowering the JPG Quality value will not only lower the detail of the image, but also lower the precision of the colors as compared with the original input. For example, rendering a JPEG image at 50% quality rather than some value significantly higher may yield a result that not only shows less detail but also contains slightly different shades of color.
maxbandmem
-maxbandmem=[100000000 to 2100000000]
(JPG or TIFF only; Default: 300000000)
When generating JPG or TIFF output, PDF2IMG checks to see if it has enough memory to rasterize a PDF page in one pass. If not, it rasterizes the page in bands (strips) in order to use less memory, then reassembles the bitmaps into the finished output image. This banding approach (if needed) will have no effect on the final output appearance, and will be transparent to the user; the memory allocation or banding is handled internally.
You will typically not need this call. The -maxbandmem option allows you to fine tune the process to convert PDF document pages to JPG or TIF files, if you find that your application’s performance is enhanced by making the size of the rendering bands either larger or smaller within the technical limits of your machine.
multipage
-multipage
(TIFF only; No default)
Normally, processing a multipage PDF input file will result in a series of sequentially-ordered, single-page output files, each carrying the given or default output file name prefix, an underscore ("_") and a sequential number. If performing a conversion to TIFF, -multipage directs PDF2IMG to produce one, multipage TIFF output file instead.
noannot
-noannot
Specify -noannot in a command line to prevent displayable annotations from appearing in output.
Note: Use -noannot with care. Many page objects can be various forms of annotation, some more obvious than others, so you should check your output carefully to ensure that you are suppressing only those annotations that you want to block.
Note: This command will override the -asprinted option.
nocmm
-nocmm
The -nocmm option suppresses the use of the Color Management Module (CMM) and embedded color profiles during conversion to selected output graphic image formats.
For PDF2IMG , color management is normally in effect, so the product assumes an output profile of Adobe Acrobat CMYK, sRGB, or Gamma 2.2 (as appropriate for the output format), and will assume that Device colors on input are calibrated as Adobe Acrobat CMYK, Adobe 1998 RGB, or Gamma 2.2 respectively. When generating TIF, JPG, PNG or BMP output, PDF2IMG will embed the corresponding profile in the output image.
Learn more about color management.
When -nocmm is s specified, PDF2IMG will draw the output to a device color, embed no profile in the image written, and presume no default color model for input device colors.
noenhancethinlines
-noenhancethinlines
PDF2IMG uses the "Enhance thin lines" rendering option by default. This process is also found in Adobe Reader and Adobe Acrobat. If this is not the effect you want, use the -noenhancethinlines option to turn it off.
OPP
-OPP
(Default: false)
The OverPrint Preview (OPP) option allows you to generate a graphic that represents the Overprint content that would otherwise be lost during the rendering process. The graphic will show what the input PDF page would look like after being printed, accounting for ink overprinting. See the pdf2img_set_OPP reference.
output
-output=[filename]
-output=alternate_name
-output="C:Converted_Filesalternate_name"
(Default: Input PDF file name plus sequence number)
Use -output to define the prefix to add to the name of the output file or files you seek to create. The value given here will be used for the output file name, with a sequence number and an appropriate extension appended to indicate the output file type, such as sample_1.gif and sample_1.jpg. For a PDF input document with more than one page, the system will create sequential, separate output files for each page of the input file, with a sequence number appended to each, such as sample_1.gif, sample_2.gif, sample_3.gif, and so on.
You can also use the output option to redirect output files to the local or server directory that you select. This is described below.
Note: The Underscore character ("_") that normally precedes the sequence number is not inserted if the -digits command line argument is used.
If you do not include the -output option in a command, PDF2IMG will assign the name of the input PDF file name to each output graphic file, and add a sequence number. For example, if you are starting with a five page PDF document called Test.PDF, and are exporting the pages to JPG files, the five output files will be named Test_1.JPG, Test_2.JPG, and so on.
Redirecting Output to Another Location
You can use the -output option to save your output file or files to another location, but the following notes apply:
- If you copy an output file to a folder, and the folder already has an existing output file with the same name as the new file, the new file will overwrite the existing file in that directory.
- If you want to store your output files in a folder that you choose, you must create that folder first.
- You need to provide the name of your output file along with the path name of the folder where you want to save that file. When you redirect output files to your own directory, PDF2IMG will not use the name of the input file by default.
outputIntent
-outputintent [description]
-outputintent=GTS_PDFX
This option defines the output color profile for PDF2IMG to use when rendering a page from a PDF document to a rasterized graphic image. The argument tells the software to find the profile to use in the output intent stored in the PDF document itself.
An output intent is set of dictionaries stored in the PDF document’s OutputIntents array. More than one output intent may be imbedded in an output intent array within a PDF document, each with its own color profile and characteristics. This allows the PDF document to adapt to a variety of workflows or production environments. Each output intent features several dictionary key values, including OutputCondition and an OutputConditionIdentifier. Both of these values are text strings that describe the intended output device for this PDF document or the production environment.
The output intent dictionary also offers a SubType (S) dictionary key, an optional value that further describes the PDF document format. Three output intent subtypes are defined:
- GTS_PDFX for PDFX, or Graphics Exchange documents
- GTS_PDFA for PDF Archive documents
- ISO_PDFE for PDF Engineering documents
See the description of “Output Intents” in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.11.5, page 633. This document is found on the web store of the International Standards Organization.
When you create the outputintent argument in your PDF2IMG command statement, the Description variable will be a description of a color profile embedded in an OutputCondition, OutputConditionIdentifier, or Subtype dictionary.
pdf2img -outputintent=JC200103 TestFile.pdf tif
PDF2IMG looks at the OutputConditionIdentifier entries in the output intent array for the color profile JC200103. Then, PDF2IMG applies that profile when converting a PDF document called TestFIle.PDF to a TIF file.
This command:
pdf2img -outputintent=GTS_PDFA sample_jc.pdf tif
Tells PDF2IMG to use the color profile used with the PDFA subtype and create a TIF file from TestFile.PDF. The conversion will be governed by the requirements defined for the PDF Archive format.
If you don’t specify an input color profile or an output color profile, PDF2IMG will assign a default color profile for each. You can use profileCMYK, profileRGB, or profileGray to assign an input color profile when you convert a PDF document to graphic images. To select a specific color output profile to use when converting a PDF document page to a graphics file, you can use the colorprofile argument. Or you can use the outputintent argument to find and use a color profile embedded in the PDF document itself.
PDF2IMG will use the color profile specified with the outputintent argument for both the output color profile and the input color profile unless you define an input color profile using profileCMYK, profileRGB, and/or profileGray. You can use the color profile values (such as colorprofile or profileCMYK) and an outputintent value in the same argument. If PDF2IMG cannot find the color profile specified in the outputintent argument within the PDF document, it will ignore the outputintent statement and select a different color profile or profiles to use. Either it will use the color profiles offered using the colorprofile argument or profileCMYK/RGB/Gray, or it will select the appropriate default color profile.
pages
-pages=[range]
-pages=3
-pages=2,5
-pages=1-10
-pages=1,3,5-9,21
-pages=15-last
Normally, when PDF2IMG processes a PDF document it converts every page found in that document. Use the -pages option to specify a list of selected input pages to process. You can give single page numbers, separated by commas; the first and last page of a range, separated by a hyphen; or some combination of the two.
Pages are identified by their sequential order within the file, not by their folio. For example, you would specify "2" for the second page of the input file, even if the document identifies it as "Page 57" or "page xiv" on paper. If you are working with a PDF document that has a cover sheet, a page with copyright data, and four pages of a table of contents, the first page of the document, page 7, would actually be page 7 in the file. So in this case you would specify "7" for page one in this document. Page ranges must be given in increasing order; don't enter a command like "-pages=15,19-21,5." Do not include spaces.
If you do not know the exact page count of the input file, use the keyword "last" to indicate a page range that should run to the end.
password
-password=[string]
-password=sesame
Use the -password option to pass the User or Owner password needed to open a password-protected PDF document. The password may be any character string up to 127 characters in length, without spaces.
Note: A document with a User password but no other restrictions can be processed by providing the User password. If the PDF document has any security beyond a User password to restrict viewing, you will need to specify its Owner password instead. Opening with an Owner password will override the document’s security restrictions, and allow PDF2IMG conversion to proceed.
pdf-rasterize
-pdf-rasterize
Use this option to rasterize each page in a PDF input document into graphics images and then save these pages to a single PDF output file.
A rasterized graphic uses pixels, or points of color, to create a bitmapped graphic image, expressed in Dots per Inch. A common example would be a photograph, presented as a JPG file. Standard PDF documents are vector documents, where the text or images are based on a mathematical formula.
If you want to convert the pages in a PDF document to a series of graphic files, such as PNG or TIF, you are said to be “rasterizing” that PDF document.
In effect, with this option PDF2IMG converts the input PDF document into a series of graphic image files, and then saves these rasterized image files into a single PDF output file.
pdf-rasterize-split
-pdf-rasterize-split
Use this option to rasterize each page in a PDF input document into graphics images and then save these pages to a series of PDF output files, one PDF output file for each page in the original document.
A rasterized graphic uses pixels, or points of color, to create a bitmapped graphic image, expressed in Dots per Inch. A common example would be a photograph, presented as a JPG file. Standard PDF documents are vector documents, where the text or images are based on a mathematical formula.
If you want to convert the pages in a PDF document to a series of graphic files, such as PNG or TIF, you are said to be “rasterizing” that PDF document.
In effect, with this option PDF2IMG converts the input PDF document into a series of graphic image files, and then saves each of these image files into a separate PDF output file, one PDF output document for each page in the PDF source document.
pdfregion
-pdfregion=[art | bleed | bounding | crop | media | trim]
-pdfregion=art
-pdfregion=bleed
-pdfregion=bounding
-pdfregion=media
-pdfregion=trim
-pdfregion=0,300,300,0
(Default: crop)
Use the pdfregion option to select a region of the input page or pages in a PDF document to rasterize. Elements not within the indicated area are ignored and do not appear in output. The values for pdfregion correspond to page boundary definitions as given in section 14.11.2, "Page Boundaries," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 627. This document is found on the web store of the International Standards Organization.
This is summarized below:
Region | Coverage Area |
art | Defines the logical extent of the content of the graphic as intended by the page creator. This is the smallest of margins. With art only the graphic itself is exported. No space is included around the image. |
bleed | Defines the region where the contents of the page will be clipped. It may include an extra area surrounding the graphic to allow for the physical limitations of printing equipment. This value is the second widest margin around the graphics image after media. |
bounding | Usually the smallest possible rectangle that can hold all of the content on the page (all the area within the declared bounding dimensions). It is possible for Bounding to include objects that fall outside the borders of the PDF page such as a particularly wide Bezier curve. |
crop | (Default) Defines the region for clipping or cropping the graphic for display or print. Unlike the other settings for region crop has no default defined size or geometry. With the crop value it is possible to provide additional information to manually define the margins of the image that are selected and exported. If these values are not provided the crop value will match the media value. |
media | Defines the boundaries of the actual page where the graphics image will be printed. In this case the media setting may include an extended area around the graphic on the printed page. This area can be used for printing marks on a proof copy for example. The media value provides the widest possible margins around the graphics image. |
trim | Defines the intended dimensions of the finished graphic after trimming to fit the page. This will be smaller than the media and bleed settings but wider than the art setting. |
It is also possible to create a box with a custom set of four coordinates, [left],[top],[right],[bottom] in PDF units. The same syntax applies for PDF2IMG and PDF2IMG .NET. In this example, the size and placement of the box is defined as zero units from the left side of the page, 300 units down from the top, 300 units in from the right, and zero units up from the bottom:
-pdfregion=0,300,300,0
A PDF unit here is a form of measurement used with PDF documents to define the placement of text of graphic on a page. There are 72 PDF units per inch.
pdf-split
-pdf-split
This option simply takes a PDF input document and splits it into a series of separate PDF documents, one PDF document for each page in the source file. The output is not converted into graphics images.
pixelcount
-pixelcount=[width x height]
-pixelcount=w:[width]
-pixelcount=h:[height]
-pixelcount=2550x3300
-pixelcount=660X300
-pixelcount=w:200
-pixelcount=h:300
Use the -pixelcount option to specify the exact dimensions of your output width and/or height in pixels. Both width and height values are optional, though if you provide both, you must give the width first, height second, separated by the "x" character. Do not include spaces.
This allows you to scale the image up or down as desired to a specific output size and dimension, and either maintain the original proportions or override them as you like: you can resize the original input without alteration, or distort it horizontally or vertically as you prefer.
If you do not want to alter the proportions or aspect ratio of the page or pages in your original input document, you should give only one -pixelcount dimension for output, either width or height, whichever one is more critical for correct output positioning or sizing. The other dimension will be scaled as necessary to maintain the original aspect ratio of the input PDF file.
Remember that the -resolution argument also affects output size by setting the Dots per Inch value, so be sure that your -pixelcount and -resolution arguments together will produce the output size that you want.
Note: The limit for JPEG output image size is 65535 x 65535 pixels. TIF output has been tested up to a band of 68898 x 34449 pixels in size.
Using pixelcount for RAW Output
When converting to RAW output, the process will create an output byte stream to generate the page image according to its original input height and width (the PDF page dimensions), and at the current resolution value (its default value, unless directed otherwise). However, the image will not contain any embedded information on its correct dimensions in pixels. Thus you should specify the desired pixelcount dimensions yourself, in order to ensure that the output image size is what you expect.
profileCMYK/profileRGB/profileGray
-profileCMYK [file name or description of CMYK input color profile]
-profileRGB [file name or description of RGB input color]
-profileGray [file name or description of grayscale input color profile]
-profileRGB=AdobeRGB1998.icc
PDF2IMG offers three command line arguments to select an input color profile, one each for CMYK, RGB, or grayscale. These input color profile arguments are similar to colorprofile. For example, you would use the profileCMYK argument to select an input profile for CMYK and the colorprofile or the outputintent argument to select an output color profile. It is common practice to define both the input and output profiles when rasterizing a PDF document to a graphic file.
The output color profile is used for rasterizing the PDF document to a bitmap graphics file, or series of graphics files. The output profile can be added directly to the output file. For example, if you are converting a PDF document to a series of PNG files, one PNG file per page, you can define an output color profile and then add that output profile to the metadata for each of those PNG output files. This applies to PNG and TIFF files; you can’t add color profile metadata to a BMP file.
When you select the input color profile, you are assigning that profile to objects and elements within the PDF document that do not already have native color profiles assigned to them. PDF2IMG copies your input color profile to a buffer, and the API calls it from there.
The elements and objects in a PDF document can be specified in a device-specific color space like DeviceCMYK, or they can be expressly assigned to an ICC color profile. If a color profile is already assigned to an element in a PDF document, that element is said to be calibrated to that color profile. PDF2IMG only applies a default color profile to an element in a PDF that is not already calibrated. For example, suppose a person creates a PDF document and embeds a photograph on one of the pages in that document. If that person selects an explicit ICC color profile to assign to that photograph, PDF2IMG will not change it. If the person who creates the PDF does not assign a profile to the image, however (the image is not already calibrated), PDF2IMG will assign a default input color profile to that image.
You can use profileCMYK, profileRGB, or profileGray, to assign your own input color profile to a document, and thus override the default color profile provided by PDF2IMG. But these three input color arguments will also not change the color profile assigned to an element or object that is already calibrated. If you don’t use one of these three arguments to select a color profile, PDF2IMG will select a default instead.
Color Space | Default ICC input color profile provided by PDF2IMG |
CMYK | Adobe Reader 9 CMYK |
Gray | Gray Gamma 2.2 |
RGB | sRGB |
The filename for the input profile argument refers to the ICC color profile file, usually ending with an “.icc” suffix, as in “HPO63000.icc.” If the program is calling an ICC profile from another directory, provide the path name for the file as well. PDF2IMG will read the file you provide into a buffer and try to use it when rasterizing the PDF document. You can also enter the profile description, corresponding to the description field of the ICC profile you want to use, as in:
"HP OJ 6300-Premium Paper(tri-color+black)"
If you like you can use two or three of these color profile arguments in a single PDF2IMG command statement to assign separate profiles to individual objects or elements within a PDF document. You could also include a colorprofile or outputintent argument in the same statement to define the output profile to assign to the graphic file.
Suppose you have a PDF document with a single page that features grayscale text, a vector line drawing with a RGB color space, and a photograph (JPG image) using CMYK. PDF2IMG will convert this PDF page to a single export graphic file, such as a TIF or PNG file. But you could write a PDF2IMG command statement that will assign a separate input color profile to each of these graphics, and you could also add a colorprofile or outputintent argument to define the output color profile. The command might look something like this:
pdf2img –profileCMYK=Probev1_ICCv4.icc –profileRGB=USWebCoatedSWOP.icc –colorprofile=AdobeRGB1998.icc TestFile.PDF PNG
In this example, PDF2IMG would convert the PDF document called TestFile.PDF to a single PNG file.
It will assign the color profile Probev1_IDCCv4.icc to the CMYK graphic (the JPG photograph) in TestDocument.PDF, and the color profile USWebCoatedSWOP.icc to the RGB vector line drawing. For the text, PDF2IMG will use its own default Grayscale profile, because the –profileGray argument is not used in the statement. And it will assign AdobeRGB1998.icc to the PNG output file.
relaxParseSyntax
-relaxParseSyntax
This option can be used to correct a problem where PDF2IMG is not processing a PDF document properly. This call is used to correct minor PDF syntax errors by relaxing a parsing restriction, allowing the software to continue to process the PDF document. The option sets the PDPrefSetAllowRelexedSyntax flag to True; by default, this flag is turned off.
removewhitespace
-removewhitespace
This command directs PDF2IMG to remove the white space margins around the content on a page in the PDF document. Most documents feature black text and color images on a white background. This option is similar to the Crop feature in Adobe Acrobat, in that you can use it to remove the white space surrounding an image or block of text on a page. With the removewhitespace option, however, PDF2IMG determines how much white space to remove for you.
This option does not accept a value.
resampler
-resampler=[auto | bicubic | none]
-resampler=bicubic
-resampler=none
(Default: auto)
If images are converted without resampling, it can in some cases cause unwanted artifacts or loss of detail in small-sized or low-resolution output images, such as thumbnails. Automatic resampling was introduced to PDF2IMG to enhance the quality of images when they are converted. ,
If you use the default value of automatic resampling, if any of the following conditions are true, the images will first be rasterized to 150 DPI. After that a bicubic downsampling to the desired target values will be applied:
- -pixelcount:h is less than one half of the default input height
- -pixelcount:w is less than one half of the default input width
- -resolution is less than 150
Specifying bicubic will apply the resampler unconditionally. That is, every image will be resampled regardless of the pixel count and resolution. Specifying none will turn it off completely, so that the images will not be resampled at all.
resolution
-resolution=[12 to 2400]
-resolution=600
(Default: 300)
-resolution=[horizontal 12 to 2400 x vertical 12 to 2400]
-resolution=1200x600
(Default: 300x300)
Use the -resolution option to set the Dots per Inch value for the output file or files, from 12 to 2400. You can enter one or two values. If you only provide one value, it will be applied to both horizontal and vertical, as in 600 x 600. If you provide two values, the first will be applied horizontally and the second will be applied vertically. Do not include spaces between the numbers in the command line statement.
For best results, provide a value that serves as a multiple of the DPI resolution of the intended output device. Try to match the resolution of your image file to the device that will display it.
Note: If the specified value is less than 150 and resampling has not been disabled, images will be resampled for improved appearance during conversion. See Resampler for more details. Also see PixelCount for another way to control the specific output size of your image.
reverse
-reverse
(Grayscale only; No default)
If you are converting to grayscale output files, use the -reverse option to direct PDF2IMG to reverse the grayscale values to produce a "negative" image:
Note: This option is intended for generating reverse or negative images only. If you are trying to correct a problem of unwanted display reversals seen in documents produced by some third-party PDF products, use the -blackisone option instead.
smoothing
-smoothing=[none | text | line | image | all]
-smoothing=none
-smoothing=image
-smoothing=line,text
-smoothing=all
(Default: no smoothing)
User-controlled anti-aliasing, or "smoothing," can be controlled individually for text, line art, images, or any combination as you like. Multiple selections should be separated by commas for PDF2IMG.
The smoothing option for PDF2IMG accepts "none," "text," "line," "image" or "all" values. You can combine "text," "line" or "image" with commas.
For PDF2IMG COM, a bit mask of the enum values "SMOOTH_NONE," "SMOOTH_TEXT," "SMOOTH_ART" or "SMOOTH_IMAGE" should be used. The "line" option in PDF2IMG corresponds to the "Smooth_Art" option in PDF2IMG COM.
Text Smoothing (1000% Enlargement)
No Smoothing (1000% Enlargement)
Smoothing is most helpful when creating low-resolution outputs. But we don't recommend it if you want to create image files that you plan to print. It is also not recommended for black-and-white (1bpp) output files, in order to preserve sharpness at high magnifications.