Skip to content

Read Pdf Action: readPdf

The readPdf action is used to read specific content from a PDF file. This function allows users to extract data from selected pages of the PDF document, providing flexibility to target specific sections.

Example: You want to extract data from pages 2 to 5 of a PDF file named projectDetails.pdf located at C:\ProjectDocs\.

Steps to Configure:

  1. Add a new step.
  2. Select Set a Variable Value from the Action dropdown.
  3. Enter a variable name in Element Key (e.g., ExtractedPDFData). This variable will store the extracted data.
  4. Click on Form, select Functions, and choose PDF File Handler Functions.
  5. In the Cmd field, select readPdf and provide the following parameters:
    • FPath: Specify the path to the PDF file to be read (e.g., C:\ProjectDocs\projectDetails.pdf).
    • Start: Enter the starting page number for the extraction (e.g., 2).
    • End: Enter the ending page number for the extraction (e.g., 5).
    • Key: Specify the key for specific content retrieval, if applicable (e.g., InvoiceNumber).
  6. Click Save.

Note: If a Key is specified, only the associated data will be retrieved; otherwise, the entire content of the specified pages will be extracted.

scrn-read-pdf-command-tabular-view
Tabular View
scrn-read-pdf-command-card-view
Card View

Outcome on execution:

  • The extracted content from the specified page range is stored in the variable defined in the Element Key field.
  • This variable can be referenced in subsequent steps of the automation process using the syntax ${VariableName} (e.g., ${ExtractedPDFData}).

Back To Top