Inserts a string as a watermark.
Inserts the string "Antenna House PDF API V8.0 Test" as a text watermark on all pages of test.pdf and outputs it as out.pdf.
AHPDFToolCmd80.exe -setTextWatermark -text "Antenna House PDF API V8.0 Test" -colorText 1.0 0.0 0.0 -angle 20 -align 5 -opacity 0.9 -font -name Meiryo -size 52 -d C:\test\test.pdf -o C:\sav\out.pdf
AHPDFToolCmd80 -setTextWatermark -text "Antenna House PDF API V8.0 Test" -colorText 1.0 0.0 0.0 -angle 20 -align 5 -opacity 0.9 -font -name ipa-gothic -size 52 -d /home/antenna/test/test.pdf -o /home/antenna/sav/out.pdf
You can perform batch processing by specifying the input folder to the -d parameter and the output folder to the -o parameter.
If a folder is specified, the text will be inserted as a watermark to the PDF files in the input folder. Note that the output file will be output to the output folder with the same name as the input file name.
|
Parameter |
Content |
|
|
-text <Val> |
[Required] Sets the text to be inserted as a watermark. Macro text can also be used for text. For details, see "14-2 Macro Text" in this manual. |
|
|
-colorText <r> <g> <b> |
Sets the fill color of the text. Can be omitted. Setting value range: <r>, <g>, <b> 0.0 to 1.0 for each If not specified, black (0.0 0.0 0.0) |
|
|
-colorOutline <r> <g> <b> [*1] |
Sets the color of the outline of the text. Can be omitted. Setting value range: <r>, <g>, <b> 0.0 to 1.0 for each If not specified, black (0.0 0.0 0.0) [* Cannot be used with "-acrobat".] |
|
|
-diagonal [*1] |
If specified, insert the watermark diagonally across the page. Invalid when - tiling is set. [* Cannot be used with "-acrobat".] |
|
|
-angle <Val> |
Sets the watermark insertion angle. Counterclockwise is a positive value. Can be omitted. If not specified, 0.0 (horizontal). Invalid when -diagonal is set. |
|
|
-rect <left> <bottom> <right> <top> [*1] |
Specifies the rectangle in which the watermark will be placed (in mm). Can be omitted. Each element is specified by a distance with the bottom left as (0, 0). If not specified, it is considered the page size rectangle. Note: [* Cannot be used with "-acrobat".] |
|
|
-margin <top> <left> <bottom> <right> [*1] |
Sets the margin (in mm) when placing the watermark. Can be omitted. Each element is specified by a distance with the bottom left as (0, 0). Note: [* Cannot be used with "-acrobat".] |
|
|
-align {1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9} |
Sets the watermark placement location. If not specified, place at "5: Center." 1: Top left 2: Top center 3: Top right If a value other than 1 to 9 is specified, an error will occur. |
|
|
-zorder {1 | 2} |
Sets the watermark Z-order. Can be omitted. 1: Front 2: Background |
|
|
-pageRange {0 | 1 | 2 | 3 | 4 | 5} |
Sets the page range where the watermark will be inserted. Can be omitted. 0: All pages 1: First page only 2: Last page only If not specified, inserts it into "0: All pages." |
|
|
-pageRangeCustom <Val> [*2] |
[If -pageRange 5 is specified: Setting required] Specifies the page number or page range where you want to insert the watermark. Page number is 0 origin. Therefore, the first page is counted from "0." If specifying multiple names, separate them with commas. [* Cannot be used with "-acrobat" when specifying multiple ranges.] |
|
|
-notInFirst |
If specified, no watermark will be inserted on the first page. If specified at the same time as -pageRange 1, an error will occur. |
|
|
-notInLast |
If specified, no watermark will be inserted on the last page. If specified at the same time as -pageRange 2, an error will occur. |
|
|
-notDisplay |
If specified, a watermark will not be displayed. |
|
|
-notPrint |
If specified, the watermark will not be printed. |
|
|
-opacity <Val> |
Sets the watermark transparency. Can be omitted. Setting value range: 0.0 to 1.0. If not specified, it is considered 1.0 (opaque). |
|
|
-tiling [*1] |
If specified, a tiling watermark will be inserted. When -rect is specified, tiling is performed within rect. [* Cannot be used with "-acrobat".] |
|
|
-acrobat |
Can be omitted. An error occurs if this is specified simultaneously with a parameter marked [*1], or if it matches the condition [*2]. |
|
|
-font |
[Required for Linux] Sets the font of the watermark text.[*3] |
|
|
-name <Val> |
[Required for Linux] Font name. If omitted on Windows, "MS-Gothic" will be set in Japanese environments, "Arial" will be set in other environments. |
|
|
-size <Val> |
font size. Can be omitted. Unit: point If not specified, 24.0 points |
|
|
-bold |
If specified, makes the text bold. If not specified, does not make the text bold. |
|
|
-italic |
If specified, makes the text italic. If not specified, makes the string upright. |
|
|
-embed {true | false} |
Font embedding. true: Embedded If not specified, "true: Embedded" |
|
[*1]:
An error occurs if this is specified simultaneously with "-acrobat". PDF API's unique watermark parameters.
[*2]:
An error occurs if specifying multiple ranges separated by commas with "-pageRangeCustom", and specifying it simultaneously with "-acrobat".
[*3]:
See "Chapter.5 Handling Fonts" and "8-5 Font Limitations" for font information and restrictions on Antenna House PDF API Command-line.