Get PDF Fields

Gets mapped fields and values from a PDF file.

Command availability: IBM RPA SaaS and IBM RPA on premises

Script syntax

IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

pdfDump --file(Pdf) (String)=value

Input parameter

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
PDF PDF Required PDF PDF file to be mapped and from which fields and values should be obtained.

Output parameter

Designer mode label Script mode name Accepted variable types Description
Fields value Text Return the fields obtained from the PDF file and their respective values.

Example

The Get PDF Fields command gets the fields of the entered PDF file and returns the fields' names and their values.

defVar --name openPdf --type Pdf
defVar --name pdfFilePath --type String
defVar --name fieldsInformation --type String
// Download the following file to execute the command.
pdfOpen --file "PDF-file.pdf" pdfFilePath=file openPdf=value
pdfDump --file ${openPdf} fieldsInformation=value
logMessage --message "${fieldsInformation}" --type "Info"
// The example returns the contents of the filled fields in the file.

Important: To run the sample script, you must use the path to a PDF file with editable fields in the Path parameter of the Open PDF File command.