Skip to main content

xSuite Interface Windows Prism 5.x – Online Help

Splitting and Extraction of Files

ExtractFilesEInvoice()

This function extracts embedded attachments from an e-invoice file. The default name for the target files is %FileName% and refers to the contained attachments, which are therefore extracted under their original name by default.

PEPPOL, UBL, XRechnung, and ZUGFeRD formats are supported as source files and can be processed by the program. The specific format is determined by the macro function itself. In the case of the ZUGFeRD format, XML source files and PDF source files are permitted.

Parameter

Data Type

Description

1

Text

2

Text

3

Text

Name filter for the file attachments to be extracted

Default value: * (all file attachments)

Examples

ExtractFilesEInvoice("test.xml", "%FileBaseName%.extracted.%FileExt%", "*.pdf|*.xml") extracts all PDF file attachments and XML file attachments from an e-invoice file in XML format and adds the suffix extracted to the original names.

ExtractFilesPdf()

This function extracts embedded attachments from a PDF file. The default name of the target files is %FileName% and refers to the constituent attachments, which are thus extracted under their original name by default.

Parameter

Data Type

Description

1

Text

2

Text

3

Text

Name filter for the file attachments to be extracted

Default value: * (all file attachments)

4

Bool

Boolean value determining whether attachments included as annotations at page level will be included

Default value: FALSE (only global assets are included)

Examples

ExtractFilesPdf("test.pdf", , "*.xml") extracts all XML file attachments from a PDF file under the original file name.

ExtractFilesZip()

This function extracts files from a compressed ZIP container file. The default name of the target files is %FileName% and refers to the constituent files. As such, they are extracted under their original name by default.

Parameter

Data Type

Description

1

Text

2

Text

3

Text

Name filter for the files to be extracted

Default value: * (all files)

Examples

ExtractFilesZip("test.zip") extracts all files contained in a ZIP archive under their original file names.

ExtractPages()

These functions extract a page or a contiguous page range from a multi-page PDF file or TIFF file.

The default name of the target file is %FileBaseName%.extracted.%FileExt%.

Parameter

Data Type

Description

1

Text

2

Text

3

Text

Definition of the page from which the extraction should start:

  • First: extraction from the first page (default value)

  • Last: extraction from the last page

Alternatively, a specific page number can be specified.

4

Number

Number of pages to be extracted

Default value: 1

With the first page Last, the last n pages of the file are extracted, counting from the back.

Examples

ExtractPages("test.pdf", , "Last", 3) extracts the last 3 pages from a PDF file under the name test.extracted.pdf.

SplitByBarcode()

This function separates a multi-page TIFF file or a PDF file into several page ranges based on guide page barcode values to be read.

The default name of the target files is %FileBaseName%.split.%FileExt%. As a special variable for naming, %BcValue% is also available here; it contains the barcode value used for splitting.

Due to the barcode values found, it is not necessary to split the source file. Nevertheless, a copy of the unchanged source file is created as the target file (%FileBaseName%.split.%FileExt%). In this way, it is possible to continue working with uniform target file names regardless of the result of the barcode recognition.

Parameter

Data Type

Description

1

Text

2

Text

3

Text

Working mode for barcode search and page separation:

  • First: search for the first page with a barcode; separation before this page (default value)

  • Last: reverse search for the last page with a barcode; separation before this page

  • All: search across all pages; separation before each barcode page

  • Repeat: search across all pages; separation before each page where the barcode value has changed from the previous page (excludes values not found)

4

Text

Type of barcodes to search for:

  • Simple: normal 1D barcode (default value)

  • DM: data matrix code

  • QR: QR code

5

Text

Filter to limit the search to barcodes with specific content or structure (optional)

For each page, only the first barcode found is used.

Syntax: see Name Filter Syntax.

Default value: *

6

Number

Resolution (dpi) for implicit conversion to raster images required for PDF pages before barcode recognition

Default value: 300

7

Bool

Boolean value determining whether finding a barcode on the first page is mandatory. If no barcode is found, an error will be thrown.

Default value: TRUE

8

Bool

Boolean value determining whether the pages with the barcode are to remain unextracted, while all other pages are extracted

Default value: TRUE

Examples

SplitByBarcode("test.tif", , "All", "Simple", "A#######") splits a TIFF file across all pages based on a barcode with the specified pattern into individual files named test.split.tif. For unique naming, you can define the target file name %FileBaseName%.%FileNo%.%FileExt% so that the files are numbered in the form test.1.tif, test.2.tif.

SplitPdf()

This function separates a PDF file into its individual pages.

The default name of the target files is %FileBaseName%.split.pdf.

Parameter

Data Type

Description

1

Text

2

Text

Examples

SplitPdf("test.pdf") splits a PDF file into individual files named test.split.pdf for each page.

SplitTiff()

This function separates a multipage TIFF file into its individual pages.

The default name of the target files is %FileBaseName%.split.%FileExt%.

Parameter

Data Type

Description

1

Text

2

Text

Examples

SplitTiff("test.tif") splits a TIFF file into individual files named test.split.tif for each page.