red6 / pdfcompare

A simple Java library to compare two PDF files
Apache License 2.0
220 stars 66 forks source link

PdfComparator with base64 #70

Closed LeJeanbono closed 4 years ago

LeJeanbono commented 4 years ago

What do yout think @finsterwalder ? I will update the Readme if it's fine to you.

finsterwalder commented 4 years ago

I don't like changing the public API of the service, so I would rather try to find a way that leaves the old API intact.

finsterwalder commented 4 years ago

readAllBytes on InputStream is available in Java 9, but the lib is compatible with Java8. You code has a copy-paste-bug (see comments in code).

finsterwalder commented 4 years ago

I created a different solution in version 1.1.50. That allows to compare PDFs in base64 encoding by using a static PdfComparator.base64(expectedPdf, actualPdf)-Method Thanks for the idea to use base64 encoded strings.

LeJeanbono commented 4 years ago

Thanks @finsterwalder The best would be to mix different inputs => Path & fileName, Base64 & File

finsterwalder commented 4 years ago

Nice idea. I'm thinking of a builder-like API. That would allow for that kind of flexibility. I will think about that...