Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No assertions for pdfs created during tests? #35

Closed
Lolf1010 opened this issue Mar 6, 2024 · 6 comments
Closed

No assertions for pdfs created during tests? #35

Lolf1010 opened this issue Mar 6, 2024 · 6 comments
Assignees
Labels

Comments

@Lolf1010
Copy link

Lolf1010 commented Mar 6, 2024

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 phax self-assigned this Mar 7, 2024
@phax phax added the question label Mar 7, 2024
@phax
Copy link
Owner

phax commented Mar 7, 2024

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

  • Number of pages
  • When page is extracted as text, it must contain this and that substring
    ? I must admit my creativity on that point is quite limited ;-) Any input is welcome

@Lolf1010
Copy link
Author

Lolf1010 commented Mar 7, 2024

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
Copy link
Owner

phax commented Mar 7, 2024

Thanks, that looks interesting - I will investigate it

@Lolf1010
Copy link
Author

Lolf1010 commented Mar 7, 2024

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
Copy link
Owner

phax commented Mar 7, 2024

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
Copy link
Owner

phax commented Mar 7, 2024

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!

@phax phax closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants