Skip to main content

xSuite Interface Windows Prism 5.x – Online Help

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:

  • Courier (default value)

  • Helvetica

  • Times

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: 10

8

Bool

Boolean value determining whether the text is bold

Default value: TRUE

9

Text

Color of the text as hexadecimal RGB value (e.g., 000000 for black or FF00FF for purple)

Default value: 000000 (black) (default value)

10

Number

Rotation angle of the text

Default value: 0

11

Text

Definition of the pages on which the text is placed:

  • First: first page only (default value)

  • Last: last page only

  • All: all pages

  • Free specification of individual page numbers or page ranges (e.g., 1;2;3 or 1-3)

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: 99.5

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:

  • First: first page only (default value)

  • Last: last page only

  • Free specification of individual page numbers or page ranges (e.g., 1;2;3 or 1-3)

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:

  • P: printing

  • PF: high-resolution printing

  • C: copying of text and graphics

  • CA: copying for use with accessibility features

  • M: editing

  • AN: adding notes

  • FF: filling out form fields

  • A: compilation of the document

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: %FileName%) serves as the basis and can be referenced in the macro via file variables (e.g., @FileName).

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., German or English)

If required, multiple languages can be specified, separated by commas. The appropriate dictionary file must be available in the program directory (e.g., deu.traineddata or eng.traineddata). These two files are supplied with the program. Additional dictionary files can be provided on request.

Default setting: German

Examples

RotatePagesAuto("test.tif", , "German") aligns the pages in a TIFF file attachment and adds the modified attachment as test.rotated.tif.