13–10 -setColorWatermark: Inserting Color Watermark

13–10–1 Processing

Inserts a color watermark that fills with the specified color.

13–10–2 Example of commands

[Executing example commands]

Inserts a color watermark on pages other than the first page of test.pdf and outputs it as out.pdf.

[Windows]

AHPDFToolCmd80.exe -setColorWatermark -color 0.0 1.0 0.0 -notInFirst -notPrint -opacity 0.7 -d C:\test\test.pdf -o C:\sav\out.pdf

[Linux]

AHPDFToolCmd80 -setColorWatermark -color 0.0 1.0 0.0 -notInFirst -notPrint -opacity 0.7 -d /home/antenna/test/test.pdf -o /home/antenna/sav/out.pdf

13–10–3 Folder settings: applied

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, a color watermark will be inserted into the PDF file 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.

13–10–4 Parameters

Parameter
Content
-color r g b
[Required]
Sets the color to insert.
Setting value range: r, g, b 0.0 to 1.0 for each
-rect left bottom right top
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: You cannot specify a value larger than right for left. You cannot specify a value greater than top for bottom. If either of these is violated, an error will occur.
-margin top left bottom right
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: You cannot specify a value larger than right for left. You cannot specify a value greater than top for bottom. If either of these is violated, an error will occur.
-zorder Val
Sets the watermark Z-order. Can be omitted.
1: Front 2: Background
If not specified, places it in "1: Front." If a value other than 1 or 2 is specified, an error will occur.
-pageRange Val
Sets the page range where the watermark will be inserted. Can be omitted.
0: All pages
1: First page only 2: Last page only
3: Odd numbered pages 4: Even numbered pages
5: Specified page
If not specified, inserts it into "0: All pages."
If a value other than 1 to 5 is specified, an error will occur.
If you specify 1 and -notInFirst, 2 and -notInLast, an error will occur.
If you specify -pageRange 5, -pageRangeCustom must be specified.
-pageRangeCustom Val
[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.
Example) -pageRangeCustom "0,2-4"
Inserted on page 1 and pages 3 to 5.
-notInFirst
If specified, no watermark will be inserted on the first page.
If not specified, a watermark can 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 not specified, a watermark can 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.
If not specified, a watermark will be displayed.
-notPrint
If specified, the watermark will not be printed.
If not specified, the watermark will be printed.
-opacity Val
Sets the watermark transparency. Can be omitted.
Setting value range: 0.0 to 1.0. 0.0 is transparent, 1.0 is opaque. If not specified, it is considered 1.0 (opaque).