35
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
77
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 characters like “c:\input\*.pdf”. y 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.
37
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
78
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)
Register the pdfoptimizer tool with the code “77505-010G0-G1000-XMQ8D-2CR7R-TP EI” 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.
25
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
79
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
52
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
80
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.
Option
Parameter
Description
-i
<-i <string>>
e.g.
-i c:\input\1.pdf
df
-i c:\input
-i “c:\input\*.pdf”
f”
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
84
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
81
Option
Parameter
Description
include all PDF files in a given folder.
Note Wildcard character (*.*) is currently not
supported.
-o
<-o <string>>
>
e.g.
-o d:\output\1_reda.pdf
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
o
d:\output\1_reda.pdf).
).
If the input is a folder, the output should be a
folder, (e.g. -o d:\output).
t).
Note The specified output path must already exist.
-mode
<-mode <integer>>
e.g.
-mode 1
-mode 2
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
<-keyword <string>/<<integer>
ger>
<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
s
which one to use.
-keyword <word/phrase> is used when -
-
mode 1 is set. And <word/phrase> is a string
ing
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
66
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
82
Option
Parameter
Description
6: Japan
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 [-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
r
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.
-range
-rang <String>
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:
76
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
83
Option
Parameter
Description
-range “2-10,30”
”
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 [-markcolor <integer> <integer>
r>
<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
[-tx <string>]
-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
[-ta <integer>]
-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.
used.
-font
[-font <string>]
-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 you set should be installed on a
a
local environment, otherwise the default font
style will be used.
The (-font) is valid only when (-tx) is used.
sed.
66
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
84
Option
Parameter
Description
-fs
[-fs <integer>]
-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.
used.
-fontcolor [-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
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
) is
used.
-form
[-form]
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.
-op
[-op<string>]
]
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.
-title
<-title <string>>
>
e.g.
-title “Foxit PDF Toolkit User
Manual”
Sets title of PDF files.
-subject
<-subject <string>>
e.g.
-subject “Foxit PDF Toolkit”
Sets subject of PDF files.
-keywords [-keywords <string>]
e.g.
-keywords “Foxit”
Sets keywords of PDF files.
75
Foxit PDF Toolkit User Manual
www.foxitsoftware.com
85
Option
Parameter
Description
-author
[-author <string>]
e.g.
-author “Jessie”
Sets author of PDF files.
-creator
[-creator <string>]
e.g.
-creator “Foxit PhantomPDF”
-creator “Foxit Reader”
-creator “Microsoft® Word 2013”
Sets creator of PDF files.
Note It indicates the name of the application that
created the source document from which a PDF is
generated. For example, if the source document
was created from Microsoft® Word 2013, then you
can set the creator to “Microsoft® Word 2013”.
-r
[-r [integer]]
e.g.
-r
-r 0
-r 1
-r 2
…
Specifies the number of layers to recurse when the
input is a folder.
-r 0 <-r>: searches the full folders.
s.
-r 1: searches only the current folder.
-r 2: searches the current folder and its
ts
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.
-t
[-t <integer>]
e.g.
-t 1
-t 2
Specifies the number of CPU threads to use.
The default value is 1.
-log
[-log <string>]
e.g.
-log d:\a.log
Writes log information into a logfile at the
specified existing path.
-l
[-l <integer>]
e.g.
Sets the log level. The default is 4.
-l 1: logs messages only concerning program
ram
Documents you may be interested
Documents you may be interested