-
Notifications
You must be signed in to change notification settings - Fork 363
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
Feature differences between openhtmltopdf and flyingsaucer #80
Comments
HTML/CSS compatibilty should be very similar. It seems flyingsaucer gets a little bit of development now again, the project was very quiet for a long time. As you may already know: Don't expect to throw any HTML on this library and get perfect printouts from it. To get good results you must tune your HTML to this library and use some CSS extensions. Many HTML5 features like "display:flex" wont get into this library nor flyingsaucer, because they are very complex to implement and you can already "fake" them using tables. Yes, tables are bad in normal HTML. But here you want to get a fixed width PDF printout, so you need to use whats there. On the other side their are extensions like The features I added to openhtmltopdf are features which I needed:
See the README for other changes. Currently the differences between flyingsaucer and openhtmltopdf are not that big. Beside using the old unmaintained iText2 vs active developed OpenPDFBox. |
In my opinion I can see one major difference between the two is Flying saucer with itext gives the ability to add pages to the pdf incrementally. That means it will allow you to create pdf and add one or more pages as you stream data and that seems memory efficient as well as fast. |
@rajaningle iText 5 is a no go at least for me and my customers, as AGPL is more or less incompatible with anything used commercially. If your public internet facing web server is generating bills using iText 5, you would need to give all your sources to everyone getting a bill PDF. So you are required to buy a licence, and prices are not public visible (you must request a quote...) You should be able to add pages to an existing document using this lib too. You just must specify a PDDocument of a existing PDF. Also the memory needed to generate a document should not be that much different, as you need to have the whole W3C DOM in memory for flying saucer too. The only big difference is that PDFBox holds the whole document in memory by default, but you can configure that. The lossless image compression is currently better in iText, but I am working on that. Especially in terms of image encoding iText has many special cases to handle image data very efficient and avoid reencoding PNGs and JPEGs. At least iText 2 had that — never looked into iText 5. I am not sure if that is worth the hassle, at least I won’t implement that in PDFBox. |
@rototor Thanks for insight on the licensing part and details about the other sections but I was really struggling to do incremental page add with openhtmltopdf i know it is available with pdfbox but could not find a way to do it with openhtmltopdf also it is not mentioned in docs. If you can provide one example to add pages from html that would be really great. Thanks. |
… PDF document. (cherry picked from commit e7daf36)
(cherry picked from commit 436dbab)
@rajaningle For an example look into #222 |
Hi all! My svg image is not displayed on PDF file. I have svg image on my html template. This is a snippet of my code:
What I'm doing wrong or what I'm missing? |
@taras19921 You should open a new issue for this, as it is not related to this issue. Your builder looks fine, there may be something wrong the HTML you supply. Please open a new issue and provide the HTML. Thanks. |
I've opened a new issue: #258 |
Finally added a list of differences with Flying Saucer in the README. Will add to it over time. Thanks everyone. |
It would be greatly appreciated if you could add a section to the README that details the differences between openhtmltopdf and flyingsaucer in terms of features (apart from using libraries with better licenses).
Are you behind, on par or even exceeding the features and HTML/CSS-compatibility of flyingsaucer?
The text was updated successfully, but these errors were encountered: