Hi guys,
I am extracting text from multiple PDF documents using the Text to left/right activity.
I would like to have all the extracted text from the multiple pdf’s copied to a single excel document, then convert the single excel doc to pdf. Which activity do I use for:
Copying the extracted info to a single excel file
2.Converting the single excel file to PDF.
I have been able to confirm the text has been successfully extracted using a message box. Please explain to me step by step.Note I am using version 2023.10.0
Use write cell to write the data to excel…if using in loop can use auto increment to change cell value for each loop
Alternately can use build datatable to build a table as required…then use add data row to add the read data from pdf to the datatable in specified columns
Then use write range to write datatable to excel
IN excel activities you have an option save excel as pdf which can be used to save the final excel as pdf
Him
Hope the below steps would help u resolve this
Create a new UiPath workflow.
Add a For Each activity to the workflow.
In the For Each activity, set the Collection property to the collection of PDF documents that you want to extract the text from.
Add a Text to Left/Right activity to the For Each activity.
In the Text to Left/Right activity, set the Input property to the current item in the collection.
Add a Write Range activity to the For Each activity.
In the Write Range activity, set the Input property to the extracted text from the Text to Left/Right activity.
Set the Worksheet property to the Excel worksheet where you want to write the extracted text.
Set the Append property to True so that the extracted text is appended to the Excel worksheet instead of overwriting it.
Connect the Text to Left/Rightactivity to the Write Range activity.
Connect the For Each activity to the End Sequence activity.
Example:
For Each
* Collection: pdfDocuments
* Text to Left/Right
* Input: Current Item
* Write Range
* Input: ExtractedText
* Worksheet: ExcelWorksheet
* Append: True
* End For
copying the extracted text from multiple PDF documents into a single Excel file and then converting that Excel file into a PDF using the following steps:
Step 1: Extract Text from Multiple PDFs
*Use the “For Each” activity to loop through your list of PDF files.
*Within the loop, use the “Read PDF Text” activity to extract the text from each PDF file. You’ve mentioned you’re using the “Text to left/right” activity, which can be used here.
*Store the extracted text in a variable.
Step 2: Write Extracted Text to Excel
Create an Excel application scope using the “Use Excel File” activity to work with Excel.
Within the Excel scope, use the “Write Cell” or “Write Range” activity to write the extracted text into the Excel file. You may need to use a counter or row index to ensure the text from different PDFs is written to different rows in the Excel file
Step 3: Convert Excel to PDF
Install the “UiPathTeam.ExcelExtensions” package if you haven’t already. This package provides the “Convert Excel to PDF” activity.
Use the “Convert Excel to PDF” activity within the Excel application scope to convert the Excel file to a PDF.