Forum Discussion

PaulS's avatar
PaulS
New Contributor
10 years ago

How to partially compare PDF files?

Hi,

 

I have set up a test where it compares to PDF files. However, even if the content is exactly the same, it returns a false due to the difference in the printed date. How can I compare the relevant contents only?

 

Thanks!

5 Replies

    • maximojo's avatar
      maximojo
      Frequent Contributor

      Yes, PDFBox is great! You can customize it to ignore certain lines (using the Smartbear provided source code in bo_roop's link above).

       

      So you can always ignore a certain line which contains the timestamp or whatever you like.

       

      There are also tools like BeyondCompare which can be run from the command-line and allow for customization of comparisons through the UI. It might have a problem comparing column data but overall works well.

  • How are you doing the current compare?

     

    And do you care about presentation and formatting or actual content (text, numbers etc) what you're interested in.

    • PaulS's avatar
      PaulS
      New Contributor

      I compare the files using the aqFile.Compare(x, y).

       

      I'm interested on the actual content and the formatting too.

       

      I'll have a look at the PDFBox. Thanks!