Miscellaneous
Copy()
This function creates a copy of an existing file attachment. The default name for the target file is %FileBaseName%.copy.%FileExt%.
Examples
Copy("test.pdf") creates a copy of a PDF file attachment named test.copy.pdf .
Copy("test.pdf", "copy of %FileName%") creates a copy of a PDF file attachment named copy of test.pdf.
DecryptPdf()
This function removes the password protection of a PDF file that is provided with open protection or special authorizations. The default name for the target file is %FileBaseName%.decrypted.pdf.
Parameter | Data Type | Description |
|---|---|---|
1 | Text | |
2 | Text | |
3*(§) | Text | Password to remove the password protection |
Examples
DecryptPdf("test.pdf", , "<§>…<§>") creates a decrypted copy test.decrypted.pdf from a PDF file attachment.
DrawTextPdf()
This function adds a text fragment to one or more pages of a PDF file. The default name for the target file is %FileBaseName%.drawnText.pdf.
Parameter | Data Type | Description |
|---|---|---|
1 | Text | |
2 | Text | |
3* | Text | Text value that is placed on the PDF page |
4* 5* | Number | X position (left margin) and Y position (baseline) of the text in millimeters, measured from the top left edge of the page |
6 | Text | Name of an internal font with the following options:
If a different name is specified, an attempt will be made to include the font as a TrueType font available on the system. |
7 | Number | Font size in points Default value: |
8 | Bool | Boolean value determining whether the text is bold Default value: |
9 | Text | Color of the text as hexadecimal RGB value (e.g., Default value: |
10 | Number | Rotation angle of the text Default value: |
11 | Text | Definition of the pages on which the text is placed:
|
Examples
DrawTextPdf("test.pdf", , "TEST", 10, 10, "Times", 12, TRUE, "FF0000", , "All") places the text TEST in red bold font in the upper left corner of all pages of a PDF file attachment and appends the modified attachment as test.drawnText.pdf.
DeleteBlankPages()
This function deletes all blank pages from a multi-page TIFF file. In principle, the macro can also handle PDF files, but is not primarily designed for native PDF files. The function is specialized for embedded image files (e.g., to delete blank back pages from a scanned document.) The default name for the target file is %FileBaseName%.pagesDeleted.%FileExt%.
Parameter | Data Type | Description |
|---|---|---|
1 | Text | |
2 | Text | |
3 | Text | In percent, the threshold value that white pages need in order for them to be considered blank Shadowing due to side edges and perforations is implicitly filtered and does not have to be taken into account. Default value: |
Examples
DeletePages("test.pdf", , "1-3") deletes the first 3 pages from a PDF file attachment and adds the modified attachment as test.pagesDeleted.pdf.
DeletePages()
This function deletes certain pages from a multi-page TIFF or PDF file. The default name for the target file is FileBaseName%.pagesDeleted.%FileExt%.
Parameter | Data Type | Description |
|---|---|---|
1 | Text | |
2 | Text | |
3* | Text | Definition of the pages that are deleted:
|
Examples
DeletePages("test.pdf", , "1-3") deletes the first 3 pages from a PDF file attachment and adds the modified attachment as test.pagesDeleted.pdf.
EncryptPDF()
This function provides a PDF file with password protection for opening or assigning special authorizations. The default name for the target file is %FileBaseName%.encrypted.pdf.
Parameter | Data Type | Description |
|---|---|---|
1 | Text | |
2 | Text | |
3(§) | Text | Password for setting authorizations for opening a document |
4(§) | Text | Password for setting special authorizations |
5 | Text | Special authorizations that are set with the relevant password The authorizations are to be specified in the form of a separator-separated string of the IDs per authorization:
|
Examples
EncryptPdf("test.pdf", , "<§>…<§>") adds open protection to a PDF file attachment and appends the modified attachment as test.encrypted.pdf.
EncryptPdf("test.pdf", "%FileBaseName%.restricted.pdf", , "<§>…<§>", "P PF FF") restricts the permissions of a PDF file attachment to printing and form fields and adds the modified attachment as test.restricted.pdf.
Rename()
This function renames an existing file attachment. Deviating from the standard behavior of a file macro, no new target file is generated in this case; only the name of the source file is changed to the name defined in the second default parameter.
The default value for the new name is %FileName% (i.e., the unchanged original name).
Parameter | Data Type | Description |
|---|---|---|
1 | Text | |
2 | Text | |
3 | Text | Field macro expression for generating the new file name (optional) The expression must return a text value with a valid file name. The name defined in the second default parameter of the file macro (default: |
Examples
Rename("test.pdf", "%FileBaseName%.renamed.%FileExt%") renames a PDF file attachment to test.renamed.pdf.
Rename("test-file #1.pdf", , RegExReplace(@FileName, "[^A-Z0-9]")) renames a PDF file attachment to testfile1.pdf.
RotatePagesAuto()
This function attempts to automatically recognize the orientation of the pages in a TIFF file and rotate the pages in 90° steps to align the pages straight.
In principle, the macro can also handle PDF files, but is not primarily designed for native PDF files. The function specializes in embedded image files (e.g., to correctly align pages scanned in portrait format as landscape format). The orientation is not determined using the corresponding PDF page property, but by an OCR-based analysis of the page content. The default name for the target file is %FileBaseName%.rotated.%FileExt%.
Parameter | Data Type | Description |
|---|---|---|
1 | Text | |
2 | Text | |
3 | Text | Language of the OCR dictionary to be used (e.g., If required, multiple languages can be specified, separated by commas. The appropriate dictionary file must be available in the program directory (e.g., Default setting: |
Examples
RotatePagesAuto("test.tif", , "German") aligns the pages in a TIFF file attachment and adds the modified attachment as test.rotated.tif.