-
Notifications
You must be signed in to change notification settings - Fork 614
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
invalid pdf generation (can only be opened with some PDF renders) #156
Comments
After some additional checks: the hidden problem is that Workaround: don't use |
Side question: Wouldn't it be reasonable to provide the createPDF code from https://github.com/LibrePDF/OpenPDF/blob/master/openpdf/src/test/java/com/lowagie/text/pdf/PdfTestBase.java as a static function in Document or PdfWriter (maybe with an optional PageSize parameter)? |
You shall never use The design here is that |
I see. Ideally the visibility would be changed to prevent errors like these during coding - or - if this isn't possible/exceptable a RuntimeCheck thrown if the caller wasn't What do you think? |
Strictly speaking the forwarding is indirect, between With these border conditions in mind, such a runtime check could be implemented. |
* #156: Throw Exception if PdfWriter.close() is called directly - Throw an IllegalStateException if PdfWriter.close() is called before Document.close() is called. - Delete old *.lng files in src/main/java - Update *.lng files in src/main/resources - BoyScout rule in PdfWriter * #156: Throw Exception if PdfWriter.close() is called directly - Codacy Issues
* #156: Throw Exception if PdfWriter.close() is called directly - Throw an IllegalStateException if PdfWriter.close() is called before Document.close() is called. - Delete old *.lng files in src/main/java - Update *.lng files in src/main/resources - BoyScout rule in PdfWriter * #156: Throw Exception if PdfWriter.close() is called directly - Codacy Issues (cherry picked from commit 6c675f7)
* #156: Throw Exception if PdfWriter.close() is called directly - Throw an IllegalStateException if PdfWriter.close() is called before Document.close() is called. - Delete old *.lng files in src/main/java - Update *.lng files in src/main/resources - BoyScout rule in PdfWriter * #156: Throw Exception if PdfWriter.close() is called directly - Codacy Issues (cherry picked from commit 6c675f7)
Firefox shows an empty page, AcrobatReader says:
Sample code reproducing the issue:
The main question: Should an error be raised somewhere as OpenPDF was used "wrong" = please handle it as Feature Request to do so (I'd like to know if someone spots what is missing); or is OpenPDF just generating a bad PDF and needs a fix = please handle it as bug report (I'd like to know if someone has a work around) - is this related to #135 ?
Resulting test.pdf
Working pdf, created with Chrome's print as pdf (recreating from rendered version, always as PDF 1.7)
The text was updated successfully, but these errors were encountered: