13–21 -addPageNumber: Adding Page Number
13–21–1 Processing
Inserts page numbers into the input PDF.
- -index allows you to specify from which page the page number should begin to be inserted.
- This page setting is done with 0 origin. Therefore, the first page is counted from "0."
- Page numbers will be inserted for all pages after the specified page.
- You can specify from which page numbers to start counting. For the remaining pages, the page number with +1 added to the previous page number will be automatically inserted.
- You can specify the font, color, and transparency of the page number text. Specify the insertion position from 9 predetermined positions.
13–21–2 Example of commands
[Executing example commands]
Inserts the page number into test.pdf and output it as out.pdf.
- Inserts the page number with the following settings:
- Page to start inserting: 1st page (unspecified)
- Starting number: The first page is page number "11"
- Placement: Bottom right of the page
- Text color: {R,G,B} = {0.0, 0.0, 1.0}
[Windows]
AHPDFToolCmd80.exe -addPageNumber -startNumber 11 -align 9 -colorText 0.0 0.0 1.0 -d C:\test\test.pdf -o C:\sav\out.pdf
[Linux]
AHPDFToolCmd80 -addPageNumber -startNumber 11 -align 9 -colorText 0.0 0.0 1.0 -d /home/antenna/test/test.pdf -o /home/antenna/sav/out.pdf
13–21–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, page numbers will be inserted into 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.
13–21–4 Parameters
Parameter
| Content
|
---|
-index Val
| Sets the page position to start inserting page numbers. Can be omitted. Page number is 0 origin. Therefore, the first page is counted from "0." If not specified, "0" is applied.
|
-startNumber Val
| Sets the starting page number to insert. Can be omitted. If not specified, "1" is applied.
|
-align Val
| Sets the page number insertion position. Can be omitted. 1: Top left 2: Top center 3: Top right 4: Center left 5: Center 6: Center right 7: Bottom left 8: Bottom center 9: Bottom right If not specified, places at "8: Bottom center." If a value other than 1 to 9 is specified, an error will occur.
|
-font
| Sets the font(*). Can be omitted.
|
| -name Val
| Sets the font name. Can be omitted. If not specified, "Helvetica" is applied.
|
| -size Val
| Sets the font size. Can be omitted. Unit: point If not specified, 12 point is applied.
|
| -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 text upright.
|
| -notEmbed
| If specified, does not embed fonts. If not specified, embeds fonts.
|
-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) is applied.
|
-colorOutline r g b
| Sets the color of the text outline. 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) is applied.
|
-opacity Val
| Sets the transparency of the text. Can be omitted. Setting value range: 0.0 to 1.0. 0.0 are transparent, 1.0 is opaque. If not specified, 1.0 (opaque) is applied.
|
(*) For information on obtaining font information and restrictions on the Antenna House PDF API Command-line, see "Chapter 5: Handling Fonts" and "Chapter 8: Restrictions - Font Restrictions" in this manual.