SAP Help Home SAP Intelligent RPA Help Portal SAP Intelligent RPA Community

Module - PDF Utilities

PDF utilities

Author:
  • SAP Intelligent RPA R&D team

Activities

Extract PDF by Page Range

Extract the PDF by page range. A new PDF is created based on the \"pages\" input parameter.


Technical Name Type Minimal Agent Version
extractPdfByRange asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
inputFilePath string mandatory Full path of the existing PDF document.
pages string mandatory Page numbers and/or page ranges separated by commas. It supports "end" keyword as an alternative to the last page of PDF. Some examples: 1,3,5,8 or 1-3,5 or 3,5-end.
outputFilePath string mandatory Full path of the new PDF file to be created after splitting. Missing directory will be created automatically.
overrideOutputFile boolean optional Set to 'true' to override the existing PDF. Set to 'false' (default) to create a new file with incremented FileName.

Output Parameters:

Name Type Description
outputFilePath string Output PDF file path.

Errors:

Error Class Package Description
InvalidArgument irpa_core


Split PDF Every X Pages

Split a PDF document every X pages and create multiple new PDF documents accordingly.


Technical Name Type Minimal Agent Version
splitPDFEveryXPages asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
inputFilePath string mandatory Full path of the PDF document that will be split up.
outputFilePath string mandatory Path where the generated PDF files will be saved. The name of the file should be included. Generated files will be named output_1.pdf, output_2.pdf, ..., output_X.pdf.
splitEveryXPages number mandatory Number of pages after which the PDF document will be split. For example, if the PDF has 5 pages and the 'splitEveryPages' parameter is set to 3, 2 PDF documents will be generated, one with pages (1,2,3), and one with pages (4,5).
overwriteOutputFiles boolean optional Set this parameter to 'true' to override existing PDF documents if any are encountered. Set the parameter to 'false' (default) to create a new file with incremented fileName in case of conflict.

Output Parameters:

Name Type Description
outputFiles Array. List of the paths of all the PDF documents generated by this activity.


Split PDF by Field Value

Split a PDF into multiple PDF documents. The splitting is done by setting a specific text to uniquely identify the document.


Technical Name Type Minimal Agent Version
splitPagesByFieldValue asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
inputFilePath string mandatory Full path of the existing PDF document.
outputFilePath string mandatory Path where the generated PDF files will be saved. The name of the file should be included. Generated files will be named output_1.pdf, output_2.pdf, ..., output_X.pdf.
beforeText string optional Reference text to extract the text after.
afterText string optional Reference word to extract the text before.
overwriteOutputFiles boolean optional Set this parameter to 'true' to override existing PDF documents if any are encountered. Set the parameter to 'false' (default) to create a new file with incremented fileName in case of conflict.

Output Parameters:

Name Type Description
outputFiles Array. List of the paths of all the PDF documents generated by this activity.

Errors:

Error Class Package Description
InvalidArgument irpa_core


Merge PDF

Merge all the PDF documents in a folder. Please note that this activity does not support encrypted PDF documents.


Technical Name Type Minimal Agent Version
mergePdf asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
inputFolderPath string mandatory Folder containing the PDF documents to merge.
outputFilePath string mandatory Full path of the new PDF file to be created after splitting. Missing directory will be created automatically.
overwriteOutputFile boolean optional Set this parameter to 'true' to override existing PDF documents if any are encountered. Set the parameter to 'false' (default) to create a new file with incremented fileName in case of conflict.
fileNames Array. optional Comma separated list of file names, in the input folder, to be merged. If empty, all files in the input folder will be merged. Example: ["form1.pdf", "form2.pdf"]

Output Parameters:

Name Type Description
outputFilePath string List of the paths of all the PDF documents generated by this activity.

Errors:

Error Class Package Description
InvalidArgument irpa_core