Skip to content

Customize output file names

Andrea Vacondio edited this page Jan 20, 2020 · 4 revisions

Special keywords can be used as placeholders in the output file names, to be replaced with dynamic values during the execution.

A trivial example is using a consecutive file number when splittin.

[FILENUMBER]

A reference to the current file number that it's being generated.

Example: [FILENUMBER###] will generate filesnames like 001.pdf, 002.pdf.

Example: [FILENUMBER##] generates 01.pdf, 02.pdf, etc.

Example: [BASENAME]-[FILENUMBER] you can combine to generate filename-1.pdf, filename-2.pdf, etc.

Full example: sejda-console.bat splitbysize -s 2621440 -j overwrite -p [BASENAME]-[FILENUMBER] -f input.pdf -o c:/temp/

Another trivial example is prefixing each document with the page number, when splitting.

[CURRENTPAGE]

A reference to the current page number processed in the input document

Example: [CURRENTPAGE###] will generate filesnames like 001.pdf, 002.pdf.

Example: [CURRENTPAGE##] generates 01.pdf, 02.pdf, etc.

[TIMESTAMP]

Ensures unique output filenames, being replaced with current date & time.

Example: [TIMESTAMP] generates something like 20090706_152643712.pdf etc.

[BASENAME]

Does not ensure unique output filenames and it must be used together with other placeholders ensuring unique names. It is replaced with original name of the input document, without the extension.

Example: [CURRENTPAGE]_[BASENAME] would generate 1_input-file.pdf, 3_input-file.pdf, etc.

[TOTAL_FILESNUMBER]

Replaced by the total number of generated PDF files.

Example: If the task created a total of 12 PDF files, [FILENUMBER]_of_[TOTAL_FILESNUMBER] generates 1_of_12.pdf, 2_of_12.pdf, etc

[BOOKMARK_NAME]

This pattern is replaced by current bookmark's name. Only applicable when splitting by bookmarks.

[BOOKMARK_NAME_STRICT]

Same behavior as [BOOKMARK_NAME] with the difference that non-alphanumberic characters are removed.

Example: [CURRENTPAGE]-[BOOKMARK_NAME] would generate 1-Introduction.pdf, 4-Chapter 1.pdf, etc.

[TEXT]

This pattern is applicable when splitting by text. It is replaced with the text found in the page area selected.

Example: [CURRENTPAGE]-[TEXT] would generate 1-Invoice 3456789.pdf, 4-Invoice 234567.pdf, etc.