From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to compare two PDF files using labview?

Solved!
Go to solution

I was wondering if it were possible to use LabVIEW to compare two PDF files (which contain images as well as text) to one another. I know that Bluebeam PDF viewer can do it, so i was hoping that there was a way to do this with LabVIEW.

0 Kudos
Message 1 of 6
(3,796 Views)

"Comparsion" can mean many things. What kind of "comparison" are you looking for?

(If you just want to check if they are identical, you could do a binary comparison on the raw file)

0 Kudos
Message 2 of 6
(3,782 Views)

Yes, I just want to know how identical they are; meaning I want to check to see if the images contained in the PDF are identical, even though the headers may be slightly different.

0 Kudos
Message 3 of 6
(3,775 Views)

Im not sure how to do a binary comparison of a PDF file. Is there an example code i could look at?

0 Kudos
Message 4 of 6
(3,678 Views)
Solution
Accepted by CETGirl

Read each file as a plain string, then compare the two strings for equality.

(You can also do some pre-tests, e.g. just see if the sizes are equal.)

0 Kudos
Message 5 of 6
(3,673 Views)

You could always perform an MD5 Hash on both of the files.  If they are the same files the hash will be the same. However, if they are different it won't tell you how different they are from each other.

Quentin "Q" Alldredge

Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner



0 Kudos
Message 6 of 6
(3,643 Views)