pdfcompare
pdfcompare copied to clipboard
Comparison output readability (Ability to generate two diff documents)
We have tried to compare two PDF files, and output came in the below format. It seems like we cannot read the difference from the output. Is there any other way we can make it more simpler and easy to understand?
What do you want/expect? Yes, it's hard to read. But here is what pdfcompare does: It compares pdf pages pixel by pixel. It shows pixel, that are missing in red and pixels that are there in addition in green. When text is "moved", it quickly results in a lot of green and red, like in your example. There is no easy way to detect a move and show that in any meaningful way, I think.
You could probably add a feature, that only shows the green or red. What I usually do, when I have a big difference, like the one above is: I look at the two pdfs side by side. ;-)
@finsterwalder Thanks for your suggestions :)
I was just checking if we have a solution for getting two outputs one in green and other in red or to get a single output.
However as you mentioned, I will try to add the feature or try to find a different solution. If those didn't work I will go for the final suggestion which you have mentioned. I have to look at the two PDF files side by side :)
One more question : Can we generate the output only with the difference into a Excel sheet or a word file ?
I have not found any solution for PDF comparison result in single color. When will You add a feature, that only shows the any one color.
BTW: It's Open Source. You can add the feature yourself and do a Pull Request. ;-) I don't know when or if I add this feature.
HETU029 [email protected] schrieb am Di., 17. Sep. 2019, 07:51:
I have not found any solution for PDF comparison result in single color. When will You add a feature, that only shows the any one color.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/red6/pdfcompare/issues/59?email_source=notifications&email_token=AABSN3X6IGLKAVPCWYUHVTDQKBV6DA5CNFSM4IWQQSO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD63L5GY#issuecomment-532070043, or mute the thread https://github.com/notifications/unsubscribe-auth/AABSN3UQ36LZKLTQQT4WQWTQKBV6DANCNFSM4IWQQSOQ .
I added the ability to customize the color of diff outputs. So you could run two comparisons with different coloring. Making one color something like gray or white, might give you the effect you are looking for. (There is not "do not change the color" option, though.)
Is it possible to get the result file side by side instead of overlapping, something like what this site shows- https://www.diffchecker.com/diff
PdfCompare has a very simplistic GUI, that can show two files side by side. Right now you can choose to view the expected or the actual PDF next to the compare result and switch between those.
Feel free to code something that generates two PDFs with different color markers. something like: new PdfComparator(file1, file2).withEnvironment(new SimpleEnvironment().setActualColor(Color.BLACK)) new PdfComparator(file1, file2).withEnvironment(new SimpleEnvironment().setExpectedColor(Color.BLACK))
And show those files.
I will most likely not work on something like this in the near future.
And I think diffchecker.com works completely different, since it seams to extract text from the PDF and does not do a pixel comparison.
Thanks for the response, the result file with the differences currently gives a ‘Unified’ view which is not that readable. Is it possible to get the result output showing the 2 files in the ‘Split’ view- which shows the 2 documents side by side? This feature- I think would be a game changer 😊
From: Malte Finsterwalder [email protected] Sent: Tuesday, June 23, 2020 3:44 PM To: red6/pdfcompare [email protected] Cc: Shah, Mitali P. [email protected]; Comment [email protected] Subject: [External] Re: [red6/pdfcompare] Comparison output readability (Ability to generate two diff documents) (#59)
This message is from an EXTERNAL SENDER - be CAUTIOUS, particularly with links and attachments.
PdfCompare has a very simplistic GUI, that can show two files side by side. Right now you can choose to view the expected or the actual PDF next to the compare result and switch between those.
Feel free to code something that generates two PDFs with different color markers. something like: new PdfComparator(file1, file2).withEnvironment(new SimpleEnvironment().setActualColor(Color.BLACK)) new PdfComparator(file1, file2).withEnvironment(new SimpleEnvironment().setExpectedColor(Color.BLACK))
And show those files.
I will most likely not work on something like this in the near future.
And I think diffchecker.com works completely different, since it seams to extract text from the PDF and does not do a pixel comparison.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_red6_pdfcompare_issues_59-23issuecomment-2D648379243&d=DwMCaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=_GCTZUgRyTozuqoy1GdnGAgNNtHLfgy5w6QQZdWIbkA&m=tg4C3LMgMoRQTYWig3TxK3O97OPLwEoa8WiXauLjb_w&s=Cv80E0oel1-tPUK1n2aJjfyxyMnBiad1ZRv1FCEYKFU&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AKHB6CSDNM2RYGZVBDIGBMLRYEAZBANCNFSM4IWQQSOQ&d=DwMCaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=_GCTZUgRyTozuqoy1GdnGAgNNtHLfgy5w6QQZdWIbkA&m=tg4C3LMgMoRQTYWig3TxK3O97OPLwEoa8WiXauLjb_w&s=E6PMZh9jhWC8jay-rVt30zeEpp8sI87hcP9mSBGjpBo&e=.
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. Your privacy is important to us. Accenture uses your personal data only in compliance with data protection laws. For further information on how Accenture processes your personal data, please see our privacy statement at https://www.accenture.com/us-en/privacy-policy.
www.accenture.com
I'm not sure I understand what you mean. With "side by side", I assume you mean the PdfCompare UI? And which "2 documents" do you mean exactly?
check pdfcompare into my github. I added an interesting feature. For two pdf I generate one pdf where in each page you'll have on left page of pdf1 and on right a page of pdf2 with difference. check branch horizontal_compare (@finsterwalder may be an interesting feature to merge into your project).
check pdfcompare into my github. I added an interesting feature. For two pdf I generate one pdf where in each page you'll have on left page of pdf1 and on right a page of pdf2 with difference. check branch horizontal_compare (@finsterwalder may be an interesting feature to merge into your project).
is this implemented? side by side compariosn ?
is this implemented? side by side compariosn ?
I think it is. See class DisplayMain.
is this implemented? side by side compariosn ?
I think it is. See class DisplayMain.
Thanks for update. However i was thinking it is something which can be run programtically by passing two pdf & saving pdf for side by side comparison result
Sorry for delay, yes in my version on my github is implemented the side by side compare.
Sorry for delay, yes in my version on my github is implemented the side by side compare.
Please can u share the class where i can call this
Here an example on how use it...use setEnableHorizontalCompareOutput
PdfComparator compare = new PdfComparator("input/input1.pdf", "input/input2.pdf");
boolean flagLeftRight = true;
compare.headerLeft = "LEFT";
compare.headerRight = "RIGHT";
compare.withEnvironment(new SimpleEnvironment().setActualColor(Color.red).setParallelProcessing(true)
.setMaxImageSize(100000).setDocumentCacheSize(0).setOverallTimeout(15)
.setExpectedColor(Color.CYAN).setAddEqualPagesToResult(true).setDPI(DPI)
.setEnableHorizontalCompareOutput(flagLeftRight).setAllowedDiffInPercent(pixel));
CompareResult result = compare.compare();
Here an example on how use it...use setEnableHorizontalCompareOutput
PdfComparator compare = new PdfComparator("input/input1.pdf", "input/input2.pdf"); boolean flagLeftRight = true; compare.headerLeft = "LEFT"; compare.headerRight = "RIGHT"; compare.withEnvironment(new SimpleEnvironment().setActualColor(Color.red).setParallelProcessing(true) .setMaxImageSize(100000).setDocumentCacheSize(0).setOverallTimeout(15) .setExpectedColor(Color.CYAN).setAddEqualPagesToResult(true).setDPI(DPI) .setEnableHorizontalCompareOutput(flagLeftRight).setAllowedDiffInPercent(pixel)); CompareResult result = compare.compare();
thanks but m getting error for below. headerLeft is not getting listed. I am on horizontal_compare branch compare.headerLeft = "LEFT"; compare.headerRight = "RIGHT";
Yes sorry, my error. You can now find the fix into horizontal_compare branch. Tell me if other error occurs.
Pushed new code. Thanks Pull
@v3g3t4x If I have a multipage PDF it compares the page and overwrites the output file, Is there a way to output multiple files for each page it compares
Hi, It create one PDF with multipage. Check well please and tell me if the issue is real. But if I don't remember wrong it create one PDF with N pages.
@v3g3t4x it creates a single png file called comp.png rather than a pdf file and that png file is replaced over and over again fo reach comparison it does, do I need to change the format of the png file to PDF? I am using the horizontal_compare branch.
That png it's only a tmp file, it produce a PDF too with all pages
@v3g3t4x can you list me to the piece of code where it does the same, the only output I am getting is in the comp.png ( do I have to look in any specific folder), I searched every-folder but I don't see a pdf output anywhere.
It's kinda hard to follow what exactly you are doing. PdfCompare does not write a result Pdf, unless you tell it to do so. For that you need to call CompareResult.writeTo(). This will store a multi page Pdf with one page per page from the original documents, marking all the differences. There is no feature to write a single compare file for each page.
Exactly, thanks @finsterwalder