Compare 2 PDF files with text box / tables

Hi, I would like to compare two pdf files (with tables contained in the pdf files) . Should i use Read PDF Text or Read PDF with OCR?

After comparing, how can I set a summary page detailing the discrepancies (i.e. "Assignee Name does not match with prior year details ")?

Thank you!

@MoonVoo

Welcome to our UiPath Community.

Do you want to compare entire PDF data or specific value you want to compare ?

Hi @MoonVoo

First convert your pdf into excel and compare
For converting pdf to excel
Use this steps

Step 1 − First, open UiPath studio and start a new blank project.

Step 2− Now, put the pdf file from which you want to read the data in the folder of your current project. We are reading the data from following Excel file. “test.pdf” for example.

Take a activity Read PDF Text and select the excel file.

excel to pdf

excel to pdf

Step 3 − done the below activity for reading the pdf file and writing in excel.

  • Take a activity Read PDF Text and select the excel file.
  • Take a Log message.
  • Take a data table for collecting the information from PDF.
  • take write range activity for writing the all data from data table to excel.

data table filterpdf to excel

Step 4 – if you want to filter data from data table . you can filter it by using in data table as below.

data table filter

data table filter

Step 5 –After doing above process , Run the project. It will write the excel file as below in pic.

Then read that xls file and keep one for each row inside the body drag and drop if Condition there write
Row(“column name”).testing.contains(“assignee name”)
Then part keep one message box and write matches and in else part write not matched

Cool
Regards
Gulshiyaa

Hello, I would like to compare the entire PDF data.

Hello , is it possible to compare the pdf directly instead of converting into excel first? Because there are more than 10 pages in 1 pdf file.

For example, I have two pdf invoices (INV Number 3337 and 3336). After comparing the two pdf, there will be a summary page stating “Invoice number does not match” .

What is the workflow I should be using?

Hi @MoonVoo

In your case I dont think so it’s possible

Compare two pdf files and find out difference between them with line number and page number

comparing two pdf files in UiPath is possible and that can be done easily with Read PDF Text activity. Although this will convert the PDF data into text and you can use it to compare text data of other PDF file. But you cannot find the differences like line numbers or page numbers.

Regards,
Gulshiyaa

Hi @gulshiyaa,
I think it’s not comparing by line numbers instead?

What I would like to compare is something like this,

First year
image
Second year
image

So after comparison, there will be a message indicating ’ Mismatch of spouse income ’

Thank you.