phax / ph-pdf-layout

Java library for creating fluid page layouts with Apache PDFBox. Supporting multi-page tables, different page layouts etc.
Apache License 2.0
61 stars 11 forks source link

No assertions for pdfs created during tests? #35

Closed Lolf1010 closed 8 months ago

Lolf1010 commented 8 months ago

Hey, found your library a couple days ago and have been playing with it a bit. Works great. At work we are currently looking into generating pdf-files that could include tables and came across your library. Among the few libraries out there, yours seems to be more actively developed / maintained.

I noticed, if i understand the code correctly, that there are no "real" tests for pdf-files that are created during tests. I only see that the pdf-files are saved but no assertions are performed on it.

If thats not the case then feel free to close this issue. If it is the case, why and does that mean that you test the pdfs manually?

Thanks

phax commented 8 months ago

Hi @Lolf1010 , yes you are right, I don't really do assertions on them but really do a visual comparison on what I expect them to look. What kind of assertions would you have thought of? Something like

Lolf1010 commented 8 months ago

No worries Browsing through a couple of libraries i found https://github.com/red6/pdfcompare Compares the pdfs pixel-by-pixel - seems to make the most sense to compare tables, boxes, images etc within the pdf Never tried it myself though

phax commented 8 months ago

Thanks, that looks interesting - I will investigate it

Lolf1010 commented 8 months ago

Cool.

Final question: In general, do you consider this library stable enough to be used in other projects? Like i wrote in the first comment i am looking at pdf-libraries to help with generating pdf-files. Your library looks awesome. However usually we are using libraries from Apache or known organisations. That why i am asking ;)

phax commented 8 months ago

The library was primarily created to look boring business documents like invoices etc. So the library does not provide fancy stuff like inline formatting or the like, and as a one-person show, I don't have the possibility to create huge functionalities in a short time.

This library is definitively stable enough for production usage and is used for more then 10 years in some governmental applications in Austria to render electronic invoices etc. If you like, I can provide you with access to a Slack channel where you can reach me directly. If so, write me an email to the email address you find in the pom.xml. hth

phax commented 8 months ago

Most of the files were identical to the "stored one". However, some file files were different by 1 or 2 pixels. One file contains random content, which was chaged to constant content now. So result is a bit more predictable - thanks for pointing this out!