PDF files comparison

Greetings!
Is it possible to compare two PDF files and highlight the differences using UiPath?
I want to check whether the texts and numbers in the two PDF files are the same or not, if not then I have to highlight the difference, which would be my output file.

1 Like

Hi

Try with marketplace component

Cheers @Chendoran_M1

1 Like

Comparing two PDF files and highlighting the differences directly in UiPath is a complex task and may not be achievable with standard UiPath activities alone.

follow this steps you can achieve something

  1. Convert PDFs to Text: Use UiPath to extract the text content from both PDF files. You can use activities like “Read PDF Text” or “Read PDF with OCR” to do this.
  2. Text Comparison: Compare the text extracted from both PDF files. UiPath provides various string manipulation functions for text comparison, including custom logic to identify differences.
    based on the your requirement you can highlight the not matching text in that and use as output

@Chendoran_M1

1 Like

Hi @Chendoran_M1

  • In UiPath, you’ll need to use PDF-related packages like “UiPath.PDF.Activities” to work with PDF files.
  • Use the “Read PDF Text” activity to extract the text from both PDF files and store the text in separate variables.
  • Compare the text from the two PDFs to find the differences. You can do this by writing custom code or using UiPath activities to compare the text character by character or word by word.
  • f you find differences, you’ll need to create a new PDF file that highlights these differences. You can use the “Generate PDF” activity or a custom code library to create a new PDF where differences are highlighted.
  • Save the newly created PDF with highlighted differences to a desired location.
  • Finally, review the highlighted PDF to confirm that the differences are correctly highlighted. This is a crucial step to ensure the accuracy of your comparison

Please note that comparing PDF files can be complex, especially if the files have different formatting or layout. The level of detail you can achieve in highlighting differences may depend on the complexity of the PDF content and your automation skills. Custom coding may be required for more advanced comparison and highlighting.

Did this component work in this scenario

Let us know for further queries and clarification

@Chendoran_M1

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.