Write Pdf to Text Action: writepdftotext
The writepdftotext action is used to extract text content from a PDF file and write it into a specified text file. This feature is helpful for converting PDF documents into editable or searchable text formats.
Example: You want to extract text from pages 1 to 5 of a PDF file named Report.pdf and save it in a text file named ReportText.txt.
Steps to Configure:
- Add a new step.
- Select Set a Variable Value from the Action dropdown.
- Enter a variable name in Element Key (e.g., TextFilePath). This variable will store the path of the resulting text file.
- Click on Form, select Functions, and choose PDF Handler Functions.
- In the Cmd field, select writepdftotext and provide the following parameters:
- FPath: Specify the path of the PDF file to be converted (e.g., C:\Documents\Sample.pdf).
- Start: Enter the starting page number for text extraction (e.g., 1).
- End: Enter the ending page number for text extraction (e.g., 10).
- WriteFile: Specify the file path where the extracted text will be written (e.g., C:\Documents\Output.txt).
- Click Save.


Outcome on execution:
- The extracted text from the specified pages of the PDF file is written to the defined text file path.
- The resulting text file path 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., ${TextFilePath}).
Note: The text file will be overwritten if a file with the same name already exists at the specified path.