Foxit PDF Toolkit User Manual

Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Table of Contents
1 Introduction to Foxit PDF Toolkit ..................................................................................... 1
1.1 Why Foxit PDF Toolkit is your choice ............................................................................................ 2
1.2 Foxit PDF Toolkit Features ............................................................................................................ 3
1.3 Common Use Case Scenarios ........................................................................................................ 8
1.4 System Requirements ................................................................................................................. 10
1.5 About This Manual ...................................................................................................................... 10
2 Installing and Uninstalling Foxit PDF Toolkit .................................................................. 12
2.1 Installation .................................................................................................................................. 12
2.2 Evaluation ................................................................................................................................... 13
2.3 About License .............................................................................................................................. 14
2.4 Registration ................................................................................................................................. 14
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
2.5 Uninstallation .............................................................................................................................. 16
3 Command Line Usage .................................................................................................... 17
3.1 Image2PDF .................................................................................................................................. 17
3.2 Office2PDF .................................................................................................................................. 31
3.3 PDFWatermark ............................................................................................................................ 42
3.4 PDFHeaderFooter........................................................................................................................ 52
3.5 PDFOptimizer .............................................................................................................................. 64
3.6 PDFRedactor ............................................................................................................................... 80
3.7 PDFMetadata .............................................................................................................................. 99
3.8 PDF2Text ................................................................................................................................... 110
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
3.9 Text2PDF ................................................................................................................................... 123
3.10 Html2PDF .................................................................................................................................. 137
3.11 RMS ........................................................................................................................................... 151
4 Foxit Configuration Tool .............................................................................................. 152
4.1 Watermark Configuration Tool ................................................................................................. 152
4.2 PDFHeaderFooter Configuration Tool ....................................................................................... 155
5 Working with API ........................................................................................................ 159
5.1 Image2PDF ................................................................................................................................ 160
5.2 Office2PDF ................................................................................................................................ 164
5.3 PDFWatermark .......................................................................................................................... 168
5.4 PDFHeaderFooter...................................................................................................................... 171
5.5 PDFOptimizer ............................................................................................................................ 174
5.6 PDFRedactor ............................................................................................................................. 179
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
5.7 PDFMetadata ............................................................................................................................ 184
5.8 PDF2Text ................................................................................................................................... 187
5.9 Text2PDF ................................................................................................................................... 191
5.10 Html2PDF .................................................................................................................................. 195
6 Support....................................................................................................................... 201
6.1 Reporting Problem .................................................................................................................... 201
6.2 Contact Information .................................................................................................................. 201
Foxit PDF Toolkit User Manual
www.foxitsoftware.com

1 Introduction to Foxit PDF Toolkit

Foxit PDF Toolkit consists of a series of command line tools to perform batch PDF generation and
processing. It includes 11 modules: Image2PDF, Office2PDF, PDFWatermark, PDFHeaderFooter,
PDFOptimizer, PDFRedactor, PDFMetadata, PDF2Text, Text2PDF, Html2PDF and RMS. Each module
offers a simple-to-use API for users who want to perform PDF manipulation through API.
In this manual, we will introduce the modules: Image2PDF, Office2PDF, PDFWatermark,
PDFHeaderFooter, PDFOptimizer, PDFRedactor, PDFMetadata, PDF2Text, Text2PDF and Html2PDF. For
the RMS PDF Protection module, the user manual will cover in detail the module’s basic syntax in section
3.11 RMS”. Browse to the “rms” folder in the installation package for a more detailed introduction.
Image2PDF is an easy-to-use command line tool used to batch convert large volumes of image files into high-
quality PDF files, without requiring additional software installation. Image2PDF currently supports the
following image formats: BMP, PNG, JPEG, JPX, GIF, TIFF (or TIF, including the image with a single page or
multiple pages). This module provides many features to customize the output properties of the generated
PDF files.
Office2PDF batch converts large volumes of Microsoft Office documents into professional-quality PDF files.
Microsoft Office must be installed, because the Office2PDF tool saves the converted PDF files using the
Microsoft Office Engine. Office2PDF currently supports the more popular document formats, which includes
doc, docx, xls, xlsx, ppt and pptx. Additionally, the tool can convert and create professional-quality PDF files
that support PDF/A Standard compliances.
PDFWatermark allows users to batch add a watermark into PDF files, without requiring additional software
installation. The PDFWatermark tool applies a pre-made watermark to PDF files, which supports watermarks
in text, image-based or PDF formats. The watermark is saved as a configuration file with the extension “.xml”,
which is generated by the built-in Foxit Configuration Tool (Either fpdfwmconf.exe or fpdfwmconf64.exe, a
GUI application, depending on your operating system).
PDFHeaderFooter batch adds headers and footers into large volumes of PDF files, without requiring
additional software installation. The PDFHeaderFooter tool applies pre-made header/footer to PDF files. The
headers and footers are saved as a configuration file with the extension “.xml”, which is generated by the
built-in Foxit Configuration Tool (Either fpdfhfconf.exe or fpdfhfconf64.exe, a GUI application, depending on
your operating system).
1
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
PDFOptimizer batch reduces the size of PDF files to save disk space and make files easier to send and store,
without requiring additional software installation. This tool optimizes PDF files by downsampling or
compressing images, unembedding fonts, and discarding objects or user data. PDFOptimizer offers some
options to clean up PDF files, such as using Flate to encode streams that are not encoded, converting LZW
encoding to Flate encoding, and removing invalid bookmarks and invalid links.
PDFRedactor batch redacts PDF documents by completely removing sensitive content or private information
from your PDF documents prior to making them available to others, without requiring additional software
installation. With PDFRedactor, users can use redaction marks to redact or remove the sensitive contents
that are visible in a PDF document and can specify custom text to appear over the redaction marks.
PDFMetadata batch sets document metadata information of PDF files, without requiring additional software
installation. With PDFMetadata, users can set the title, author, subject, keywords and creator of PDF files,
and view the metadata information. Setting metadata greatly helps in searching and organizing PDF files.
PDF2text batch converts large volumes of PDF files into plain text files, without requiring additional software
installation. With PDF2Text, users can extract text content from a textual PDF file and save the text as a plain
text file, which is useful for text indexing or content retrieval.
Text2PDF batch converts large volumes of plain text files into high-quality PDF files with rich text formatting,
without requiring additional software installation. This tool converts plain text to PDF files including settings
of the page size, page margin, font style, font size, font color, password, and metadata.
Html2PDF converts a batch of local html files or a webpage (URL) into professional-quality PDF file(s), without
requiring additional software installation. With Html2PDF tool, users can convert both the online webpage
and local html files like invoices or reports into PDF file(s) with an industrial-strength html rendering engine.

1.1 Why Foxit PDF Toolkit is your choice

Foxit is an Amazon-invested leading software provider of solutions for reading, editing, creating, organizing,
and securing PDF documents. Foxit PDF Toolkit is a suite of modules to perform high volume PDF generation
and processing. These modules help IT organizations develop workflows to process large amounts of PDF files.
They also provide libraries for software development groups to incorporate PDF processing into their
applications. Customers choose this product for the following reasons:
High performance – Multi-threading support speeds up the PDF processing based on today's server
architectures.
Professional quality – Professional-quality on PDF manipulation and PDF conversion.
2
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Lightweight footprint – Lower memory usage and faster installation. Perfect message mechanism – Gives more perfect message hints if users encounter problems when
using the tools to offer better user experience.
Robust and stable – Ensures smooth running of the application and enhancement of fault tolerant. Easy to integrate – Command line or application interfaces enable flexible and seamless integration
with user's existing workflows.
Plug and Play – Choose one or more of the specific modules that meet your needs.
Foxit offers 24/7 support for its products and are fully supported by the PDF industry’s largest development
team of support engineers. Updates are released on a regular basis to improve user experience by adding
new features and enhancements. Foxit PDF Toolkit is the best solution for PDF batch processing and
integration of high performance features at a low cost!

1.2 Foxit PDF Toolkit Features

1.2.1 Image2PDF Features

Batch convert image files into PDF files. Finish faster with multi-threaded processing. Make the complex simple with sub-folder recursion processing. Support single-file processing, single-folder processing and multi-file processing. Support various image formats like BMP, PNG, JPEG, JPX, GIF and TIFF (TIF). Convert multiple image files into one PDF file, or individual PDF files. Specify any resolution (DPI) for the PDF file to be converted. Set page width and height for the PDF file to be converted. Set margins for each PDF page. Support password encryption to secure PDF files. Add bookmarks to the PDF file to be converted. Set document metadata information, including title, subject, keywords, author, and creator. Support wildcard characters in batch conversion, e.g., *.jpg, *.png. Offer simple-to-use API.

1.2.2 Office2PDF Features

Batch convert Microsoft Office files into PDF files. Finish faster with multi-threaded processing. Make the complex simple with sub-folder recursion processing. Support single-file processing and single-folder processing.
3
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Support password-protected Microsoft Office files. Support the popular Office document formats, including doc, docx, xls, xlsx, ppt and pptx. Add bookmarks to PDF files converted only from Microsoft Word documents. Provide scale options for Microsoft Excel conversion. Convert every sheet of a Microsoft Excel document into a single PDF file. Retain hyperlinks in PDF files from Microsoft Office files. Support converting to PDF/A compliant PDF files Support wildcard character in batch conversion, e.g., *.docx, *.pptx. Offer simple-to-use API.

1.2.3 PDFWatermark Features

Batch add a watermark into PDF files. Finish faster with multi-threaded processing. Make the complex simple with sub-folder recursion processing. Support single PDF file processing and single-folder processing. Support password-protected PDF files. Support text, image, and PDF as the source of watermarks. Support stylized text watermarks that include text font, font size, font color, bold, and underline
settings.
Support image watermarks in various formats (BMP, DIB, JPG, JPEG, JPE, GIF, TIF, PNG, and TIFF). Support one page and multi-page PDF watermarks. Set and preview the watermark via the built-in GUI configuration tool. Rotate watermark in 360 degree rotations. Set opacity for watermarks. Scale watermark relative to target page size. Control the visibility of watermarks when printing. Control the on-screen visibility of watermarks. Keep watermark position and size for different page sizes. Determine watermark position within the document. Position watermark in front of or behind the document content. Specify a page range to add watermark. Export watermarks to XML files. Add watermark to PDF with XML configuration file. Set document metadata information, including title, subject, keywords, author, and creator. Support wildcard character in batch processing, e.g., *.pdf. Offer simple-to-use API.
4
Foxit PDF Toolkit User Manual
www.foxitsoftware.com

1.2.4 PDFHeaderFooter Features

Batch add headers and footers into PDF files. Finish faster with multi-threaded processing. Make the complex simple with sub-folder recursion processing. Support single PDF file processing and single-folder processing. Support password-protected PDF files. Set and preview the headers and footers via the built-in GUI configuration tool. Support stylized text for the headers and footers, including text font, font size, font color, underline
and embedded font settings.
Support margins settings. Determine header and footer position. Support dynamic content, such as date and page number, as a header or footer. Support page number and date format settings. Shrink a document to avoid overwriting the document’s text and graphics. Keep position and size of headers and footers constant on different page sizes. Specify a page range to add headers and footers. Export headers and footers to XML files. Add headers and footers to PDF with XML configuration file. Set document metadata information, including title, subject, keywords, author, and creator. Support wildcard characters in batch processing, e.g., *.pdf. Offer simple-to-use API.

1.2.5 PDFOptimizer Features

Batch optimize PDF files. Finish faster with multi-threaded processing. Make the complex simple with sub-folder recursion processing. Support single PDF file processing and single-folder processing. Support password-protected PDF files. Support downsampling and compression for color/grayscale and monochrome images. Unembed fonts in PDF files. Discard objects and user data of PDF files:
Discard all form submission, import and reset actions. Flatten form fields. Discard all JavaScript actions. Discard embedded page thumbnails. Discard embedded print settings.
5
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Discard bookmarks. Discard all comments, forms and multimedia. Discard external cross references. Discard document information and metadata. Discard file attachments. Discard private data of other applications.
Clear up PDF files:
Discard all form submission, import and reset actions. Use Flate to encode streams that are not encoded. In streams that use LZW encoding, use Flate instead. Remove invalid bookmarks.
Remove invalid links. Set document metadata information, including title, subject, keywords, author, and creator. Support wildcard characters in batch processing, e.g., *.pdf. Offer simple-to-use API.

1.2.6 PDFRedactor Features

Batch redact or remove sensitive content from PDF files. Finish faster with multi-threaded processing. Make the complex simple with sub-folder recursion processing. Support single PDF file processing and single-folder processing. Support password-protected PDF files. Option to set the search keyword mode for specific words/phrases or patterns. Specify the characters of keyword you want to redact. Set a page range to apply redaction. Set a fill color to mark redactions. Overlay redaction marks with specified text. Set the alignment of the overlay text. Set the font style of the overlay text. Set the font size of the overlay text. Set the font color of the overlay text. Set document metadata information, including title, subject, keywords, author, and creator. Support wildcard characters in batch processing, e.g., *.pdf. Offer simple-to-use API.

1.2.7 PDFMetadata Features

Batch set document metadata information.
6
www.foxitsoftware.com
Finish faster with multi-threaded processing. Make the complex simple with sub-folder recursion processing. Support single PDF file processing and single-folder processing. Support password-protected PDF files. Set the title of PDF files. Set the subject of PDF files. Set the keywords of PDF files. Set the author of PDF files. Set the creator of PDF files. View PDF metadata information. Support wildcard characters in batch processing, e.g., *.pdf. Offer simple-to-use API.

1.2.8 PDF2text Features

Batch convert PDF files into plain text files. Finish faster with multi-threaded processing. Make the complex simple with sub-folder recursion processing. Support single PDF file processing and single-folder processing. Support password-protected PDF files. Specify a page range you want to extract text from. Get the total number of characters on each page. Print the characters number of each page to the screen. Option to retain PDF page layout. Option to retain the page break of PDFs. Option to convert each PDF page into individual text files. Convert to UTF-8 and UTF-16 encoded files. Support wildcard characters in batch processing, e.g., *.pdf. Offer simple-to-use API.
Foxit PDF Toolkit User Manual

1.2.9 Text2PDF Features

Batch convert text files into PDF files. Finish faster with multi-threaded processing. Make the complex simple with sub-folder recursion processing. Support single-file processing and single-folder processing. Support most commonly used languages. Set page width and height for the PDF file to be converted. Set margins for each PDF page.
7
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Support font style, font size and font color settings. Set open password for the PDF file to be converted. Support password encryption to secure PDF files. Set document metadata information, including title, subject, keywords, author, and creator. Support wildcard characters in batch processing, e.g., *.txt. Offer simple-to-use API.

1.2.10 Html2PDF Features

Batch convert local html files into PDF files. Convert a webpage (URL) into a PDF file. Finish faster with multi-threaded processing. Make the complex simple with sub-folder recursion processing. Support single PDF file processing and single-folder processing. Set page width and height for the PDF file to be converted. Set margins for each PDF page. Sets cache address to store html page resources temporarily. Set timeout to load webpages. Set all the page contents to one single PDF page. Optionally disable retaining hyperlinks in the generated PDF files. Rotate pages to 0, 90, 180, or 270 degrees. Preserve original page layout. Support wildcard characters in batch conversion, e.g., *.html, *.htm. Offer simple-to-use API.

1.3 Common Use Case Scenarios

1.3.1 Image2PDF Use Case Scenarios

Batch convert images into PDF files for better image management. Create electronic books for users to scan paper documents to image files, and then convert them
into a single PDF file.
Make image albums for users to collect their photos and then convert them into a single PDF file.

1.3.2 Office2PDF Use Case Scenarios

Batch convert Microsoft Office files into PDF files. Set the converted PDF files to be compliant with PDF/A standard for better archiving.
8
Foxit PDF Toolkit User Manual
www.foxitsoftware.com

1.3.3 PDFWatermark Use Case Scenarios

Batch add a watermark into PDF files to protect users and their copyrights. Users can use company
logos, author signatures, products, PDF files or web addresses as watermarks to protect their PDF
files.
Label PDF file status for better management. Users can easily label status of their PDF files, such as
approved, draft, final or confidential. For example, label “Confidential” on PDF pages that include
sensitive information or “Draft” on a preliminary PDF document to be distributed for review.

1.3.4 PDFHeaderFooter Use Case Scenarios

Batch add headers and footers into PDF files to include information such as the date, page numbers,
or the title of the document.

1.3.5 PDFOptimizer Use Case Scenarios

Batch optimize large PDF files for electronic document exchange or space-saving document archiving.
Large PDF files are not suitable for electronic document exchange or document archiving. Users can
optimize large PDF documents instead of converting them into other formats.

1.3.6 PDFRedactor Use Case Scenarios

Batch redact or remove sensitive content or private information from PDF files. Users can redact or
remove sensitive text that are visible in PDF documents before distributing them to others, which
could also help prevent the receivers from tracing the documents back to the sender.

1.3.7 PDFMetadata Use Case Scenarios

Batch set document metadata information of PDF files. Users can set the title, author, subject,
keywords and creator of PDF files, which could greatly help in searching and organizing PDF files. For
example, the keywords can be particularly useful for narrowing searches.

1.3.8 PDF2Text Use Case Scenarios

Batch convert PDF files into plain text files for better archiving and indexing PDF files. It is indeed
helpful for text indexing and content retrieval by creating a full-text searchable archive database.
9
Foxit PDF Toolkit User Manual
www.foxitsoftware.com

1.3.9 Text2PDF Use Case Scenarios

Batch convert plain text files into PDF files for better viewing or editing. It is not easy for users to
view or edit plain text files, and in this case, users can convert them into PDF files for further
processing.

1.3.10 Html2PDF Use Case Scenarios

Convert a batch of local html files or a webpage (URL) into PDF files, making them easier to print or
archive. For some large html files or a webpage which contain(s) many contents, it is not convenient
to print or archive them directly. In this case, users can convert them into PDF file(s) which are widely
used in printing and document archiving.

1.4 System Requirements

Windows Platform
Windows Server 2012 Windows Server 2008 R2 Windows Server 2003 Windows 10 Windows 8.1 Windows 7 Windows Vista
Note For the Office2PDF module, please make sure that you have already installed Microsoft Office 2007 SP2
or later, and the virtual printers. If Microsoft Office 2007 is not the SP2 version, please download the
“Microsoft Save as PDF” plugin from http://www.microsoft.com/en-us/download/details.aspx?id=9943.

1.5 About This Manual

This manual aims at introducing how to use the command line of Foxit PDF Toolkit. It is intended for the users
who want to batch generate or process PDF files.
Section 1: gives an introduction of Foxit PDF Toolkit. Section 2: illustrates how to install and uninstall Foxit PDF Toolkit. Section 3: describes basic usage of Foxit PDF Toolkit.
10
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Section 4: introduces Foxit Configuration Tool of PDFWatermark and PDFHeaderFooter modules. Section 5: shows how to work with API. Section 6: provides support information.
11
Foxit PDF Toolkit User Manual
www.foxitsoftware.com

2 Installing and Uninstalling Foxit PDF Toolkit

2.1 Installation

Installation of Foxit PDF Toolkit is straightforward. You can download the trial release package, which is a zip
file from Foxit website (https://www.foxitsoftware.com/products/pdf-toolkit/), and then extract the package
to the desired location as shown in the following figure. In this manual, we rename the package “pdftools”
and unzip it to the directory “C:\pdftools”. The package contains:
configtool: configuration tools for pdfwatermark and pdfheaderFooter
doc: user manual for Foxit PDF Toolkit
include: header file for Foxit PDF Toolkit
lib: third-part libraries and databases for Foxit PDF Toolkit
rms: RMS command line tool
samples: some batch samples for Foxit PDF Toolkit
testfiles: testfiles for Foxit PDF Toolkit
Foxit PDF Toolkit package
12
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
After that, open a terminal session and navigate to the installation location to run your application (except
for PDFWatermark and PDFHeaderFooter modules, which are used only after using the Foxit Configuration
Tool to generate configuration file containing the setting information of watermark or header/footer). For
the Office2PDF module, please make sure that you have already installed Microsoft Office 2007 SP2 or later,
and the virtual printers. If Microsoft Office 2007 is not the SP2 version, please download the “Microsoft Save
as PDF” plugin from http://www.microsoft.com/en-us/download/details.aspx?id=9943.
Tips: You can set the installation path to Environment Variables, which allows you to use the commands in
the terminal window directly without needing to change the directory to the installation location. Go to
Start-> Control Panel-> System-> Advanced system settings -> Advanced -> Environment Variables, in the
“User variables for Administrator” box, select PATH and Edit, and then add the installation path as shown in
the following figure. If the environment variable “path” does not exist, create it by clicking New.
Set installation path to Environment Variables

2.2 Evaluation

The Foxit PDF Toolkit is distributed on a “try-before-you -buy” basis. Foxit allows users to download trial
version to evaluate the features. You have a 30-day free trial, during which the pages of all generated PDF
files will contain our watermark, and for the PDF2Text module, you can only convert the first ten PDF pages
into plain text files. After the evaluation period, customers that want to continue to use the product should
purchase a licensed version from Foxit website at https://www.foxitsoftware.com/products/pdf-toolkit/.
13
Foxit PDF Toolkit User Manual
www.foxitsoftware.com

2.3 About License

Foxit PDF Toolkit provides three types of licenses for customers to choose.
Desktop License- It is only available on desktop systems, which is perfect for personal or small
business use. Each license is good for one user on one machine.
Server License- It is available on servers, with 8 CPUs, which is good for small-to medium-sized
businesses that need higher performance on a single server. If your server has more than 8 CPUs,
please contact Foxit sales team to purchase Enterprise License.
Enterprise License- It is intended for large companies that need to process a large number of PDF
documents on multiple high-performance servers. Enterprise License also includes features for
integrating the Foxit PDF Toolkit into your own applications. Please contact Foxit sales team to
purchase Enterprise License.

2.4 Registration

When you get the activation code for the module you want to purchase, please use the argument “-register
<code> <licensee>” to activate it in the Command Prompt window. The following two steps show how to
open a Command Prompt window based on Windows 7 system.
a. Click on the Start menu. b. Type “cmd” in the Search programs and files box and press Enter.
In the opening Command Prompt window, type “cd C:\pdftools” to navigate to the installation location as
follows.
Navigate to the installation location
14
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Assume you get an activation code (77505-010G0-91000-PN37T-4Z8GS-0JKC3) for the Image2PDF module,
you may type fimg2pdf -register 77505-010G0-91000-PN37T-4Z8GS-0JKC3 FoxitTest” in the Command
Prompt window as shown below.
Register Foxit Convert2PDF tool
Here, “FoxitTestis the licensee name you input. After activation, a key file named ftlkey.txt” will be
generated in the installed path with the contents shown in the following figure.
The content of the generated key file
Then you can run “-fimg2pdf -licensein the Command Prompt window to check the license agreement as
follows.
15
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Check the license agreement

2.5 Uninstallation

If you want to uninstall the Foxit PDF Toolkit, all you need to do is to delete the installed folder.
16
Foxit PDF Toolkit User Manual
Option
Parameter
Description
-i
<-i <string>>
e.g.
-i c:\input\1.jpg
-i “c:\input\1.jpg” “c:\
input\2.tif”
Specifies the input file to be converted.
The input string can be the name of a single image
file (.bmp, .png, .jpg, .jpx, .gif, .tif, .tiff), multiple
image files, or a folder.
www.foxitsoftware.com

3 Command Line Usage

3.1 Image2PDF

3.1.1 Basic Syntax

fimg2pdf <-i <srcfile/srcfolder>> <-o <destfile/destfolder>> [[-width <PDF width>] [-height <PDF height>]]
[-dpi <resolution>] [-margin <left [top right bottom]>] [-b] [-sp <password>]
[-title <title>] [-subject <subject>] [-keywords <keywords>] [-author <author>] [-creator <creator>]
[-r [recursion]] [-t <thread>] [-log <logfile>] [-l <level>]
fimg2pdf -register <code> <licensee>
fimg2pdf -license
fimg2pdf -version/-v
fimg2pdf -help/-h
Note:
<> required [ ] optional / mutually exclusive A space is needed between the command line argument and the value
Only the <-i <srcfile/srcfolder>> and <-o <destfile/destfolder>> arguments are actually required. All others are
optional, which are available for controlling the output PDF files as desired. The arguments could be given in
any order. Full details on each are explained in the following section.

3.1.2 Command Line Summary

Note For some arguments whose values are strings, users can choose whether to add quotation marks (“ ”)
to the strings. In the manual we have added notes where adding quotation marks (“ ”) is required.
17
www.foxitsoftware.com
Option
Parameter
Description
-i c:\input
-i “c:\input\*.jpg”
The file name can contain the wildcard character
(*). For example, use *.tiff to include all TIFF image
files in a given folder.
Note Wildcard character (*.*) is currently not
supported.
-o
<-o <string>>
e.g.
-o d:\output\one.pdf
-o d:\output
Specifies the path of the output PDF file or folder.
If user specifies a path of a PDF file, (e.g. -o
d:\output\one.pdf), all input image files will be
combined into a single PDF file.
If user specifies a path of a folder, (e.g. -o
d:\output), every input image file will be converted
into individual PDF files.
Note The specified output path must already exist.
-width
[-width <points>]
e.g.
-width 612
Sets the page width of the output PDF file in points.
Default: Width of input image.
Note The -width and -height options must be used
together with a set value greater than 0.
-height
[-height <points>]
e.g.
-height 792
Sets the page height of the output PDF file in points.
Default: Height of input image.
Note The -width and -height options must be used
together with a set value greater than 0.
-dpi [-dpi <integer>]
e.g.
-dpi 0
-dpi 1
-dpi 300
Specifies DPI (Dots Per Inch) resolution of the output
PDF file. The default value is 72.
-dpi 0: uses the default image width and height
information.
-dpi 1: uses the DPI value of the input image. -dpi <integer>: sets the DPI resolution as the
given integer.
Note
If the program failed to get the DPI value of the
input image when the (-dpi) is set to 1, the DPI
value will be 96.
The -weight, -height and -dpi options should not be
used together.
Foxit PDF Toolkit User Manual
18
www.foxitsoftware.com
Option
Parameter
Description
If you only use -width and -dpi, or -height and -
dpi, the width or height setting will be omitted.
If you use -width, -height and -dpi, the dpi
setting will be omitted.
-margin
[-margin <points [points
points points ]>]
-margin <left [top right
bottom]>
e.g.
-margin 20
-margin 10 20
-margin 10 20 0
-margin 10 20 0 40
Sets size of margin for each PDF page in points.
Default value for each margin: 0.
Allowable values: 0-size of page in points; in addition,
the sum of the left and right values must be less than
the width of the page, and the sum of the top and
bottom values must be less than the height of the page.
-margin left top right bottom
-margin 20: sets the left margin to 20 points.
-margin 10 20: sets the left margin to 10 points and
the top margin to 20 points.
-margin 10 20 0: sets the left margin to 10 points, the
top margin to 20 points, and the right margin to 0
points.
-margin 10 20 0 40: sets the left margin to 10 points,
the top margin to 20 points, the right margin to 0
points, and the bottom margin to 40 points.
-b
[-b]
e.g.
-b
Uses the filename of the image(s) to create bookmark(s)
for the output PDF.
-sp
[-sp <string>]
e.g.
-sp 123
-sp welcome
Sets the document open password of the output PDF as
the "string". By default, there is no password.
-title
<-title <string>>
e.g.
-title “Foxit PDF Toolkit
User Manual”
Sets title of PDF files.
-subject
<-subject <string>>
e.g.
-subject “Foxit PDF Toolkit”
Sets subject of PDF files.
Foxit PDF Toolkit User Manual
19
www.foxitsoftware.com
Option
Parameter
Description
-keywords
[-keywords <string>]
e.g.
-keywords “Foxit”
Sets keywords of PDF files.
-author
[-author <string>]
e.g.
-author “Jessie”
Sets author of PDF files.
-creator
[-creator <string>]
e.g.
-creator “Foxit
PhantomPDF”
-creator “Foxit Reader”
-creator “Microsoft® Word
2013”
Sets creator of PDF files.
Note It indicates the name of the application that
created the source document from which a PDF is
generated. For example, if the source document was
created from Microsoft® Word 2013, then you can set
the creator to “Microsoft® Word 2013”.
-r
[-r [integer]]
e.g.
-r
-r 0
-r 1
-r 2
Specifies the number of layers to recurse when the
input is a folder.
-r 0 <-r>: searches the full folders. -r 1: searches only the current folder. -r 2: searches the current folder and its
sub-folders
Note
If no integer value is specified, or if the integer
value is 0, then full folders will be searched. By
default, the number of layers to recurse is 1, which
means that only the current folder will be searched
and not sub-folders.
The input folder will be skipped if it is secured and
the messages will be displayed.
-t
[-t <integer>]
e.g.
-t 1
-t 2
Specifies the number of CPU threads to use.
The default value is 1.
-log
[-log <string>]
e.g. -log d:\a.log
Writes log information into a logfile at the specified
existing path.
Foxit PDF Toolkit User Manual
20
www.foxitsoftware.com
Option
Parameter
Description
-l
[-l <integer>]
e.g.
-l 1
-l 2
-l 3
-l 4
Sets the log level. The default is 4.
-l 1: logs messages only concerning program
crashes.
-l 2: logs failure messages concerning the errors
caused during execution or those returned from
underlying libraries, as well as those for level 1.
-l 3: logs warning messages concerning the PDF
files that are overwritten, as well as those for
level 2.
-l 4: logs informational messages, as well as those
for level 3.
Note The argument (-l) is valid only when (-log) is used.
-register
[-register <String> <String>]
-register <code> <licensee>
e.g.
-register 77505-010G0-
G1000-XMQ8D-2CR7R-
TPBEI Foxit
Registers the command line tool.
<code>: the activation code from Foxit. <licensee>: the Licensee name designated by the
users.
-help/-h
[-help/-h]
e.g.
-help
-h
Prints the usage information.
-version/-v
[-version/-v]
e.g.
-version
-v
Prints the version information.
-license
[-license]
e.g. -license
Prints the license agreement.
Foxit PDF Toolkit User Manual

3.1.3 Basic Usage

3.1.3.1 Input and Output
a) Input (-i)
The input files should be a single image file, multiple image files, or a folder. Users are not able to
input multiple folders, as well as a mixture composed of folders and image files. For example:
21
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
-i c:\input\1.jpg (a single image file)
-i “c:\input\1.jpg” “c:\input\2.tif” (multiple image files)
-i c:\input (a single folder)
Note If the input files are multiple image files, it is recommended to enclose each input path with
quotation marks (“ ”). In this manual, we add (“ ”) whenever the input files are multiple image files.
It supports relative paths if the input files are in the current working folder. Users can input just the
name of the image files or folder, instead of an absolute path. For example:
-i test\3.bmp (“test\3.bmp” is in the current working folder)
-i test (“test” folder is in the current working folder)
It also supports wildcard characters, which are used to process multiple image files in specified
formats. For example:
-i “c:\input\*.jpg” (Only convert images with JPG format)
-i “c:\input\*.jpg” “c:\input\*.tif” (Only convert images with JPG and TIF formats)
-i “test\*.png” (Only convert images with PNG format)
Note When using wildcard characters in the input files, it is recommended to enclose the input files
with quotation marks (“ ”). In this manual, we add (“ ”) whenever the input files contain wildcard
characters.
b) Output (-o)
There are two output formats:
Combine multiple image files into one PDF file
Convert each image file into individual PDF files
If you want to combine multiple image files into one PDF file, you should specify the output path of a
PDF file. If you want to convert each image file into individual PDF files, you should specify the
output path of a folder. For example:
-o d:\output\one.pdf (Combine multiple image files into one PDF file)
-o d:\output (Convert each image file into individual PDF files)
Note The specified output path must already exist.
22
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
The output also supports relative paths if the specified output location is in the current working
folder. Users can input just the name of the PDF file or output folder, instead of an absolute path. For
example:
-o output\one.pdf (“output” folder is in the current working folder)
-o output (“output” folder is in the current working folder)
When the input is one or more image files, or if it includes wildcard characters, the output should be
a single PDF file. For example, the first following line combines the “3.bmp” and “4.gif” image files
into “out.pdf” file, where the “test” and “output” folders are both in the current working folder. And
the second line combines all the “.jpg” and “.tif” image files in the “c:\input” folder into “out.pdf” in
“d:\output” folder.
fimg2pdf -i “test\3.bmp” “test\4.gif” -o output\out.pdf
fimg2pdf -i “c:\input\*.jpg” “c:\input\*.tif” –o d:\output\out.pdf
Usage Examples
1) Convert each image file into individual PDF files:
fimg2pdf -i test -o output (“test” and “output” folders are both in the current working folder)
fimg2pdf -i c:\input -o d:\output
2) Combine multiple image files into one PDF file:
fimg2pdf -i “test\3.bmp” “test\4.gif” -o output\one.pdf
fimg2pdf -i c:\input\1.jpg -o d:\output\one.pdf
fimg2pdf -i “c:\input\1.jpg” “c:\input\2.tif” -o d:\output\one.pdf
fimg2pdf -i c:\input -o d:\output\one.pdf
fimg2pdf -i “c:\input\*.jpg” -o d:\output\one.pdf
3.1.3.2 PDF/Page Settings
a) Page size setting (-width, -height)
The optional arguments (-width) and (-height) are used to set the page width and height for the
output PDF file in points.
Note The –width and –height options must be used together with a set value greater than 0.
23
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Usage Example
1) Set the page width and height to 400 and 300 for the output PDF file (-width 400 -height 300)
fimg2pdf -i “c:\input\1.jpg” “c:\input\2.tif” -o d:\output\one.pdf -width 400 -height 300
fimg2pdf -i c:\input -o d:\output -width 400 -height 300
fimg2pdf -i “c:\input\*.jpg” -o d:\output\one.pdf -width 400 -height 300
b) Resolution (DPI) setting (-dpi)
The optional argument (-dpi) is used to set the resolution for the output PDF file. By default, the DPI
(Dots Per Inch) is 72, which is the typical resolution for web images. For more details about this
argument, please refer to section 3.1.2 “Command Line Summary”.
Note
If the program failed to get the DPI value of the input image when the (-dpi) is set to 1, the
DPI value will be 96.
The options -weight, -height and -dpi should not be used together.
If you only use -width and -dpi, or -height and -dpi, the width or height setting will be
omitted.
If you use -width, -height and -dpi, the dpi setting will be omitted.
Usage Examples
1) Use the default image width and height information (-dpi 0)
fimg2pdf -i “c:\input\1.jpg” “c:\input\2.tif” -o d:\output\one.pdf -dpi 0
fimg2pdf -i c:\input –o d:\output -dpi 0
fimg2pdf -i “c:\input\*.jpg” –o d:\output\one.pdf -dpi 0
2) Use the DPI information of the original image (-dpi 1)
fimg2pdf -i “c:\input\1.jpg” “c:\input\2.tif” -o d:\output\one.pdf -dpi 1
fimg2pdf -i c:\input –o d:\output -dpi 1
fimg2pdf -i “c:\input\*.jpg” –o d:\output\one.pdf -dpi 1
3) Set the DPI to 300 for the output PDF file (-dpi 300)
fimg2pdf -i “c:\input\1.jpg” “c:\input\2.tif” -o d:\output\one.pdf -dpi 300
24
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fimg2pdf -i c:\input –o d:\output -dpi 300
fimg2pdf -i “c:\input\*.jpg” –o d:\output\one.pdf -dpi 300
c) Bookmark (-b)
The optional argument (-b) is used to create bookmarks for the output PDF file. The name of the
bookmarks is the name of the images.
Usage Example
1) Create bookmarks for the output PDF file (-b)
fimg2pdf -i “c:\input\1.jpg” “c:\input\2.tif” -o d:\output\one.pdf -b
fimg2pdf -i c:\input -o d:\output\one.pdf -b
fimg2pdf -i “c:\input\*.jpg” -o d:\output\one.pdf -b
d) Margin setting (-margin)
The optional argument (-margin) is used to set size of margin for each PDF page in points. By default,
the output PDF page has no margin. For more details about this argument, please refer to section
3.1.2 “Command Line Summary”.
Note The sum of the left and right values must be less than the width of the page, and the sum of the top
and bottom values must be less than the height of the page.
Usage Example
1) Set the left margin to 20 points (-margin 20)
fimg2pdf -i “c:\input\1.jpg” “c:\input\2.tif” -o d:\output\one.pdf -margin 20
fimg2pdf -i c:\input -o d:\output\one.pdf -margin 20
fimg2pdf -i “c:\input\*.jpg” -o d:\output\one.pdf -margin 20
2) Set the left margin to 20 points, and the top margin to 10 points (-margin 20 10)
fimg2pdf -i “c:\input\1.jpg” “c:\input\2.tif” -o d:\output\one.pdf -margin 20 10
fimg2pdf -i c:\input -o d:\output\one.pdf -margin 20 10
fimg2pdf -i “c:\input\*.jpg” -o d:\output\one.pdf -margin 20 10
25
Loading...
+ 177 hidden pages