ww w. f o x it s o f t w a re . c o m
Fo x it PD F Too lki t U se r M an ua l
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.2.1 Image2PDF Features ................................................................................................................ 3
1.2.2 Office2PDF Features ................................................................................................................ 4
1.2.3 PDFWatermark Features ......................................................................................................... 4
1.2.4 PDFHeaderFooter Features ..................................................................................................... 5
1.2.5 PDFOptimizer Features ............................................................................................................ 5
1.2.6 PDFRedactor Features ............................................................................................................. 6
1.2.7 PDFMetadata Features ............................................................................................................ 7
1.2.8 PDF2text Features ................................................................................................................... 7
1.2.9 Text2PDF Features ................................................................................................................... 7
1.3 Common Use Case Scenarios ........................................................................................................ 8
1.3.1 Image2PDF Use Case Scenarios ............................................................................................... 8
1.3.2 Office2PDF Use Case Scenarios ............................................................................................... 8
1.3.3 PDFWatermark Use Case Scenarios ......................................................................................... 8
1.3.4 PDFHeaderFooter Use Case Scenarios .................................................................................... 8
1.3.5 PDFOptimizer Use Case Scenarios ........................................................................................... 9
1.3.6 PDFRedactor Use Case Scenarios ............................................................................................ 9
1.3.7 PDFMetadata Use Case Scenarios ........................................................................................... 9
1.3.8 PDF2Text Use Case Scenarios .................................................................................................. 9
1.3.9 Text2PDF Use Case Scenarios .................................................................................................. 9
1.4 System Requirements ................................................................................................................... 9
1.5 About This Manual ...................................................................................................................... 10
2 Installing and Uninstalling Foxit PDF Toolkit .................................................................. 11
2.1 Installation .................................................................................................................................. 11
2.2 Evaluation ................................................................................................................................... 12
2.3 Registration ................................................................................................................................. 13
2.4 About License .............................................................................................................................. 14
2.5 Uninstallation .............................................................................................................................. 14
3 Command Line Usage .................................................................................................... 15
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
3.1 Image2PDF .................................................................................................................................. 15
3.1.1 Basic Syntax ........................................................................................................................... 15
3.1.2 Command Line Summary ....................................................................................................... 15
3.1.3 Basic Usage ............................................................................................................................ 19
3.2 Office2PDF .................................................................................................................................. 29
3.2.1 Basic Syntax ........................................................................................................................... 29
3.2.2 Command Line Summary ....................................................................................................... 29
3.2.3 Basic Usage ............................................................................................................................ 32
3.3 PDFWatermark ............................................................................................................................ 40
3.3.1 Basic Syntax ........................................................................................................................... 40
3.3.2 Command Line Summary ....................................................................................................... 40
3.3.3 Basic Usage ............................................................................................................................ 43
3.4 PDFHeaderFooter........................................................................................................................ 50
3.4.1 Basic Syntax ........................................................................................................................... 50
3.4.2 Command Line Summary ....................................................................................................... 50
3.4.3 Basic Usage ............................................................................................................................ 54
3.5 PDFOptimizer .............................................................................................................................. 62
3.5.1 Basic Syntax ........................................................................................................................... 62
3.5.2 Command Line Summary ....................................................................................................... 62
3.5.3 Basic Usage ............................................................................................................................ 68
3.6 PDFRedactor ............................................................................................................................... 78
3.6.1 Basic Syntax ........................................................................................................................... 78
3.6.2 Command Line Summary ....................................................................................................... 78
3.6.3 Basic Usage ............................................................................................................................ 84
3.7 PDFMetadata .............................................................................................................................. 97
3.7.1 Basic Syntax ........................................................................................................................... 97
3.7.2 Command Line Summary ....................................................................................................... 97
3.7.3 Basic Usage .......................................................................................................................... 100
3.8 PDF2Text ................................................................................................................................... 108
3.8.1 Basic Syntax ......................................................................................................................... 108
3.8.2 Command Line Summary ..................................................................................................... 108
3.8.3 Basic Usage .......................................................................................................................... 112
3.9 Text2PDF ................................................................................................................................... 121
3.9.1 Basic Syntax ......................................................................................................................... 121
3.9.2 Command Line Summary ..................................................................................................... 121
3.9.3 Basic Usage .......................................................................................................................... 125
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
3.10 RMS ........................................................................................................................................... 135
3.10.1 Basic Syntax ..................................................................................................................... 135
4 Foxit Configuration Tool .............................................................................................. 136
4.1 Watermark Configuration Tool ................................................................................................. 136
4.1.1 Watermark Settings ............................................................................................................. 137
4.2 PDFHeaderFooter Configuration Tool ....................................................................................... 139
4.2.1 Header/Footer Settings ....................................................................................................... 141
5 Working with API ........................................................................................................ 143
5.1 Image2PDF ................................................................................................................................ 144
5.1.1 Working with Image2PDF API .............................................................................................. 144
5.1.2 Reporting Progress Messages and Errors ............................................................................ 147
5.2 Office2PDF ................................................................................................................................ 148
5.2.1 Working with Office2PDF API .............................................................................................. 148
5.2.2 Reporting Progress Messages and Errors ............................................................................ 151
5.3 PDFWatermark .......................................................................................................................... 152
5.3.1 Working with PDFWatermark API ....................................................................................... 152
5.3.2 Reporting Progress Messages and Errors ............................................................................ 154
5.4 PDFHeaderFooter...................................................................................................................... 155
5.4.1 Working with PDFHeaderFooter API ................................................................................... 155
5.4.2 Reporting Progress Messages and Errors ............................................................................ 157
5.5 PDFOptimizer ............................................................................................................................ 158
5.5.1 Working with PDFOptimizer API .......................................................................................... 158
5.5.2 Reporting Progress Messages and Errors ............................................................................ 161
5.6 PDFRedactor ............................................................................................................................. 162
5.6.1 Working with PDFRedactor API ........................................................................................... 162
5.6.2 Reporting Progress Messages and Errors ............................................................................ 166
5.7 PDFMetadata ............................................................................................................................ 167
5.7.1 Working with PDFMetadata API .......................................................................................... 167
5.7.2 Reporting Progress Messages and Errors ............................................................................ 170
5.8 PDF2Text ................................................................................................................................... 171
5.8.1 Working with PDF2Text API ................................................................................................. 171
5.8.2 Reporting Progress Messages and Errors ............................................................................ 173
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
5.9 Text2PDF ................................................................................................................................... 174
5.9.1 Working with Text2PDF API ................................................................................................. 174
5.9.2 Reporting Progress Messages and Errors ............................................................................ 178
6 Support....................................................................................................................... 180
6.1 Reporting Problem .................................................................................................................... 180
6.2 Contact Information .................................................................................................................. 180
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 ten modules: Image2PDF, Office2PDF, PDFWatermark, PDFHeaderFooter,
PDFOptimizer, PDFRedactor, PDFMetadata, PDF2Text, Text2PDF 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 and Text2PDF. For the RMS PDF
Protection module, the user manual will cover in detail the module’s basic syntax in section 3.10 “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 needing to install any additional software. 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 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 needing to install any
additional software. The PDFWatermark tool applies a pre-made watermark to PDF files, which supports
watermarks in both text or image formats. The watermark is saved as a configuration file with the extension
“.xml” , which is generated by the build-in Foxit Configuration Tool (Either fpdfwmconf.exe or
fpdfwmconf64.exe, a GUI application, depending on your operating system).
PDFWatermark allows users to batch add a watermark into PDF files, without needing to install any
additional software. The PDFWatermark tool applies a pre-made watermark to PDF files, which supports
three types of watermarks: text, image and PDF. The watermark is saved as a configuration file with the
extension “.xml”, which is generated by the build -in Foxit Configuration Tool (Either fpdfwmconf.exe or
fpdfwmconf64.exe, a GUI application, depending on your operating system).
1
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
PDFHeaderFooter batch adds header/footer into large volumes of PDF files, without needing to install any
additional software. 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 build-in
Foxit Configuration Tool (Either fpdfhfconf.exe or fpdfhfconf64.exe, a GUI application, depending on your
operating system).
PDFOptimizer batch reduces the size of PDF files to reduce disk space, making them easier to share or
archive, without needing to install any additional software. 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 removes sensitive content or private information from your PDF documents prior to
making them available to others, without needing to install any additional software. 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 adds document metadata information to PDF files, without needing to install any
additional software. With PDFMetadata, users can set the title, author, subject, keywords and creator of PDF
files, and view the metadata information.
PDF2text batch converts large volumes of PDF files into plain text files, without needing to install any
additional software. 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 a minimum loss of
formatting information, without needing to install any additional software. 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.
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 creation
and processing on Windows servers. 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:
2
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
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.
Lightweight footprint – Lower memory usage and faster installation.
Perfect message mechanism – Gives more perfect message hints if users encounter problems when
using the tools, so Foxit PDF Toolkit can 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 fixing bugs
and adding new features and functionalities. 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 in server environments.
Support multi-thread processing.
Support 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 open password for the PDF file to be converted.
Add bookmarks to the PDF file to be converted.
Set margin for each PDF page.
Set document metadata information of PDF files, such as the title, subject, keywords, author and
creator.
Support wildcard character in batch conversion, e.g., *.jpg, *.png.
Offer simple-to-use API.
3
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
1.2.2 Office2PDF Features
Batch convert Microsoft Office files into PDF files in server environments.
Support multi-thread processing.
Support sub-folder recursion processing.
Support single PDF file processing or single-folder processing.
Support password-protected Microsoft Office files.
Support the popular Microsoft Office document formats, including doc, docx, xls, xlsx, ppt and pptx.
Add bookmarks to PDF files converted only from Microsoft Word documents.
Support 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 wildcard character in batch conversion, e.g., *.docx, *.pptx.
Support PDF/A Standard for the PDF file to be converted.
Offer simple-to-use API.
1.2.3 PDFWatermark Features
Batch add a watermark into PDF files.
Support multi-thread processing.
Support sub-folder recursion processing.
Support single PDF file processing or single-folder processing.
Support password-protected PDF files.
Support text, image, and PDF watermarks.
Support stylized text watermarks that include font, font size, font color 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.
Rotate watermark in 360 degree rotations.
Set opacity for watermarks.
Scale relative to target page for watermarks.
Control the visibility of watermarks when printing.
Control the visibility of watermarks when being displayed on screen.
Keep watermark position and size for different page sizes.
Appear on top or in the background of the page.
Set watermark position in PDF page.
Specify a page range to add watermark.
Set document metadata information of PDF files, such as the title, subject, keywords, author and
creator.
4
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Support wildcard character in batch processing, e.g., *.pdf.
Preview watermark in the build-in Foxit Configuration Tool.
Offer simple-to-use API.
1.2.4 PDFHeaderFooter Features
Batch add header/footer into PDF files.
Support multi-thread processing.
Support sub-folder recursion processing.
Support single PDF file processing or single-folder processing.
Support password-protected PDF files.
Support stylized text for the header/footer, including font, font size, font color, underline and
embedded font settings.
Support margins settings.
Shrink a document to avoid overwriting the document’s text and graphics.
Keep position and size of header/footer constant on different page sizes.
Set page number and date as header/footer.
Support page number and date format settings.
Specify the page range to add header/footer.
Set document metadata information of PDF files, such as the title, subject, keywords, author and
creator.
Support wildcard character in batch processing, e.g., *.pdf.
Preview header/footer in the build-in Foxit Configuration Tool.
Offer simple-to-use API.
1.2.5 PDFOptimizer Features
Batch optimize PDF files.
Support multi-thread processing.
Support sub-folder recursion processing.
Support single PDF file processing or 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.
5
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Discard embedded print settings.
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 of PDF files, such as the title, subject, keywords, author and
creator.
Support wildcard character 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.
Support multi-thread processing.
Support sub-folder recursion processing.
Support single PDF file processing or 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 redaction.
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 of PDF files, such as the title, subject, keywords, author and
creator.
Support wildcard character in batch processing, e.g., *.pdf.
Offer simple-to-use API.
6
www.foxitsoftware.com
1.2.7 PDFMetadata Features
Batch add document metadata information to PDF files.
Support multi-thread processing.
Support sub-folder recursion processing.
Support single PDF file processing or 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.
Foxit PDF Toolkit User Manual
1.2.8 PDF2text Features
Batch convert PDF files into plain text files.
Support multi-thread processing.
Support sub-folder recursion processing.
Support single-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.
Support UTF8 and UTF16 text encoding.
Support wildcard character in batch processing, e.g., *.pdf.
Offer simple-to-use API.
1.2.9 Text2PDF Features
Batch convert text files into PDF files.
Support multi-thread processing.
Support sub-folder recursion processing.
Support single-file processing and single-folder processing.
7
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Support most commonly used languages.
Set page width and height for the PDF file to be converted.
Set margin for each PDF page.
Support font style, font size and font color settings.
Set open password for the PDF file to be converted.
Set document metadata information of PDF files, such as the title, subject, keywords, author and
creator.
Support wildcard character in batch processing, e.g., *.txt.
Offer simple-to-use API.
1.3 Common Use Case Scenarios
1.3.1 Image2PDF Use Case Scenarios
Batch convert images into PDF files in server environments 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 in server environments.
Set the converted PDF files to be compliant with PDF/A standard for better archiving.
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 header/footer into PDF files to include information such as the date, page numbers, or the
title of the document.
8
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
1.3.5 PDFOptimizer Use Case Scenarios
Batch optimize large PDF files for electronic document exchange or space-saving document archiving
in server environments. 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 add document metadata information to PDF files. Users can set the title, author, subject,
keywords and creator of PDF files, which could help them to find particular documents through
searching these descriptions. 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.
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.4 System Requirements
Windows Platform:
Windows Server 2012
Windows Server 2008 R2
Windows Server 2003
9
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Windows 10
Windows 8.1
Windows 7
Windows Vista
Note For the Office2PDF tool, 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 the command line usage of Foxit PDF Toolkit. It is intended for the audiences
who want to batch generate or process PDF files in server environments.
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.
Section 4: introduces Foxit Configuration Tool of PDFWatermark and PDFHeaderFooter modules.
Section 5: shows how to work with API.
Section 6: provides support information.
10
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 our website (www.foxitsoftware.com), 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
11
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
After that, open a terminal session and change the directory 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 free 30-day trial, but the pages of all created PDF files will
contain our watermark, and for the PDF2Text module, you can only convert first ten PDF pages into plain text
12
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
files. After the evaluation period, customers that want to continue to use the product should contact Foxit
sales team to purchase corresponding activation codes for the desired modules.
2.3 Registration
When you get the activation code for the module you want to purchase, please use the argument “-register
<code> <licensee>” to active it in the command line window. For example, assume you get the 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 line window as shown below.
Here, “ FoxitTest” is the name of the licensee you designated. After activation, a key file named “ftlkey.txt ”
will be generated in the installed path with the contents shown in the following figure.
Then you can run “ -fimg2pdf -license” in the command line window to check the license agreement as
follows.
13
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
2.4 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.5 Uninstallation
If you want to uninstall the Foxit PDF Toolkit, all you need to do is to delete the installed folder.
14
Foxit PDF Toolkit User Manual
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.
15
www.foxitsoftware.com
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.
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.
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.
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.
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
16
www.foxitsoftware.com
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 <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.
Uses the filename of the image(s) to create bookmark(s)
for the output PDF.
Sets the document open password of the output PDF as
the "string". By default, there is no password.
<-title <string>>
e.g.
-title “Foxit PDF Toolkit
User Manual”
e.g.
-subject “Foxit PDF Toolkit”
Sets subject of PDF files.
Foxit PDF Toolkit User Manual
17
www.foxitsoftware.com
Sets keywords of PDF files.
Sets author of PDF files.
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”.
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 <integer>]
e.g.
-t 1
-t 2
Specifies the number of CPU threads to use.
Writes log information into a logfile at the specified
existing path.
Foxit PDF Toolkit User Manual
18
www.foxitsoftware.com
[-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 <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.
Prints the usage information.
Prints the version information.
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:
19
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.
20
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.
21
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
22
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
23
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
3) Set the left margin to 10 points, the top margin to 10 points and the right margin to 30 points (-
margin 10 10 30)
fimg2pdf -i “c: \input\1.jpg” “c: \input\2.tif” -o d:\output\one.pdf -margin 10 10 30
fimg2pdf -i c:\input -o d:\output\one.pdf -margin 10 10 30
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -margin 10 10 30
4) Set the left margin to 10 points, the top margin to 10 points, the right margin to 30 points and the
bottom margin to 20 points (-margin 10 10 30 20)
fimg2pdf -i “c: \input\1.jpg” “c: \input\2.tif” -o d:\output\one.pdf -margin 10 10 30 20
fimg2pdf -i c:\input -o d:\output\one.pdf -margin 10 10 30 20
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -margin 10 10 30 20
e) Password setting (-sp)
The optional argument (-sp) is used to set the open password for the output PDF file. By default, the
output PDF file has no open password.
Usage Example
1) Set the open password to “welcome” for the output PDF files (-sp welcome)
fimg2pdf -i “c: \input\1.jpg” “c: \input\2.tif” -o d:\output\one.pdf -sp welcome
fimg2pdf -i c:\input –o d:\output -sp welcome
fimg2pdf -i “c: \input\*.jpg” – o d:\output\one.pdf -sp welcome
3.1.3.3 Document Metadata Settings
a) Title (-title)
The optional argument (-title) is used to set title of PDF files.
Usage Example
1) Set document title to “Foxit PDF Toolkit User Manual” (-title “Foxit PDF Toolkit User Manual”)
fimg2pdf -i “c: \input\1.jpg” “c: \input\2.tif” -o d:\output\one.pdf -title “Foxit PDF Toolkit User
Manual”
fimg2pdf -i c:\input -o d:\output\one.pdf -title “Foxit PDF Toolkit User Manual”
24
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -title “Foxit PDF Toolkit User Manual”
b) Subject (-subject)
The optional argument (-subject) is used to set subject of PDF files.
Usage Example
1) Set document subject to “Foxit PDF Toolkit” (-subject “Foxit PDF Toolkit”)
fimg2pdf -i “c: \input\1.jpg” “c: \input\2.tif” -o d:\output\one.pdf -subject “Foxit PDF Toolkit”
fimg2pdf -i c:\input -o d:\output\one.pdf -subject “Foxit PDF Toolkit”
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -subject “Foxit PDF Toolkit”
c) Keywords (-keywords)
The optional argument (-keywords) is used to set keywords of PDF files.
Usage Example
1) Set document keywords to “toolkit” (-keywords “toolkit”)
fimg2pdf -i “c: \input\1.jpg” “c: \input\2.tif” -o d:\output\one.pdf -keywords “toolkit”
fimg2pdf -i c:\input -o d:\output\one.pdf -keywords “toolkit”
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -keywords “toolkit”
d) Author (-author)
The optional argument (-author) is used to set author of PDF files.
Usage Example
1) Set document author to “Jessie” (-author “Jessie”)
fimg2pdf -i “c: \input\1.jpg” “c: \input\2.tif” -o d:\output\one.pdf -author “Jessie”
fimg2pdf -i c:\input -o d:\output\one.pdf -author “Jessie”
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -author “Jessie”
e) Creator (-creator)
The optional argument (-creator) is used to set file creation application information of PDF files.
25
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Usage Example
1) Set document creator to “Foxit Reader” (-creator “Foxit Reader”)
fimg2pdf -i “c: \input\1.jpg” “c: \input\2.tif” -o d:\output\one.pdf -creator “Foxit Reader”
fimg2pdf -i c:\input -o d:\output\one.pdf -creator “Foxit Reader”
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -creator “Foxit Reader”
3.1.3.4 Recursion Depth of Sub-folders
The optional argument (-r) indicates the recursion depth of sub-folders, which is valid only when the
input is a folder or a path that includes wildcard character like “c:\input\*.jpg”. By default, the
recursion depth is 1, so the sub-folders will not be processed. For more details about this argument,
please refer to section 3.1.2 “ Command Line Summary”.
Usage Examples
1) Search the full folders (-r or -r 0)
fimg2pdf -i test -o output -r 0
fimg2pdf -i c:\input -o d:\output -r 0
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -r 0
fimg2pdf -i test -o output -r
fimg2pdf -i c:\input -o d:\output -r
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -r
2) Search only the current folder (-r 1)
fimg2pdf -i test -o output -r 1
fimg2pdf -i c:\input -o d:\output -r 1
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -r 1
Note If you don’t use this argument, the current folder will be searched by default. For example:
fimg2pdf -i test -o output
fimg2pdf -i c:\input -o d:\output
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf
3) Search the current folder and its sub-folders (-r 2)
26
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fimg2pdf -i test -o output -r 2
fimg2pdf -i c:\input -o d:\output -r 2
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -r 2
3.1.3.5 Multi-thread Support
The optional argument (-t) indicates the number of threads that are used to speed up batch
conversion by making full use of the CPU. By default, the number of the threads is 1.
Note It is recommended that you set the value of the number according to your computer’s CPU
configuration.
Usage Example
1) Set the number of threads to 3 (-t 3)
fimg2pdf -i test -o output -t 3
fimg2pdf -i c:\input -o d:\output -t 3
fimg2pdf -i “c: \input\*.jpg” -o d:\output\one.pdf -t 3
3.1.3.6 Other Optional Arguments
a) Log file (-log<logfile> -l<log level>)
The optional argument (-log) indicates the path of logfile, where the log message is placed. The
argument (-l ) indicates the log level. It is valid only when (-log ) is used. By default, the log level is 4.
For more details about this argument, please refer to section 3.1.2 “Command Line Summary”.
Usage Example
1) Save the log file to “d:\output\image2pdf.log” and set the log level to 3 (-log
d:\output\image2pdf.log -l 3)
fimg2pdf -i c:\input -o d:\output -log d:\output\image2pdf.log -l 3
b) Register information (-register <code> <licensee>)
The optional argument (-register) is used to register the command line tool. The <code> is the
activation code from Foxit and <licensee> is the licensee name designated by the users.
27
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Usage Example
1) Register the image2pdf tool with the code “77505-010G0-G1000-XMQ8D-2CR7R-TPBEI” and the
licensee “Foxit ” (-register 77505-010G0-G1000-XMQ8D-2CR7R-TPBEI Foixt)
fimg2pdf -register 77505-010G0-G1000-XMQ8D-2CR7R-TPBEI Foixt
c) License agreement (-license)
The optional argument (-license) is used to print the license agreement.
Usage Example
1) Print the license information (-license)
fimg2pdf -license
d) Version information (-version/-v)
The optional argument (-version/-v) is used to print the version information.
Usage Example
1) Print the version information (-version/-v)
fimg2pdf -version
fimg2pdf -v
e) Help information (-help/-h)
The optional argument (-help/-h) is used to print the usage information.
Usage Example
1) Print the usage information (-help/-h)
fimg2pdf -help
fimg2pdf -h
28
Foxit PDF Toolkit User Manual
e.g.
-i c:\input\1.doc
-i c:\input
-i “c: \input\*.ppt”
Specifies the input file to be converted.
The input string can be the name of a single
Microsoft Office file
(.doc, .docx, .xls, .xlsx, .ppt, .pptx) or a folder.
The file name can contain the wildcard
character (*). For example, use *.doc to include
all Doc files in a given folder.
Note The wildcard character (*.*) is currently not
supported.
www.foxitsoftware.com
3.2 Office2PDF
3.2.1 Basic Syntax
foffice2pdf <-i <srcfile/srcfolder>> <-o <destfile/destfolder>> [-pdfa] [-b <bookmark level>] [-scale]
[-op <password>] [-r [recursion]] [-t <threads>] [-log <logfile>] [-l <level>]
foffice2pdf -register <code> <licensee>
foffice2pdf -license
foffice2pdf -version/-v
foffice2pdf -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.2.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.
29
www.foxitsoftware.com
e.g.
-o D:\output\1.pdf
-o D:\output
Specifies the path of the output PDF file or folder.
If the input is a single Microsoft Office file, the
output should be a single PDF file, (e.g. -o
D:\output\1.pdf).
If the input is a folder, the output should be a
folder, (e.g. -o D:\output ).
Note The specified output path must already exist.
Specifies that the output PDF file(s) should be
compliant with the PDF/A standard.
Creates bookmarks for the output PDF file.
If not set, there are no PDF bookmarks.
-b 0: Not to create PDF bookmarks.
-b 1: Create PDF bookmarks using headings
of a Microsoft Word file.
-b 2: Create PDF bookmarks using bookmarks
of a Microsoft Word file.
Note This argument (-b ) is valid only for Microsoft
Word files.
e.g.
-scale 0
-scale 1
-scale 2
-scale 3
Specifies the conversion mode for Microsoft Excel
files. The default is 1.
-scale 0: No scaling. Convert sheets at their
actual size.
-scale 1: Fit all columns on one page. Scale
every sheet so that it is one page wide.
-scale 2: Fit all rows on one page. Scale every
sheet so that it is one page high.
-scale 3: Fit sheet on one page. Scale every
sheet so that it fits on one page.
Note This argument (-scale ) is supported only on
versions higher than Microsoft Office 2007 and is
valid only for Microsoft Excel files.
Foxit PDF Toolkit User Manual
30
www.foxitsoftware.com
Specifies the open password for the input file. Not
required if the input file is not password protected.
Note The output PDF file will not retain the open
password from the input file.
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 Microsoft Office file or folder will be
skipped if it is secured and the messages will be
displayed.
Specifies the number of CPU threads to use.
Writes log information into a logfile at the specified
existing path.
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.
Foxit PDF Toolkit User Manual
31
www.foxitsoftware.com
-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 <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.
Prints the usage information.
Prints the version information.
Prints the license agreement.
Foxit PDF Toolkit User Manual
3.2.3 Basic Usage
3.2.3.1 Input and Output
a) Input (-i)
The input file should be a single Microsoft Office file or a folder. Users are not able to input multiple
Office files or folders, as well as a mixture composed of folders and Office files. For example:
-i c:\input\1.doc (a single Microsoft Office file)
-i c:\input (a single folder)
32
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
It supports relative paths if the input file is in the current working folder. Users can input just the
name of the Microsoft Office file or folder, instead of an absolute path. For example:
-i test\2.xls (“test \2.xls” 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 office files in specified
formats. For example:
-i “c: \input\*.doc” (Only convert Office files with DOC format)
-i “test \*.xls” (Only convert Office files with XLS 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)
If the input is a single Microsoft Office file, you should specify the output path of a PDF file. If the
input is a single folder, you should specify the output path of a folder. For example:
-o d:\output\ 1.pdf
-o d:\output
Note The specified output path must already exist.
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\2.pdf (“output \2.pdf” is in the current working folder)
-o output (“output” folder is in the current working folder)
Usage Examples
1) Convert Microsoft Office documents into PDF files:
foffice2pdf -i test\2.xls -o output\2.pdf
foffice2pdf -i c:\input -o d:\output
foffice2pdf -i “ c:\input\*.doc” -o d:\output
foffice2pdf -i test -o output
33
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
3.2.3.2 Bookmark
The optional argument (-b) is used to create bookmarks for the output PDF file. If not set, there are
no PDF bookmarks by default. For more details about this argument, please refer to section 3.2.2
“ Command Line Summary”.
Note This argument is valid only for Microsoft Word files.
Usage Example
1) Create PDF bookmarks using headings of a Microsoft Word file (-b 1)
foffice2pdf -i c:\input\1.doc -o d:\output\1.pdf -b 1
foffice2pdf -i c:\input -o d:\output -b 1
foffice2pdf -i test -o output -b 1
foffice2pdf -i “c: \input\*.doc” -o d:\output -b 1
2) Create PDF bookmarks using bookmarks of a Microsoft Word file (-b 2)
foffice2pdf -i c:\input\1.doc -o d:\output\1.pdf -b 2
foffice2pdf -i c:\input -o d:\output -b 2
foffice2pdf -i test -o output -b 2
foffice2pdf -i “c: \input\*.doc” -o d:\output -b 2
3.2.3.3 Scale
The optional argument (-scale) is used to specify the conversion mode for Microsoft Excel files. For
more details about this argument, please refer to section 3.2.2 “Command Line Summary ”.
Note This argument is supported only on versions higher than Microsoft Office 2007 and is valid only
for Microsoft Excel files.
Usage Example
1) Convert sheets at their actual size (-scale 0)
foffice2pdf -i c:\input\1.xlsx -o d:\output\1.pdf -scale 0
foffice2pdf -i c:\input -o d:\output -scale 0
foffice2pdf -i test -o output -scale 0
foffice2pdf -i “c: \input\*.xls” -o d:\output -scale 0
2) Fit all columns on one page (-scale 1)
34
www.foxitsoftware.com
foffice2pdf -i c:\input\1.xlsx -o d:\output\1.pdf -scale 1
foffice2pdf -i c:\input -o d:\output -scale 1
foffice2pdf -i test -o output -scale 1
foffice2pdf -i “c: \input\*.xls” -o d:\output -scale 1
3) Fit all rows on one page (-scale 2)
foffice2pdf -i c:\input\1.xlsx -o d:\output\1.pdf -scale 2
foffice2pdf -i c:\input -o d:\output -scale 2
foffice2pdf -i test -o output -scale 2
foffice2pdf -i “c: \input\*.xls” -o d:\output -scale 2
4) Fit sheet on one page (-scale 3)
foffice2pdf -i c:\input\1.xlsx -o d:\output\1.pdf -scale 3
foffice2pdf -i c:\input -o d:\output -scale 3
foffice2pdf -i test -o output -scale 3
foffice2pdf -i “c: \input\*.xls” -o d:\output -scale 3
Foxit PDF Toolkit User Manual
3.2.3.4 PDF/A Support
The optional argument (-pdfa) is used to specify the output PDF file to be compliant with the PDF/A
Standard. PDF/A is an ISO standardized version of the PDF, specialized for the digital preservation of
electronic documents defining provisions for long-term archiving.
Note It only supports PDF/A-1b Standard. For more details about PDF/A-1b, please refer to PDF
Reference.
Usage Example
1) Specify the output PDF file to be compliant with PDF/A Standard (-pdfa)
foffice2pdf -i c:\input\1.doc -o d:\output\1.pdf -pdfa
foffice2pdf -i c:\input -o d:\output -pdfa
foffice2pdf -i test -o output -pdfa
foffice2pdf -i “c: \input\*.doc” -o d:\output -pdfa
3.2.3.5 Open Password
The optional argument (-op) indicates the open password for a password-protected input Microsoft
Office file. It is not required if the input file is not password protected.
35
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Note The output PDF file will not retain the open password from the input file.
Usage Example
1) Specify the open password for a password-protected input Office file (-op 123)
foffice2pdf -i c:\input\1.doc -o d:\output\1.pdf -op 123
foffice2pdf -i test\2.xls -o output\2.pdf -op 123
2) Specify the open password for all input Office files that have been protected with the same password
(-op 123)
foffice2pdf -i c:\input -o d:\output -op 123
foffice2pdf -i test -o output -op 123
foffice2pdf -i “c: \input\*.doc” -o d:\output -op 123
Note It only supports typing one value for the argument (-op ). Only files with the same open
password can be processed together and files with different open password need to be processed
separately.
3.2.3.6 Recursion Depth of Sub-folders
The optional argument (-r) indicates the recursion depth of sub-folders, which is valid only when the
input is a folder or a path that includes wildcard character like “c:\input\*.doc”. By default, the
recursion depth is 1, so the sub-folders will not be processed. For more details about this argument,
please refer to section 3.2.2 “ Command Line Summary”.
Usage Examples
1) Search the full folders (-r or -r 0)
foffice2pdf -i c:\input -o d:\output -r
foffice2pdf -i test -o output -r
foffice2pdf -i “c: \input\*.doc” -o d:\output -r
foffice2pdf -i c:\input -o d:\output -r 0
foffice2pdf -i test -o output -r 0
foffice2pdf -i “c: \input\*.doc” -o d:\output -r 0
2) Search only the current folder (-r 1)
36
www.foxitsoftware.com
foffice2pdf -i c:\input -o d:\output -r 1
foffice2pdf -i test -o output -r 1
foffice2pdf -i “c: \input\*.doc” -o d:\output -r 1
Note If you don’t use this argument, the current folder will be searched by default. For example:
foffice2pdf -i c:\input -o d:\output
foffice2pdf -i test -o output
foffice2pdf -i “c: \input\*.doc” -o d:\output
3) Search the current folder and its sub-folders (-r 2)
foffice2pdf -i c:\input -o d:\output -r 2
foffice2pdf -i test -o output -r 2
foffice2pdf -i “c: \input\*.doc” -o d:\output -r 2
3.2.3.7 Multi-thread Support
Foxit PDF Toolkit User Manual
The optional argument (-t ) indicates the number of threads that are used to speed up batch
conversion by making full use of the CPU. By default, the number of threads is 1.
Note It is recommended that you set the value of the number according to your computer’s CPU
configuration.
Usage Example
1) Set the number of threads to 3 (-t 3)
foffice2pdf -i c:\input -o d:\output -t 3
foffice2pdf -i test -o output -t 3
foffice2pdf -i “c: \input\*.doc” -o d:\output -t 3
3.2.3.8 Other Optional Arguments
a) Log file (-log<logfile> -l<log level>)
The optional argument (-log) indicates the path of logfile, where the log message is placed. The
argument (-l ) indicates the log level. It is valid only when (-log ) is used. By default, the log level is 4.
For more details about this argument, please refer to section 3.2.2 “ Command Line Summary ”.
37
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Usage Example
1) Save the log file to “d:\output\office2pdf.log” and set the log level to 3 (-log d:\output\office2pdf.log
-l 3)
foffice2pdf -i c:\input\1.doc -o d:\output\1.pdf -log d:\output\office2pdf.log -l 3
b) Register information (-register <code> <licensee>)
The optional argument (-register) is used to register the command line tool. The <code> is the
activation code from Foxit and <licensee> is the licensee name designated by the users.
Usage Example
2) Register the office2pdf tool with the code “77505-010G0-G1000-XMQ8D-2CR7R-TPBEI” and the
licensee “Foxit ” (-register 77505-010G0-G1000-XMQ8D-2CR7R-TPBEI Foixt)
foffice2pdf -register 77505-010G0-G1000-XMQ8D-2CR7R-TPBEI Foixt
c) License agreement (-license)
The optional argument (-license) is used to print the license agreement.
Usage Example
1) Print the license information (-license)
foffice2pdf -license
d) Version information (-version/-v)
The optional argument (-version/-v) is used to print the version information.
Usage Example
1) Print the version information (-version/-v)
foffice2pdf -version
foffice2pdf -v
e) Help information (-help/-h)
38
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
The optional argument (-help/-h) is used to print the usage information.
Usage Example
1) Print the usage information (-help/-h)
foffice2pdf -help
foffice2pdf -h
39
Foxit PDF Toolkit User Manual
e.g.
-i c:\input\1.pdf
-i c:\input
Specifies the input file to be processed.
The input string can be the name of a single PDF
file or a folder.
The file name can contain the wildcard
character (*). For example, use *.pdf to include
all PDF files in a given folder.
Note Wildcard character (*.*) is currently not
supported.
www.foxitsoftware.com
3.3 PDFWatermark
3.3.1 Basic Syntax
fpdfwm <-i <srcfile/srcfolder>> <-o <destfile/destfolder>> <-conf <xmlfile>> [-op <password>]
[-title <title>] [-subject <subject>] [-keywords <keywords>] [-author <author>] [-creator <creator>]
[-r [recursion]] [-t <threads>] [-log <logfile>] [-l <level>]
fpdfwm -register <code> <licensee>
fpdfwm -license
fpdfwm -version/-v
fpdfwm -help/-h
Note:
<> required
[ ] optional
/ mutually exclusive
A space is needed between the command line argument and the value
Only the <-i <srcfile/srcfolder>>, <-o < destfile/destfolder>> and <-conf <xmlfile >> arguments are actually
required. All others are optional, which are available for controlling the process as desired. The arguments
could be given in any order. The XML file is a configuration file generated by the build-in Foxit Configuration
Tool. Full details on each are explained in the following section.
3.3.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.
40
www.foxitsoftware.com
e.g.
-o d:\output\1_wm.pdf
-o d:\output
Specifies the path of the output PDF file or folder.
If the input is a PDF file, the output should be a
single PDF file, (e.g. -o d:\output\1_wm.pdf).
If the input is a folder, the output should be a
folder, (e.g. -o d:\output ).
Note The specified output path must already exist.
e.g.
-conf c:\watermark.xml
Specifies the configuration file on the PDFWatermark
tool.
This file should be generated by the build-in Foxit
Configuration Tool.
Specifies the open password for the input file. Not
required if the input file is not password protected.
Note The output PDF file will retain the open
password from the input file.
e.g.
-title “Foxit PDF Toolkit
User Manual”
e.g.
-subject “Foxit PDF Toolkit”
Sets subject of PDF files.
Sets keywords of PDF files.
Sets author of PDF files.
Foxit PDF Toolkit User Manual
41
www.foxitsoftware.com
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”.
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 PDF file or folder will be skipped if it is
secured and the messages will be displayed.
Specifies the number of CPU threads to use.
Writes log information into a logfile at the specified
existing path.
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.
Foxit PDF Toolkit User Manual
42
www.foxitsoftware.com
-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 <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.
Prints the usage information.
Prints the version information.
Prints the license agreement.
Foxit PDF Toolkit User Manual
3.3.3 Basic Usage
3.3.3.1 Required Arguments
a) Input (-i)
The input file should be a single PDF file or a folder. Users are not able to input multiple PDF files or
folders, as well as a mixture composed of folders and PDF files. For example:
-i c:\input\1.pdf (a single PDF file)
-i c:\input (a single folder)
43
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
It supports relative paths if the input file is in the current working folder. Users can input just the
name of the PDF file or folder, instead of an absolute path. For example:
-i test\2.pdf (“test \2.pdf” 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 PDF files. For example:
-i “c: \input\*.pdf” (Only convert PDF files under “c:\input” folder)
-i “test \*.pdf” (Only convert PDF files under “test” folder)
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)
If the input is a single PDF file, you should specify the output path of a PDF file. If the input is a single
folder, you should specify the output path of a folder. For example:
-o d:\output\ 1_wm.pdf (a single PDF file)
-o d:\output (a single folder)
Note The specified output path must already exist.
The output supports relative path 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\2_wm.pdf (“output” folder is in the current working folder )
-o output (“output” folder is in the current working folder)
c) XML Configuration File (-conf)
The XML configuration file argument (-conf) is required in the command line. The configuration file
contains the setting information of watermark, which is generated by the build-in Foxit Configuration
Tool (fpdfwmconf.exe or fpdfwmconf64.exe). For more details about watermark settings, please
refer to section 4.1.1 “ Watermark Settings”. Users should input the path of an XML file. For example:
-conf c:\conf_wm.xml
44
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
It also supports relative paths if the specified XML configuration file is in the current working folder.
Users can input just the name of the XML file, instead of an absolute path. For example:
-conf conf_wm.xml (conf_wm.xml is in the current working folder)
Usage Examples
1) Add a watermark into PDF files:
fpdfwm -i test -o output -conf conf_wm.xml
fpdfwm -i “c: \input\*.pdf” -o d:\output -conf c:\conf_wm.xml
fpdfwm -i c:\input\1.pdf -o d:\output\1_wm.pdf -conf c:\conf_wm.xml
3.3.3.2 Open Password
The optional argument (-op) indicates the open password for a password-protected input PDF file. It
is not required if the input file is not password protected.
Note The output PDF file will retain the open password from the input file.
Usage Example
1) Specify the open password for a password-protected input PDF file (-op 123)
fpdfwm -i test\2.pdf -o output\2_wm.pdf -conf c:\conf_wm.xml -op 123
fpdfwm -i c:\input\1.pdf -o d:\output\1_wm.pdf -conf c:\conf_wm.xml -op 123
2) Specify the open password for all input PDF files that have been protected with the same password (-
op 123)
fpdfwm -i test -o output -conf conf_wm.xlm -op 123
fpdfwm -i c:\input -o d:\output -conf c:\conf_wm.xml -op 123
Note It only supports typing one value for the argument (-op ). Only files with the same open
password can be processed together and files with different open password need to be processed
separately.
3.3.3.3 Document Metadata Settings
a) Title (-title)
45
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
The optional argument (-title) is used to set title of PDF files.
Usage Example
1) Set document title to “Foxit PDF Toolkit User Manual” (-title “Foxit PDF Toolkit User Manual”)
fpdfwm -i test -o output -conf conf_wm.xml -title “Foxit PDF Toolkit User Manual”
fpdfwm -i “c: \input\*.pdf” -o d:\output -conf c:\conf_wm.xml -title “Foxit PDF Toolkit User Manual”
fpdfwm -i c:\input\1.pdf -o d:\output\1_wm.pdf -conf c:\conf_wm.xml -title “Foxit PDF Toolkit User
Manual”
b) Subject (-subject)
The optional argument (-subject) is used to set subject of PDF files.
Usage Example
1) Set document subject to “Foxit PDF Toolkit” (-subject “Foxit PDF Toolkit”)
fpdfwm -i test -o output -conf conf_wm.xml -subject “Foxit PDF Toolkit”
fpdfwm -i “c: \input\*.pdf” -o d:\output -conf c:\conf_wm.xml -subject “Foxit PDF Toolkit”
fpdfwm -i c:\input\1.pdf -o d:\output\1_wm.pdf -conf c:\conf_wm.xml -subject “Foxit PDF Toolkit”
c) Keywords (-keywords)
The optional argument (-keywords) is used to set keywords of PDF files.
Usage Example
1) Set document keywords to “toolkit” (-keywords “toolkit”)
fpdfwm -i test -o output -conf conf_wm.xml -keywords “toolkit”
fpdfwm -i “c: \input\*.pdf” -o d:\output -conf c:\conf_wm.xml -keywords “toolkit”
fpdfwm -i c:\input\1.pdf -o d:\output\1_wm.pdf -conf c:\conf_wm.xml -keywords “toolkit”
d) Author (-author)
The optional argument (-author) is used to set author of PDF files.
Usage Example
46
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
1) Set document author to “Jessie” (-author “Jessie”)
fpdfwm -i test -o output -conf conf_wm.xml -author “Jessie”
fpdfwm -i “c: \input\*.pdf” -o d:\output -conf c:\conf_wm.xml -author “Jessie”
fpdfwm -i c:\input\1.pdf -o d:\output\1_wm.pdf -conf c:\conf_wm.xml -author “Jessie”
e) Creator (-creator)
The optional argument (-creator) is used to set file creation application information of PDF files.
Usage Example
1) Set document creator to “Foxit Reader” (-creator “Foxit Reader”)
fpdfwm -i test -o output -conf conf_wm.xml -creator “Foxit Reader”
fpdfwm -i “c: \input\*.pdf” -o d:\output -conf c:\conf_wm.xml -creator “Foxit Reader”
fpdfwm -i c:\input\1.pdf -o d:\output\1_wm.pdf -conf c:\conf_wm.xml -creator “Foxit Reader”
3.3.3.4 Recursion Depth of Sub-folders
The optional argument (-r) indicates the recursion depth of sub-folders, which is valid only when the
input is a folder or a path that includes wildcard character like “c:\input\*.pdf”. By default, the
recursion depth is 1, so the sub-folders will not be processed. For more details about this argument,
please refer to section 3.3.2 “Command Line Summary”.
Usage Examples
1) Search the full folders (-r or -r 0)
fpdfwm -i test -o output -conf conf_wm.xml -r
fpdfwm -i c:\input -o d:\output -conf c:\conf_wm.xml -r
fpdfwm -i test -o output -conf conf_wm.xml -r 0
fpdfwm -i c:\input -o d:\output -conf c:\conf_wm.xml -r 0
2) Search only the current folder (-r 1)
fpdfwm -i test -o output -conf conf_wm.xml -r 1
fpdfwm -i c:\input -o d:\output -conf c:\conf_wm.xml -r 1
Note If you don’t use this argument, the current folder will be searched by default. For example:
47
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fpdfwm -i test -o output -conf conf_wm.xml
fpdfwm -i c:\input -o d:\output -conf c:\conf_wm.xml
3) Search the current folder and its sub-folders (-r 2)
fpdfwm -i test -o output -conf conf_wm.xml -r 2
fpdfwm -i c:\input -o d:\output -conf c:\conf_wm.xml -r 2
3.3.3.5 Multi-thread Support
The optional argument (-t) indicates the number of threads that are used to speed up batch
programming by making full use of the CPU. By default, the number of the threads is 1.
Note It is recommended that you set the value of the number according to your computer’s CPU
configuration.
Usage Example
1) Set the number of threads to 3 (-t 3)
fpdfwm -i test -o output -conf conf_wm.xml -t 3
fpdfwm -i c:\input -o d:\output -conf c:\conf_wm.xml -t 3
3.3.3.6 Other Optional Arguments
a) Log file (-log<logfile> -l<log level>)
The optional argument (-log) indicates the path of logfile, where the log message is placed. The
argument (-l ) indicates the log level. It is valid only when (-log ) is used. By default, the log level is 4.
For more details about this argument, please refer to section 3.3.2 “ Command Line Summary ”.
Usage Example
1) Save the log file to “d:\output\watermark.log” and set the log level to 3 (-log
d:\output\watermark.log -l 3)
fpdfwm -i c:\input -o d:\output -conf c:\conf_wm.xml -log d:\output\watermark.log -l 3
b) Register information (-register <code> <licensee>)
48
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
The optional argument (-register) is used to register the command line tool. The <code> is the
activation code from Foxit and <licensee> is the licensee name designated by the users.
Usage Example
3) Register the pdfwatermark tool with the code “77505-010G0-G1000-XMQ8D-2CR7R-TPBEI” and the
licensee “Foxit ” (-register 77505-010G0-G1000-XMQ8D-2CR7R-TPBEI Foixt)
fpdfwm -register 77505-010G0-G1000-XMQ8D-2CR7R-TPBEI Foixt
c) License agreement (-license)
The optional argument (-license) is used to print the license agreement.
Usage Example
1) Print the license information (-license)
fpdfwm -license
d) Version information (-version/-v)
The optional argument (-version/-v) is used to print the version information.
Usage Example
1) Print the version information (-version/-v)
fpdfwm -version
fpdfwm -v
e) Help information (-help/-h)
The optional argument (-help/-h) is used to print the usage information.
Usage Example
1) Print the usage information (-help/-h)
fpdfwm -help
fpdfwm -h
49
Foxit PDF Toolkit User Manual
e.g.
-i c:\input\1.pdf
-i c:\input
Specifies the input file to be processed.
The input string can be the name of a single PDF file
or a folder.
The file name can contain the wildcard character
(*). For example, use *.pdf to include all PDF files in
a given folder.
Note Wildcard character (*.*) is currently not supported.
www.foxitsoftware.com
3.4 PDFHeaderFooter
3.4.1 Basic Syntax
fpdfhf <-i <srcfile/srcfolder>> <-o <destfile/destfolder>> <-mode <operation mode>> [-conf <xmlfile>]
[-overlay] [-op <password>] [-title <title>] [-subject <subject>] [-keywords <keywords>]
[-author <author>] [-creator <creator>] [-r [recursion]] [-t <threads>] [-log <logfile>] [-l <level>]
fpdfhf -register <code> <licensee>
fpdfhf -license
fpdfhf -version/-v
fpdfhf -help/-h
Note:
<> required
[ ] optional
/ mutually exclusive
A space is needed between the command line argument and the value
Only the <-i <srcfile/srcfolder>>, <-o < destfile/destfolder>> and <-mode <operation mode >> arguments are
actually required. The argument [-conf <xmlfile>] is required only when “-mode” is set to 1 or 2. All others are
optional, which are available for controlling the process as desired. The arguments could be given in any
order. The XML file is a configuration file generated by the build-in Foxit Configuration Tool. Full details on
each are explained in the following section.
3.4.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.
50
www.foxitsoftware.com
e.g.
-o d:\ output\1_hf.pdf
-o d:\output
Specifies the path of the output PDF file or folder.
If the input is a PDF file, the output should be a
single PDF file, (e.g. -o d:\output\1_hf.pdf).
If the input is a folder, the output should be a
folder, (e.g. -o d:\output ).
Note The specified output path must already exist.
e.g.
-mode 1
-mode 2
-mode 3
Specifies the mode to be used.
-mode 1: adds a new header/footer.
An existing header/footer will be overlaid if the (-
overlay ) argument is set; otherwise, the
document will not be modified if a header/footer
already exists.
-mode 2: replaces an existing header/footer.
If none exists in the document, a new
header/footer will be added.
-mode 3: removes an existing header/footer.
If none exists in the document, the document will
not be modified.
e.g.
-conf c:\input\hf.xml
Specifies the configuration file on the PDFHeaderFooter
tool.
This file should be generated by the build-in Foxit
Configuration Tool.
Note This argument (-conf ) will only be used if (-mode ) is
set to 1 or 2.
Overlays an existing header/footer.
Note This argument ( -overlay) is valid only when ( -
mode) is set to 1.
Specifies the open password for the input file. Not
required if the input file is not password protected.
Note The output PDF file will retain the open password
from the input file.
Foxit PDF Toolkit User Manual
51
www.foxitsoftware.com
e.g.
-title “Foxit PDF Toolkit
User Manual”
e.g.
-subject “Foxit PDF Toolkit”
Sets subject of PDF files.
Sets keywords of PDF files.
Sets author of PDF files.
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”.
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 PDF file or folder will be skipped if it is
secured and the messages will be displayed.
Foxit PDF Toolkit User Manual
52
www.foxitsoftware.com
Specifies the number of CPU threads to use.
Writes log information into a logfile at the specified
existing path.
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 <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.
Prints the usage information.
Prints the version information.
Prints the license agreement.
Foxit PDF Toolkit User Manual
53
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
3.4.3 Basic Usage
3.4.3.1 Required Arguments
a) Input (-i)
The input file should be a single PDF file or a folder. Users are not able to input multiple PDF files or
folders, as well as a mixture composed of folders and PDF files. For example:
-i c:\input\1.pdf (a single PDF file)
-i c:\input (a single folder)
It supports relative paths if the input file is in the current working folder. Users can input just the
name of the PDF file or folder, instead of an absolute path. For example:
-i test\2.pdf (“test \2.pdf” 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 PDF files. For example:
-i “c: \input\*.pdf” (Only convert PDF files under “c:\input” folder)
-i “test \*.pdf” (Only convert PDF files under “test” folder)
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)
If the input is a single PDF file, you should specify the output path of a PDF file. If the input is a single
folder, you should specify the output path of a folder. For example:
-o d:\output\1_hf.pdf (a single PDF file)
-o d:\output (a single folder)
Note The specified output path must already exist.
The output 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:
54
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
-o output\1_hf.pdf (“output” folder is in the current working folder)
-o output (“output” folder is in the current working folder)
c) Operation Mode (-mode)
The operation mode argument (-mode) is required in the command line, which is used to specify the
mode to process header/footer. For more details about this argument, please refer to section 3.4.2
“ Command Line Summary”.
d) XML Configuration File (-conf)
The XML configuration file argument (-conf) is required in the command line when the argument ( -
mode) is set to 1 or 2. The configuration file contains the setting information of header/footer, which
is generated by the build-in Foxit Configuration Tool (fpdfhfconf.exe or fpdfhfconf64.exe). For more
details about header/footer settings, please refer to section 4.2.1 “ Header/Footer Settings”. Users
should input a path of an XML file. For example:
-conf c:\conf_hf.xml
It also supports relative paths if the specified XML configuration file is in the current working folder.
Users can input just the name of the XML file, instead of an absolute path. For example:
-conf conf_hf.xml (conf_hf.xml is in the current working folder)
Usage Examples
1) Add a new header/footer into PDF files (-mode 1 -conf conf_hf.xml )
fpdfhf -i c:\input\1.pdf -o d:\output\1_hf.pdf -mode 1 -conf c:\conf_hf.xml
fpdfhf -i “c :\input\*.pdf” -o d:\output -mode 1 -conf c:\conf_hf.xml
fpdfhf -i test -o output -mode 1 -conf conf_hf.xml
2) Replace the header/footer in PDF files (-mode 2 -conf conf_hf.xml )
fpdfhf -i c:\input\1.pdf -o d:\output\1_hf.pdf -mode 2 -conf c:\conf_hf.xml
fpdfhf -i “c: \input\*.pdf” -o d:\output -mode 2 -conf c:\conf_hf.xml
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml
3) Remove the header/footer in PDF files (-mode 3)
55
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fpdfhf -i c:\input\1.pdf -o d:\output\1_hf.pdf -mode 3
fpdfhf -i “c: \input\*.pdf” -o d:\output -mode 3
fpdfhf -i test -o output -mode 3
3.4.3.2 Overlay
The optional argument (-overlay) is used to overlay an existing header/footer in PDF file. It is valid
only when the argument (-mode) is set to 1 and the PDF file already contains a header/footer.
Usage Example
1) Overlay an existing header/footer in PDF file. (-overlay)
fpdfhf -i c:\input\1.pdf -o d:\output\1_hf.pdf -mode 1 -conf c:\conf_hf.xml -overlay
fpdfhf -i c:\input -o d:\output -mode 1 -conf c:\conf_hf.xml -overlay
fpdfhf -i test -o output -mode 1 -conf conf_hf.xml -overlay
3.4.3.3 Open Password
The optional argument (-op) indicates the open password for a password-protected input PDF file. It
is not required if the input file is not password protected.
Note The output PDF file will retain the open password from the input file.
Usage Example
1) Specify the open password for a password-protected input PDF file (-op 123)
fpdfhf -i c:\input\1.pdf -o d:\output\1_hf.pdf -mode 1 -conf c:\conf_hf.xml -op 123
fpdfhf -i test\2.pdf -o output\2_hf.pdf -mode 2 -conf conf_hf.xml -op 123
fpdfhf -i test\3.pdf -o output\3_hf.pdf -mode 3 -op 123
2) Specify the open password for all input PDF files that have been protected with the same password (-
op 123)
fpdfhf -i c:\input -o d:\output -mode 1 -conf c:\conf_hf.xml -op 123
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -op 123
fpdfhf -i test -o output -mode 3 -op 123
56
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Note It only supports typing one value for the argument (-op ). Only files with the same open
password can be processed together and files with different open password need to be processed
separately.
3.4.3.4 Document Metadata Settings
a) Title (-title)
The optional argument (-title) is used to set title of PDF files.
Usage Example
1) Set document title to “Foxit PDF Toolkit User Manual” (-title “Foxit PDF Toolkit User Manual”)
fpdfhf -i c:\input\1.pdf -o d:\output\1_hf.pdf -mode 3 -title “Foxit PDF Toolkit User Manual”
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -title “Foxit PDF Toolkit User Manual”
fpdfhf -i “c: \input\*.pdf” -o d:\output -mode 1 -conf c:\conf_hf.xml -title “Foxit PDF Toolkit User
Manual”
b) Subject (-subject)
The optional argument (-subject) is used to set subject of PDF files.
Usage Example
1) Set document subject to “Foxit PDF Toolkit” (-subject “Foxit PDF Toolkit”)
fpdfhf -i c:\input\1.pdf -o d:\output\1_hf.pdf -mode 3 -subject “Foxit PDF Toolkit”
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -subject “Foxit PDF Toolkit”
fpdfhf -i “c: \input\*.pdf” -o d:\output -mode 1 -conf c:\conf_hf.xml -subject “Foxit PDF Toolkit”
c) Keywords (-keywords)
The optional argument (-keywords) is used to set keywords of PDF files.
Usage Example
1) Set document keywords to “toolkit” (-keywords “toolkit”)
fpdfhf -i c:\input\1.pdf -o d:\output\1_hf.pdf -mode 3 -keywords “toolkit”
57
www.foxitsoftware.com
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -keywords “toolkit”
fpdfhf -i “c: \input\*.pdf” -o d:\output -mode 1 -conf c:\conf_hf.xml -keywords “toolkit”
d) Author (-author)
The optional argument (-author) is used to set author of PDF files.
Usage Example
1) Set document author to “Jessie” (-author “Jessie”)
fpdfhf -i c:\input\1.pdf -o d:\output\1_hf.pdf -mode 3 -author “Jessie”
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -author “Jessie”
fpdfhf -i “c: \input\*.pdf” -o d:\output -mode 1 -conf c:\conf_hf.xml -author “Jessie”
e) Creator (-creator)
Foxit PDF Toolkit User Manual
The optional argument (-creator ) is used to set file creation application information of PDF files.
Usage Example
1) Set document creator to “Foxit Reader” (-creator “Foxit Reader”)
fpdfhf -i c:\input\1.pdf -o d:\output\1_hf.pdf -mode 3 -creator “Foxit Reader”
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -creator “Foxit Reader”
fpdfhf -i “c: \input\*.pdf” -o d:\output -mode 1 -conf c:\conf_hf.xml -creator “Foxit Reader”
3.4.3.5 Recursion Depth of Sub-folders
The optional argument (-r) indicates the recursion depth of sub-folders, which is valid only when the
input is a folder or a path that includes wildcard character like “c:\input\*.pdf”. By default, the
recursion depth is 1, so the sub-folders will not be processed. For more details about this argument,
please refer to section 3.4.2 “Command Line Summary”.
Usage Examples
1) Search the full folders (-r or -r 0)
fpdfhf -i c:\input -o d:\output -mode 1 -conf c:\conf_hf.xml -r
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -r
58
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fpdfhf -i test -o output -mode 3 -r
fpdfhf -i c:\input -o d:\output -mode 1 -conf c:\conf_hf.xml -r 0
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -r 0
fpdfhf -i test -o output -mode 3 -r 0
2) Search only the current folder (-r 1)
fpdfhf -i c:\input -o d:\output -mode 1 -conf c:\conf_hf.xml -r 1
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -r 1
fpdfhf -i test -o output -mode 3 -r 1
Note If you don’t use this argument, the current folder will be searched by default. For example:
fpdfhf -i c:\input -o d:\output -mode 1 -conf c:\conf_hf.xml
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml
fpdfhf -i test -o output -mode 3
3) Search the current folder and its sub-folders (-r 2)
fpdfhf -i c:\input -o d:\output -mode 1 -conf c:\conf_hf.xml -r 2
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -r 2
fpdfhf -i test -o output -mode 3 -r 2
3.4.3.6 Multi-thread Support
The optional argument (-t) indicates the number of threads that are used to speed up batch
programming by making full use of the CPU. By default, the number of the threads is 1.
Note It is recommended that you set the value of the number according to your computer’s CPU
configuration.
Usage Example
1) Set the number of threads to 3 (-t 3)
fpdfhf -i c:\input -o d:\output -mode 1 -conf c:\conf_hf.xml -t 3
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -t 3
fpdfhf -i test -o output -mode 3 -t 3
59
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
3.4.3.7 Other Optional Arguments
a) Log file (-log<logfile> -l<log level>)
The optional argument (-log) indicates the path of logfile, where the log message is placed. The
argument (-l ) indicates the log level. It is valid only when (-log ) is used. By default, the log level is 4.
For more details about this argument, please refer to section 3.4.2 “ Command Line Summary ”.
Usage Example
1) Save the log file to “d: \output\hf.log” and set the log level to 3 (-log d:\output\hf.log -l 3)
fpdfhf -i c:\input -o d:\output -mode 1 -conf c:\conf_hf.xml -log d:\output\hf.log -l 3
fpdfhf -i test -o output -mode 2 -conf conf_hf.xml -log d:\output\hf.log -l 3
fpdfhf -i test -o output -mode 3 -log d:\output\hf.log -l 3
b) Register information (-register <code> <licensee>)
The optional argument (-register) is used to register the command line tool. The <code> is the
activation code from Foxit and <licensee> is the licensee name designated by the users.
Usage Example
4) Register the pdfheaderfooter tool with the code “77505-010G0-G1000-XMQ8D-2CR7R-TPBEI” and
the licensee “Foxit ” (-register 77505-010G0-G1000-XMQ8D-2CR7R-TPBEI Foixt)
fpdfhf -register 77505-010G0-G1000-XMQ8D-2CR7R-TPBEI Foixt
c) License agreement (-license)
The optional argument (-license) is used to print the license agreement.
Usage Example
1) Print the license information (-license)
fpdfhf -license
d) Version information (-version/-v)
The optional argument (-version/-v) is used to print the version information.
60
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Usage Example
1) Print the version information (-version/-v)
fpdfhf -version
fpdfhf -v
e) Help information (-help/-h)
The optional argument (-help/-h) is used to print the usage information.
Usage Example
1) Print the usage information (-help/-h)
fpdfhf -help
fpdfhf -h
61
Foxit PDF Toolkit User Manual
e.g.
-i C:\input\1.pdf
-i c:\input
Specifies the input file to be optimized.
The input string can be the name of a single PDF
file or a folder.
The file name can contain the wildcard
character (*). For example, use *.pdf to include
all PDF files in a given folder.
Note Wildcard character (*.*) is currently not
supported.
www.foxitsoftware.com
3.5 PDFOptimizer
3.5.1 Basic Syntax
fpdfopt <-i <srcfile/srcfolder>> <-o <destfile/destfolder>> [-dc <algorithm> [DPIAbove] [DPISet]]
[-cc <algorithm> <level> [blocksize]] [-dm <algorithm> [DPIAbove] [DPISet]] [-cm <algorithm> [level]]
[-rd] [-u] [-d <intlist>] [-cl <intlist>] [-op <password>]
[-r [recursion]] [-t <thread>] [-log <logfile>] [-l <level>]
fpdfopt -register <code> <licensee>
fpdfopt -license
fpdfopt -version/-v
fpdfopt -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.5.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.
62
www.foxitsoftware.com
e.g.
-o D:\output\1_opt.pdf
-o D:\output
Specifies the path of the output PDF file or folder.
If the input is a PDF file, the output should be a
single PDF file, (e.g. -o D:\output\1_opt.pdf).
If the input is a folder, the output should be a
folder, (e.g. -o D:\output ).
Note The specified output path must already exist.
[-dc <string> [integer]
[integer]]
-dc <algorithm> [DPIAbove]
[DPISet]
e.g.
-dc a 225 150
-dc s 225 150
-dc b 225 150
-dc a
-dc s
-dc b
Downsamples color/grayscale images.
<algorithm> : Chooses downsampling
algorithms
a: Average Downsampling
s: SubSampling
b: Bicubic Downsampling
[DPIAbove]: DPI threshold value. Images with a
DPI higher than this value will be downsampled.
Default value: 225. Allowable range: DPISet-
DPISet*10
[DPISet ]: Target DPI value images will be
downsampled to if their DPI is above the
threshold. Default value: 150. Allowable range:
9-2400.
Note
The DPIAbove and DPISet must be set at the
same time.
If the argument (-dc ) is not set, images will not
be downsampled.
[-cc <string> <string>
[integer]]
-cc <algorithm> <level>
[blocksize]
e.g.
-cc j min
-cc j low
-cc j medium
-cc j high
-cc j max
Compresses color/grayscale images.
<algorithm>: Chooses compression algorithm.
j: JPEG
j2: JPEG2000
<level>: Chooses quality level. Allowable levels
are min, low, medium, high and max.
[blocksize ]: Chooses block size for JPEG2000
algorithm only. Default value: 256. Allowable
values: 128-2048.
Foxit PDF Toolkit User Manual
63
www.foxitsoftware.com
-cc j2 low 256
-cc j2 medium 256
-cc j2 high 256
-cc j2 max 256
Note If the argument (-cc ) is not set, images will not
be compressed.
[-dm <string> [integer]
[integer]]
-dm <algorithm>
[DPIAbove] [DPISet]
e.g.
-dm a 450 300
-dm s 450 300
-dm b 450 300
-dm a
-dm s
-dm b
Downsamples monochrome images.
<algorithm> : Chooses downsampling
algorithms
a: Average Downsampling
s: SubSampling
b: Bicubic Downsampling
[DPIAbove]: DPI threshold value. Images with a
DPI higher than this value will be downsampled.
Default value: 450. Allowable range: DPISet-
DPISet*10
[DPISet ]: Target DPI value images will be
downsampled to if their DPI is above the
threshold. Default value: 300. Allowable range:
9-2400.
Note
The DPIAbove and DPISet must be set at the
same time.
If the argument (-dm ) is not set, images will not
be downsampled.
-cm <algorithm> [level]
e.g.
-cm jbig2 lossless
-cm jbig2 lossy
-cm ccitt
-cm runlength
Compresses monochrome images.
<algorithm>: Chooses compression algorithm.
jbig2: JBIG2
ccitt: CCITT Group 4
runlength: RUN LENGTH
[level]: Chooses quality level for JBIG2 algorithm
only. Allowable levels are lossless and lossy.
Note If the argument (-cm ) is not set, images will not
be compressed.
If this flag is set, images will be optimized only if
there is a reduction in size.
Foxit PDF Toolkit User Manual
64
www.foxitsoftware.com
Unembeds all fonts in selected PDF document(s).
-d <intlist>
e.g.
-d “1”
-d “1,3,11”
-d “2 -11”
Discards objects and user data:
1: discards all form submission, import and
reset actions.
2: flattens form fields.
3: discards all JavaScript actions.
4: discards embedded page thumbnails.
5: discards embedded print settings.
6: discards bookmarks.
7: discards all comments, forms and
multimedia.
8: discards external cross references.
9: discards document information and
metadata.
10: discards file attachments.
11: discards private data of other applications.
Note The <intlist> should be entered in the format
“ 1,3,11” or “ 2-11” without any spaces.
-cl <intlist>
e.g.
-cl “1”
-cl “1,3,4”
-cl “1 -4”
Clears up the streams, bookmarks or links.
1: Use Flate to encode streams that are not
encoded.
2: In streams that use LZW encoding, use Flate
instead.
3: Remove invalid bookmarks.
4: Remove invalid links.
Note The <intlist> should be entered in the format
“ 1,2,3,4” or “ 1-4” without any spaces.
Specifies the open password for the input file. Not
required if the input file is not password protected.
Note The output PDF file will retain the open
password from the input file.
Foxit PDF Toolkit User Manual
65
www.foxitsoftware.com
e.g.
-title “Foxit PDF Toolkit
User Manual”
e.g.
-subject “Foxit PDF Toolkit”
Sets subject of PDF files.
Sets keywords of PDF files.
Sets author of PDF files.
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”.
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 PDF file or folder will be skipped if it is
secured and the messages will be displayed.
Foxit PDF Toolkit User Manual
66
www.foxitsoftware.com
Specifies the number of CPU threads to use.
Writes log information into a logfile at the specified
existing path.
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 <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.
Prints the usage information.
Prints the version information.
Prints the license agreement.
Foxit PDF Toolkit User Manual
67
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
3.5.3 Basic Usage
3.5.3.1 Input and Output
a) Input (-i)
The input file should be a single PDF file or a folder. Users are not able to input multiple PDF files or
folders, as well as a mixture composed of folders and PDF files. For example:
-i c:\input\1.pdf (a single PDF file)
-i c:\input (a single folder)
It supports relative paths if the input file is in the current working folder. Users can input just the
name of the PDF file or folder, instead of an absolute path. For example:
-i test\2.pdf (“test \2.pdf” 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 PDF files. For example:
-i “c: \input\*.pdf” (Only convert PDF files under “c:\input” folder)
-i “test \*.pdf” (Only convert PDF files under “test” folder)
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)
If the input is a single PDF file, you should specify the output path of a PDF file. If the input is a single
folder, you should specify the output path of a folder. For example:
-o d:\output\1_opt.pdf (a single PDF file)
-o d:\output (a single folder)
Note The specified output path must already exist.
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:
68
-o output\2_opt.pdf (“output” folder is in the current working folder)
-o output (“output” folder is in the current working folder)
Usage Examples
1) Optimize a single PDF file:
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf
2) Optimize PDF files in a folder:
fpdfopt -i test -o output
fpdfopt -i c:\input -o d:\output
fpdfopt -i “c: \input\*.pdf” -o d:\output
3.5.3.2 PDF/Page Settings
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
a) Color/grayscale images Downsampling (-dc)
The optional argument (-dc) is used to downsample color/grayscale images in the input PDF file. By
default, images will not be downsampled. For more details about this argument, please refer to
section 3.5.2 “ Command Line Summary”.
Usage Example
1) Downsample all color/grayscale images with an original resolution higher than 300 dpi to a new
resolution of 100 dpi using the Average Downsampling algorithm (-dc a 300 100)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -dc a 300 100
fpdfopt -i test -o output -dc a 300 100
fpdfopt -i c:\input -o d:\output -dc a 300 100
2) Downsample all color/grayscale images with an original resolution higher than 225 dpi to a new
resolution of 150 dpi using the Bicubic Downsampling algorithm (-dc b, 225 and 150 are the default
values)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -dc b
fpdfopt -i test -o output -dc b
fpdfopt -i c:\input -o d:\output -dc b
69
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
b) Color/grayscale images Compression (-cc)
The optional argument (-cc) is used to compress color/grayscale images in the input PDF files with
JPEG or JPEG2000 algorithm. For more details about this argument, please refer to section 3.5.2
“ Command Line Summary” .
Usage Example
1) Compress color/grayscale images with medium quality JEPG (-cc j medium)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -cc j medium
fpdfopt -i test -o output -cc j medium
fpdfopt -i c:\input -o d:\output -cc j medium
2) Compress color/grayscale images with maximum quality JEPG2000 (-cc j2 max)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -cc j2 max
fpdfopt -i test -o output -cc j2 max
fpdfopt -i c:\input -o d:\output -cc j2 max
c) Monochrome images Downsampling (-dm)
The optional argument (-dm) is used to downsample monochrome images in the input PDF file. By
default, images will not be downsampled. For more details about this argument, please refer to
section 3.5.2 “ Command Line Summary”.
Usage Example
1) Downsample all monochrome images with an original resolution higher than 300 dpi to a new
resolution of 100 dpi using the Average Downsampling algorithm (-dm a 300 100)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -dm a 300 100
fpdfopt -i test -o output -dm a 300 100
fpdfopt -i c:\input -o d:\output -dm a 300 100
2) Downsample all monochrome images with an original resolution higher than 450 dpi to a new
resolution of 300 dpi using the Bicubic Downsampling algorithm (-dm b, 450 and 300 are the default
values)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -dm b
70
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fpdfopt -i test -o output -dm b
fpdfopt -i c:\input -o d:\output -dm b
d) Monochrome images Compression (-cm)
The optional argument (-cm) is used to compress monochrome images in the input PDF file with
JBIG2, CCITT Group 4, or Run Length algorithm. For more details about this argument, please refer to
section 3.5.2 “ Command Line Summary”.
Usage Example
1) Compress monochrome images with lossless quality JBIG2 (-cm jbig2 lossless)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -cm jbig2 lossless
fpdfopt -i test -o output -cm jbig2 lossless
fpdfopt -i c:\input -o d:\output -cm jbig2 lossless
2) Compress monochrome images with Run Length (-cm runlength)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -cm runlength
fpdfopt -i test -o output -cm runlength
fpdfopt -i c:\input -o d:\output -cm runlength
e) Reduction (-rd)
The optional argument (-rd) is used to optimize images only if there is a reduction in size.
Usage Example
1) Optimize images only if there is a reduction in size (-rd)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -rd
fpdfopt -i test -o output -rd
fpdfopt -i c:\input -o d:\output -rd
f) Unembedded fonts (-u)
The optional argument (-u) is used to unembed all fonts in selected PDF documents.
Usage Example
71
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
1) Unembed all fonts in selected PDF documents (-u)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -u
fpdfopt -i test -o output -u
fpdfopt -i c:\input -o d:\output -u
g) Objects and user data Discard (-d)
The optional argument (-d) is used to discard objects and user data in PDF files. For more details
about this argument, please refer to section 3.5.2 “ Command Line Summary”.
Usage Example
1) Discard all form submission, import and reset actions (-d “1”)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -d “1”
fpdfopt -i test -o output -d “1”
fpdfopt -i c:\input -o d:\output -d “1”
2) Flatten form fields, discard all JavaScript actions and discard bookmarks (-d “2,3,6”)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -d “2,3,6”
fpdfopt -i test -o output -d “2,3,6”
fpdfopt -i c:\input -o d:\output -d “2,3,6”
h) Clear up (-cl)
The optional argument (-cl) is used to clear up stream, bookmarks, or links. For more details about
this argument, please refer to section 3.5.2 “ Command Line Summary”.
Usage Example
1) Use Flate to encode streams that are not encoded, and remove invalid bookmarks (-cl “1,3”)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -cl “1,3”
fpdfopt -i test -o output -cl “1,3”
fpdfopt -i c:\input -o d:\output -cl “1,3”
i) Open Password (-op)
72
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
The optional argument (-op ) indicates the open password for a password-protected input PDF file. It
is not required if the input file is not password protected.
Note The output PDF file will retain the open password from the input file.
Usage Example
1) Specify the open password for a password-protected input PDF file (-op 123)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -op 123
fpdfopt -i test\2.pdf -o output\2_opt.pdf -op 123
2) Specify the open password for all input PDF files that have been protected with the same password (-
op 123)
fpdfopt -i c:\input -o d:\output -op 123
fpdfopt -i test -o output -op 123
Note It only supports typing one value for the argument (-op ). Only files with the same open
password can be processed together and files with different open password need to be processed
separately.
3.5.3.3 Document Metadata Settings
a) Title (-title)
The optional argument (-title) is used to set title of PDF files.
Usage Example
1) Set document title to “Foxit PDF Toolkit User Manual” (-title “Foxit PDF Toolkit User Manual”)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -title “Foxit PDF Toolkit User Manual”
fpdfopt -i test -o output -title “Foxit PDF Toolkit User Manual”
fpdfopt -i “c: \input\*.pdf” -o d:\output -title “Foxit PDF Toolkit User Manual”
b) Subject (-subject)
The optional argument (-subject) is used to set subject of PDF files.
73
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Usage Example
1) Set document subject to “Foxit PDF Toolkit” (-subject “Foxit PDF Toolkit”)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -subject “Foxit PDF Toolkit”
fpdfopt -i test -o output -subject “Foxit PDF Toolkit”
fpdfopt -i “c: \input\*.pdf” -o d:\output -subject “Foxit PDF Toolkit”
c) Keywords (-keywords)
The optional argument (-keywords) is used to set keywords of PDF files.
Usage Example
1) Set document keywords to “toolkit” (-keywords “toolkit”)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -keywords “toolkit”
fpdfopt -i test -o output -keywords “toolkit”
fpdfopt -i “c: \input\*.pdf” -o d:\output -keywords “toolkit”
d) Author (-author)
The optional argument (-author) is used to set author of PDF files.
Usage Example
1) Set document author to “Jessie” (-author “Jessie”)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -author “Jessie”
fpdfopt -i test -o output -author “Jessie”
fpdfopt -i “c: \input\*.pdf” -o d:\output -author “Jessie”
e) Creator (-creator)
The optional argument (-creator) is used to set file creation application information of PDF files.
Usage Example
1) Set document creator to “Foxit Reader” (-creator “Foxit Reader”)
fpdfopt -i c:\input\1.pdf -o d:\output\1_opt.pdf -creator “Foxit Reader”
74
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fpdfopt -i test -o output -creator “Foxit Reader”
fpdfopt -i “c: \input\*.pdf” -o d:\output -creator “Foxit Reader”
3.5.3.4 Recursion Depth of Sub-folders
The optional argument (-r) indicates the recursion depth of sub-folders, which is valid only when the
input is a folder or a path that includes wildcard character like “c: \input\*.pdf”. By default, the
recursion depth is 1, so the sub-folders will not be processed. For more details about this argument,
please refer to section 3.5.2 “ Command Line Summary”.
Usage Examples
1) Search the full folders (-r or -r 0)
fpdfopt -i test -o output -r
fpdfopt -i c:\input -o d:\output -r
fpdfopt -i test -o output -r 0
fpdfopt -i c:\input -o d:\output -r 0
2) Search only the current folder (-r 1)
fpdfopt -i test -o output -r 1
fpdfopt -i c:\input -o d:\output -r 1
Note If you don’t use this argument, the current folder will be searched by default. For example:
fpdfopt -i test -o output
fpdfopt -i c:\input -o d:\output
3) Search the current folder and its sub-folders (-r 2)
fpdfopt -i test -o output -r 2
fpdfopt -i c:\input -o d:\output -r 2
3.5.3.5 Multi-thread Support
The optional argument (-t) indicates the number of threads that are used to speed up batch
optimization by making full use of the CPU. By default, the number of the threads is 1.
75
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Note It is recommended that you set the value of the number according to your computer’s CPU
configuration.
Usage Example
1) Set the number of threads to 3 (-t 3)
fpdfopt -i test -o output -t 3
fpdfopt -i c:\input -o d:\output -t 3
3.5.3.6 Other Optional Arguments
a) Log file (-log<logfile> -l<log level>)
The optional argument (-log) indicates the path of logfile, where the log message is placed. The
argument (-l ) indicates the log level. It is valid only when (-log ) is used. By default, the log level is 4.
For more details about this argument, please refer to section 3.5.2 “ Command Line Summary ”.
Usage Example
1) Save the log file to “d: \output\pdfoptimizer.log” and set the log level to 3 (-log
d:\output\pdfoptimizer.log -l 3)
fpdfopt -i c:\input -o d:\output -log d:\output\pdfoptimizer.log -l 3
b) Register information (-register <code> <licensee>)
The optional argument (-register) is used to register the command line tool. The <code> is the
activation code from Foxit and <licensee> is the licensee name designated by the users.
Usage Example
5) Reg ister the pdfoptimizer tool with the code “77505-010G0-G1000-XMQ8D-2CR7R-TPBEI” and the
licensee “Foxit ” (-register 77505-010G0-G1000-XMQ8D-2CR7R-TPBEI Foixt)
fpdfopt -register 77505-010G0-G1000-XMQ8D-2CR7R-TPBEI Foixt
c) License agreement (-license)
The optional argument (-license) is used to print the license agreement.
76
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Usage Example
1) Print the license information (-license)
fpdfopt -license
d) Version information (-version/-v)
The optional argument (-version/-v) is used to print the version information.
Usage Example
1) Print the version information (-version/-v)
fpdfopt -version
fpdfopt -v
e) Help information (-help/-h)
The optional argument (-help/-h) is used to print the usage information.
Usage Example
1) Print the usage information (-help/-h)
fpdfopt -help
fpdfopt -h
77
Foxit PDF Toolkit User Manual
e.g.
-i c:\input\1.pdf
-i c:\input
-i “c: \input\*.pdf”
Specifies the input file to be redacted.
The input string can be the name of a single
PDF file or a folder.
The file name can contain the wildcard
character (*). For example, use *.pdf to
www.foxitsoftware.com
3.6 PDFRedactor
3.6.1 Basic Syntax
fpdfredact <-i <srcfile/srcfolder>> <-o <destfile/destfolder>> <-mode <operation mode>>
<-keyword <searchword>/<<pattern> <country>>>
[-character <singlepos>/<<startpos> <endpos>>] [-range <page range>] [-markcolor <R> <G> <B>]
[-tx <text>] [-ta <alignment>] [-font <fontname>] [-fs <fontsize>] [-fontcolor <R> <G> <B>] [-form]
[-op <password>] [-title <title>] [-subject <subject>] [-keywords <keywords>] [-author <author>]
[-creator <creator>] [-r [recursion]] [-t <thread>] [-log <logfile>] [-l <level>]
fpdfredact -register <code> <licensee>
fpdfredact -license
fpdfredact -version/-v
fpdfredact -help/-h
Note:
<> required
[ ] optional
/ mutually exclusive
A space is needed between the command line argument and the value
Only the <-i <srcfile/srcfolder>>, <-o < destfile/destfolder>>, <-mode <operation mode>> and <-keyword
<searchword>/<<pattern> <country>>> arguments are actually required. All others are optional, which are
available for controlling the process as desired. The arguments could be given in any order. Full details on
each are explained in the following section.
3.6.2 Command Line Summary
Note For some arguments whose values are strings, users can choose whether to add quotation marks (“ ”). In
the manual we have added notes where adding quotation marks (“ ”) is required.
78
www.foxitsoftware.com
include all PDF files in a given folder.
Note Wildcard character (*.*) is currently not
supported.
e.g.
-o d:\output\1_reda.pdf
-o d:\output
Specifies the path of the output PDF file or folder.
If the input is a PDF file, the output should be
a single PDF file, ( e.g. -o
d:\output\1_reda.pdf).
If the input is a folder, the output should be a
folder, (e.g. -o d:\output ).
Note The specified output path must already exist.
Specifies the mode of the keyword to be searched.
-mode 1: sets the mode of the keyword to
a word or phrase.
-mode 2: sets the mode of the keyword to
a pattern.
<-keyword <string>/<<integer>
<integer>>>
<-keyword <word/phrase> /
<<pattern> <country>>>
e.g.
-keyword “Foxit”
-keyword “Foxit PDF Toolkit”
-keyword 1 1
-keyword 1 2
-keyword 2 3
-keyword 3 4
-keyword 4 5
-keyword 5 8
-keyword 5 10
…
Specifies the search keyword. There are two types
of keyword and the “-mode ” argument determines
which one to use.
-keyword <word/phrase> is used when -
mode 1 is set. And <word/phrase> is a string
with quotation marks.
-keyword <pattern> <country> is used when -
mode 2 is set.
<pattern> value could be:
1: Phone Number
2: Date
3: Social Security Number
4: Email Address
5: Credit Card Number
<country> value could be:
1: EN_US
2: China
3: China_TW&HK
4: French
5: German
Foxit PDF Toolkit User Manual
79
www.foxitsoftware.com
7: Korean
8: Brazil
9: Spain
10: Turkey
Note If the keyword contains special characters
like quotation marks and slashes, you should add
the escape character (\) before them.
[-character <integer>/<<integer>
<integer>>]
-character <singlepos>/
<<startpos> <endpos>>
e.g.
-character 3
-character 1 4
Specifies the characters of the keyword you want
to redact. By default, all the characters of the
keyword will be redacted.
-character <singlepos>: redacts only the
singlepos character of the keyword.
For example,
-character 3 : redacts only the third character
of the keyword.
-character <startpos> <endpos>: redacts the
characters of the keyword in the range from
startpos to endpos .
For example,
-character 1 4 : redacts the first character to
the fourth character of the keyword.
e.g.
-range “1,5,9”
-range “all”
-range “even”
-range “odd”
-range “2 -10,30”
-range “10,50 -”
-range “odd,100 -”
Specifies a page range to apply redaction. By
default, all of the pages will apply redaction.
Applies redaction to pages 1,5, and 9:
-range “1,5,9”
Applies redaction to all of the pages:
-range “all”
Applies redaction to all even pages:
-range “even”
Applies redaction to all odd pages:
-range “odd”
Applies redaction to pages in the range from
2-10 and page 30:
Foxit PDF Toolkit User Manual
80
www.foxitsoftware.com
Applies redaction to page 10 and all pages in
the range from 50 to the last page:
-range “10,50 -”
Applies redaction to all odd pages and all
pages in the range from 100 to the last page:
-range “odd,100 -”
[-markcolor <integer> <integer>
<integer>]
-markcolor <R> <G> <B>
e.g.
-markcolor 0 0 0
-markcolor 255 255 0
-markcolor 255 255 255
…
Specifies the fill color used to mark for redaction
with the RGB color model. By default, the fill color
is black. Allowable range of the values for each
RGB component is 0-255.
-tx <text>
e.g.
-tx “secret”
Overlays redaction marks with the specified text.
Note If the keyword contains special characters
like quotation marks and slashes, you should add
the escape character (\) before them.
-ta <alignment>
e.g.
-ta 1
-ta 2
-ta 3
Sets the alignment of the text designated by the -
tx option. The default value is 1.
-ta 1: aligns the text left.
-ta 2: aligns the text center.
-ta 3: aligns the text right.
Note The (-ta ) is valid only when (-tx ) is used.
-font <fontname>
e.g.
-font “Calibri”
-font “Helvetica”
-font “Arial”
…
Sets the font style of the text designated by the -tx
option.
Note
The font style should be installed in a local
environment, otherwise the default font style
will be used.
The (-font ) is valid only when ( -tx) is used.
Foxit PDF Toolkit User Manual
81
www.foxitsoftware.com
-fs <fontsize>
e.g.
-fs 8
-fs 11
-fs 72
Sets the font size of the text designated by the -tx
option. Default value: 9. Allowable range: 8-72.
Note The (-fs ) is valid only when ( -tx ) is used.
[-fontcolor <integer> <integer>
<integer>]
-fontcolor <R> <G> <B>
e.g.
-fontcolor 0 0 0
-fontcolor 255 255 0
-fontcolor 255 255 255
…
Specifies the font color of the text designated by
the -tx option with the RGB color model. By
default, the font color is green.
Allowable range of the values for each RGB
component is 0-255.
Note The (-fontcolor ) is valid only when (-tx ) is
used.
If this argument is set, both PDF forms and main
body of text will be searched for the specified
keyword, otherwise only main body of text will be
searched.
Note If the keyword in the PDF form is generated
by JavaScript, it will not be searched.
Specifies the open password for the input file. Not
required if the input file is not password protected.
Note The output PDF file will retain the open
password from the input file.
e.g.
-title “Foxit PDF Toolkit User
Manual”
e.g.
-subject “Foxit PDF Toolkit”
Sets subject of PDF files.
Sets keywords of PDF files.
Foxit PDF Toolkit User Manual
82
www.foxitsoftware.com
Sets author of PDF files.
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”.
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 PDF file or folder will be skipped if it
is secured and the messages will be displayed.
Specifies the number of CPU threads to use.
Writes log information into a logfile at the
specified existing path.
Sets the log level. The default is 4.
-l 1: logs messages only concerning program
Foxit PDF Toolkit User Manual
83
www.foxitsoftware.com
-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 <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.
Prints the usage information.
Prints the version information.
Prints the license agreement.
Foxit PDF Toolkit User Manual
3.6.3 Basic Usage
3.6.3.1 Required Arguments
a) Input (-i)
The input file should be a single PDF file or a folder. Users are not able to input multiple PDF files or
folders, as well as a mixture composed of folders and PDF files. For example:
-i c:\input\1.pdf (a single PDF file)
84
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
-i c:\input (a single folder)
It supports relative paths if the input file is in the current working folder. Users can input just the
name of the PDF file or folder, instead of an absolute path. For example:
-i test\2.pdf (“test \2.pdf” is in the current working folder )
-i test (“test” fo lder is in the current working folder)
It also supports wildcard characters, which are used to process multiple PDF files. For example:
-i “c: \input\*.pdf” (Only convert PDF files under “c:\input” folder)
-i “test \*.pdf” (Only convert PDF files under “test” folder)
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)
If the input is a single PDF file, you should specify the output path of a PDF file. If the input is a single
folder, you should specify the output path of a folder. For example:
-o d:\output\1_reda.pdf (a single PDF file)
-o d:\output (a single folder)
Note The specified output path must already exist.
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 output PDF file or folder, instead of an absolute path. For
example:
-o output\2_reda.pdf (“output” folder is in the current working folder)
-o output (“output” folder is in the current working folder)
c) Operation Mode (-mode)
The operation mode argument (-mode) is required in the command line for specifying the mode of
the keyword to be searched. There are two types of keywords: one is a word or phrase, and the
other is a pattern. For example,
85
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
-mode 1 (keyword is a word or phrase)
-mode 2 (keyword is a pattern)
d) Search Keyword (-keyword)
The search keyword argument (-keyword) is required in the command line and its value is
dependent on the setting of the argument (-mode ). For more details about this argument, please
refer to 3.6.2 “ Command Line Summary ”. The -mode and -keyword arguments are grouped together.
For example,
-mode 1 -keyword “Foxit”
-mode 1 -keyword “Foxit Software”
-mode 2 -keyword 1 2
-mode 2 -keyword 2 8
Usage Examples
1) Redact(Remove) the sensitive content “Foxit” from PDF file(s):
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 1 -keyword “Foxit”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit”
fpdfredact -i test -o output -mode 1 -keyword “Foxit”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 1 -keyword “Foxit”
2) Redact(Remove) the sensitive content “Phone Number” pattern in “En_US” country from PDF file(s):
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 2 -keyword 1 1
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1
fpdfredact -i c:\input -o d:\output -mode 2 -keyword 1 1
fpdfredact -i test -o output -mode 2 -keyword 1 1
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 1 1
3.6.3.2 Redaction Settings
a) Redaction range of the Keyword (-character)
The optional argument (-character) is used to specify the characters of the keyword you want to
redact. If this argument is not set, all the characters of the keyword will be redacted by default. For
more details about this argument, please refer to section 3.6.2 “Command Line Summary”.
86
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Usage Example
1) Redact only the third character of the keyword (-character 3)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -character 3
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -character 3
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -character 3
fpdfredact -i test -o output -mode 2 -keyword 1 1 -character 3
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -character 3
2) Redacts the first character to the fourth character of the keyword (-character 1 4)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -character 1 4
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -character 1 4
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -character 1 4
fpdfredact -i test -o output -mode 2 -keyword 1 1 -character 1 4
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -character 1 4
b) Page range to apply redaction (-range)
The optional argument (-range) is used to specify a page range to apply redaction. If this argument is
not set, all of the pages will apply redaction. For more details about this argument, please refer to
section 3.6.2 “ Command Line Summary”.
Usage Example
1) Apply redaction to pages 2,3 and 8 (-range “2,3,8”)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -range “2,3,8”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -range “2,3,8”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -range “2,3,8”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -range “2,3,8”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -range “2,3,8”
2) Apply redaction to all even pages (-range “even”)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -range “even”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -range “even”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -range “even”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -range “even”
87
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -range “even”
3) Apply redaction to pages in the range from 2-10 and page 30 (-range “2 -10,30”)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -range “2-10,30”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -range “2 -10,30”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -range “2-10,30”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -range “2 -10,30”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -range “2-10,30”
4) Apply redaction to all odd pages and all pages in the range from 100 to the last page (-range
“odd,100 -”)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -range “odd,100-”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -range “odd,100 -”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -range “odd,100-”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -range “odd,100-”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -range “odd,100 -”
c) Fill color for redaction marks (-markcolor)
The optional argument (-markcolor) is used to specify the fill color used to mark for redaction with
the RGB color model. If this argument is not set, the fill color is black by default. The allowable range
of the values for each RGB component is from 0 to 255.
Usage Example
1) Set the fill color to blue for the redaction marks (-markcolor 0 0 255)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -markcolor 0 0 255
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -markcolor 0 0 255
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -markcolor 0 0 255
fpdfredact -i test -o output -mode 2 -keyword 1 1 -markcolor 0 0 255
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -markcolor 0 0 255
d) Overlay text (-tx)
The optional argument (-tx) is used to add overlay text to redaction marks. Overlay text appears on
top of redaction marks, which is useful for sensitive content that needs to be removed after
redaction. Users can specify custom text to appear over the redaction marks.
88
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Usage Example
1) Use overlay text “secret” to appear on sensitive text “Foxit” selected for redaction (-tx “secret”)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -tx “secret”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -tx “secret”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -tx “secret”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -tx “secret”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -tx “secret”
e) Text alignment (-ta)
The optional argument (-ta) is used to set alignment of the overlay text designated by the -tx option.
It is valid only when ( -tx) is used. The default value is 1, which will be left aligned.
Usage Example
1) Align the text to the left (-ta 1)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -tx “secret” -ta 1
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -tx “secret” -ta 1
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -tx “secret” -ta 1
fpdfredact -i test -o output -mode 2 -keyword 1 1 -tx “secret” -ta 1
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -tx “secret” -ta 1
2) Align the text to the center (-ta 2)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -tx “secret” -ta 2
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -tx “secret” -ta 2
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -tx “secret” -ta 2
fpdfredact -i test -o output -mode 2 -keyword 1 1 -tx “secret” -ta 2
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -tx “secret” -ta 2
3) Align the text to the right (-ta 3)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -tx “secret” -ta 3
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -tx “secret” -ta 3
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -tx “secret” -ta 3
fpdfredact -i test -o output -mode 2 -keyword 1 1 -tx “secret” -ta 3
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -tx “secret” -ta 3
89
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
f) Text font (-font)
The optional argument (-font) is used to set the font style of the overlay text designated by the -tx
option. It is valid only when (-tx) is used.
Note The font style should be installed in a local environment, otherwise the default font style will be
used.
Usage Example
1) Set the font of the overlay text to “Calibri” (-font “Calibri”)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -tx “secret” -font
“Calibri”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -tx “secret” -font “Calibri”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -tx “secret” -font “Calibri”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -tx “secret” -font “Calibri”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -tx “secret” -font “Calibri”
g) Text font size (-fs)
The optional argument (-fs ) is used to set the font size of the overlay text designated by the -tx
option. It is valid only when (-tx) is used. The default value is set to 9, and the allowable range is from
8 to 72.
Usage Example
1) Set the font size of the overlay text to 12 (-fs 12)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -tx “secret” -fs 12
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -tx “secret” -fs 12
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -tx “secret” -fs 12
fpdfredact -i test -o output -mode 2 -keyword 1 1 -tx “secret” -fs 12
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -tx “secret” -fs 12
h) Text font color (-fontcolor)
The optional argument (-fontcolor) is used to set the font color of the overlay text designated by the
-tx option with the RGB color model. It is valid only when (-tx) is used. By default, the font color is
green. The allowable range of the values for each RGB component is from 0 to 255.
90
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
Usage Example
1) Set the font color of the overlay text to yellow (-fontcolor 255 255 0)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -tx “xx” -fontcolor 255
255 0
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -tx “xx” -fontcolor 255 255 0
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -tx “xx” -fontcolor 255 255 0
fpdfredact -i test -o output -mode 2 -keyword 1 1 -tx “xx” -fontcolor 255 255 0
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -tx “xx” -fontcolor 255 255 0
i) Form (-form)
The optional argument (-form) is used to search the specified keyword in both PDF forms and the
main body of text. If this argument is not set, only main body of text will be searched.
Note If the keyword in the PDF form is generated by JavaScript, it will not be searched.
Usage Example
1) Search the specified keyword in both PDF forms and the main body of text (-form)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -form
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -form
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -form
fpdfredact -i test -o output -mode 2 -keyword 1 1 -form
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -form
3.6.3.3 Open Password
The optional argument (-op) indicates the open password for a password-protected input PDF file. It
is not required if the input file is not password protected.
Note The output PDF file will retain the open password from the input file.
Usage Example
1) Specify the open password for a password-protected input PDF file (-op 123)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -op 123
91
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -op 123
2) Specify the open password for all input PDF files that have been protected with the same password (-
op 123)
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit” -op 123
fpdfredact -i test -o output -mode 2 -keyword 1 1 -op 123
Note It only supports typing one value for the argument (-op ). Only files with the same open
password can be processed together and files with different open password need to be processed
separately.
3.6.3.4 Document Metadata Settings
a) Title (-title)
The optional argument (-title) is used to set title of PDF files.
Usage Example
1) Set document title to “Foxit PDF Toolkit User Manual” (-title “Foxit PDF Toolkit User Manual”)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -title “Foxit PDF
Toolkit User Manual”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -title “Foxit PDF Toolkit User
Manual”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -title “Foxit PDF Toolkit User
Manual”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -title “Foxit PDF Toolkit User Manual”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -title “Foxit PDF Toolkit User
Manual”
b) Subject (-subject)
The optional argument (-subject) is used to set subject of PDF files.
Usage Example
1) Set document subject to “Foxit PDF Toolkit” (-subject “Foxit PDF Toolkit”)
92
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 - keyword “Foxit” -subject “Foxit PDF
Toolkit”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -subject “Foxit PDF Toolkit”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -subject “Foxit PDF Toolkit”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -subject “Foxit PDF Toolkit”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -subject “Foxit PDF Toolkit”
c) Keywords (-keywords)
The optional argument (-keywords) is used to set keywords of PDF files.
Usage Example
1) Set document keywords to “toolkit” (-keywords “toolkit”)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -keywords “toolkit”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -keywords “toolkit”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -keywords “toolkit”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -keywords “toolkit”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -keywords “toolkit”
d) Author (-author)
The optional argument (-author) is used to set author of PDF files.
Usage Example
1) Set document author to “Jessie” ( -author “Jessie”)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -author “Jessie”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -author “Jessie”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -author “Jessie”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -author “Jessie”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -author “Jessie”
e) Creator (-creator)
The optional argument (-creator) is used to set file creation application information of PDF files.
Usage Example
93
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
1) Set document creator to “Foxit Reader” (-creator “Foxit Reader”)
fpdfredact -i c:\input\1.pdf -o d:\output\1_reda.pdf -mode 1 -keyword “Foxit” -creator “Foxit Reader”
fpdfredact -i test\2.pdf -o output\2_reda.pdf -mode 2 -keyword 1 1 -creator “Foxit Reader”
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit Software” -creator “Foxit Reader”
fpdfredact -i test -o output -mode 2 -keyword 1 1 -creator “Foxit Reader”
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 2 6 -creator “Foxit Reader”
3.6.3.5 Recursion Depth of Sub-folders
The optional argument (-r) indicates the recursion depth of sub-folders, which is valid only when the
input is a folder or a path that includes wildcard character like “c:\input\*.pdf”. By default, the
recursion depth is 1, so the sub-folders will not be processed. For more details about this argument,
please refer to section 3.6.2 “Command Line Summary”.
Usage Examples
1) Search the full folders (-r or -r 0)
fpdfredact -i test -o output -mode 1 -keyword “Foxit” -r
fpdfredact -i c:\input -o d:\output -mode 2 -keyword 2 5 -r
fpdfredact -i c:\input\*.pdf -o d:\output -mode 2 -keyword 3 6 -r
fpdfredact -i test -o output -mode 1 -keyword “Foxit” -r 0
fpdfredact -i c:\input -o d:\output -mode 2 -keyword 2 5 -r 0
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 3 6 -r 0
2) Search only the current folder (-r 1)
fpdfredact -i test -o output -mode 1 -keyword “Foxit” -r 1
fpdfredact -i c:\input -o d:\output -mode 2 -keyword 2 5 -r 1
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 3 6 -r 1
Note If you don’t use this argument, the current folder will be searched by default. For example:
fpdfredact -i test -o output -mode 1 -keyword “Foxit”
fpdfredact -i c:\input -o d:\output -mode 2 -keyword 2 5
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 3 6
3) Search the current folder and its sub-folders (-r 2)
94
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
fpdfredact -i test -o output -mode 1 -keyword “Foxit” -r 2
fpdfredact -i c:\input -o d:\output -mode 2 -keyword 2 5 -r 2
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 3 6 -r 2
3.6.3.6 Multi-thread Support
The optional argument (-t) indicates the number of threads that are used to speed up batch
programming by making full use of the CPU. By default, the number of threads is 1.
Note It is recommended that you set the value of the number according to your computer’s CPU
configuration.
Usage Example
1) Set the number of threads to 3 (-t 3)
fpdfredact -i test -o output -mode 1 -keyword “Foxit” -t 3
fpdfredact -i c:\input -o d:\output -mode 2 -keyword 2 5 -t 3
fpdfredact -i “c: \input\*.pdf” -o d:\output -mode 2 -keyword 3 6 -t 3
3.6.3.7 Other Optional Arguments
a) Log file (-log<logfile> -l<log level>)
The optional argument (-log) indicates the path of logfile, where the log message is placed. The
argument (-l ) indicates the log level. It is valid only when (-log ) is used. By default, the log level is 4.
For more details about this argument, please refer to section 3.6.2 “ Command Line Summary ”.
Usage Example
1) Save the log file to “d:\output\pdfredactor.log” and set the log level to 3 (-log
d:\output\pdfredactor.log -l 3)
fpdfredact -i c:\input -o d:\output -mode 1 -keyword “Foxit” -log d:\output\pdfredactor.log -l 3
b) Register information (-register <code> <licensee>)
The optional argument (-register) is used to register the command line tool. The <code> is the
activation code from Foxit and the <licensee> is the licensee name designated by the users.
95