14–2 Macro Text

With "-setTextWatermark" (text watermark) and "-writeText" (text addition), you can use "macro text" to replace execution date of the Command-line application, file names, page numbers, etc.

For details on associated command, see;

Macro Text
Content
#DATE()
Execution date and time.
Sets the following date characters between "#DATE(" and ")". Other macro text between this is invalid. All characters other than date characters are output as is.

[date character]

YYYY or yyyy
A.D.

MM or mm
Month (2-digit display)

M or m
Month

DD or dd
Day (2-digit display)

D or d
Day
#PAGE_NUM
Page number
#TOTAL_PAGES
Total number of pages
#FILE_NAME
File name
#FULL_PATH
Full pathname of the file
#TITLE
Document information: Title
#SUB_TITLE
Document information: Subtitle
#AUTHOR
Document information: Author

14–2–1 #DATE() replacement example

In case of May 31, 2021,

14–2–2 Example of commands

[Executing example commands]

Insert the text "What day is it today? [#Date]" as a text watermark on all pages of test.pdf and output it as out.pdf.

[Windows]

AHPDFToolCmd80.exe -setTextWatermark -text "What day is it today? ~#DATE(YYYY/M/D)" -colorText 1 0 0 -diagonal -font -name Meiryo -size 52 -d C:\test\test.pdf -o C:\sav\out.pdf

[Linux]

AHPDFToolCmd80 -setTextWatermark -text "What day is it today? ~#DATE(YYYY/M/D)" -colorText 1 0 0 -diagonal -font -name ipa-gothic -size 52 -d /home/antenna/test/test.pdf -o /home/antenna/sav/out.pdf