albfernandez / jboss-seam

Seam 2: enterprise Java development framework
http://albfernandez.github.io/jboss-seam/
GNU Lesser General Public License v3.0
11 stars 5 forks source link

Migrate from itext to OpenPdf #39

Closed albfernandez closed 4 years ago

albfernandez commented 4 years ago

LibrePDF/OpenPDF#351

There are some api changes from OpenPdf 1.3 that are incompatibles with programs already compiled with itext. So a decission has to be made :

stolp commented 4 years ago

+1 for migrating to OpenPDF.

I have a large application leveraging seam-pdf (and seam-excel) so I think I can provide significant testing feedback here.

albfernandez commented 4 years ago

Hi @stolp I've uploaded the source changes to migrate to openpdf. I've tested with the seam itext sample webapp and seems to work fine. I've attach the compiled code if you want to try it (you can also clone the repo and build by yourself if you like) Please tell me if you find any bug, or if it's ready for a realease. jboss-seam-pdf.jar.zip

stolp commented 4 years ago

Hi @albfernandez

Now that was quick, thank you very much!

I replaced the jboss-seam-pdf.jar, omitted itext and added current openpdf and openrtf libraries.

I still have exactly the same problem as described in LibrePDF/OpenPDF#351: All content inside p:html is completely missing from the output, everything else is rendering as expected.

Please let me now where I can help with this.

albfernandez commented 4 years ago

Can you provide an example please?

I'm trying this simple example and basic html is working : https://github.com/albfernandez/jboss-seam/blob/Seam_2_3_jee7/examples/itext/itext-web/src/main/webapp/html.xhtml

example_html_output.pdf

stolp commented 4 years ago

I did some further testing and it seems that all the rendered output is there but css styles are not applied. So I basically get white characters on a white background.

As the example is relying on default color values this is not apparent there,

I will try to attach a minimized example later today.

stolp commented 4 years ago

This is a sample template and the different output for IText and OpenPDF.

In the same application I am using OpenPDF successfully as a replacement for IText with Jasperreports and Primefaces. This is really weird.

Let me know what I can add or trace.

Report-IText.pdf Report-OpenPDF.pdf Report.txt

andreasrosdal commented 4 years ago

If you could please experiment with different OpenPDF versions, to determine which version of OpenPDF this change was introduced. Thanks!

(If this is a bug in OpenPDF, please report it as a big there.)

albfernandez commented 4 years ago

I've tested and can confirm it seems to work in openpdf 1.3.11 and fail in 1.3.12. I'm searching the exact change and I'll try to create a pull request to Opendf (or ar leats provide the exact error in openpdf and a test case)

stolp commented 4 years ago

I can verify that indeed the problem vanishes when rolling back OpenPDF to version 1.3.11.

I still have a font substitution problem here (One of my custom fonts is not rendered), but this can wait until I can verify against the HEAD version of OpenPDF.

You beat me there @albfernandez

albfernandez commented 4 years ago

Fixed in OpenPDF https://github.com/LibrePDF/OpenPDF/pull/378

stolp commented 4 years ago

I tested this today and can confirm that seam-pdf is now working perfectly with OpenPDF in my setup.

Thanks again @albfernandez