Skip to content

Improve neko-htmlunit usage in OpenPDF-html #998

Description

@andreasrosdalw

https://github.com/LibrePDF/OpenPDF/tree/master/openpdf-html

OpenPDF-html is an HTML-to-PDF rendering engine built on a modernized fork of Flying Saucer, designed to integrate seamlessly with the OpenPDF library and support HTML5 and CSS3 features. It now uses neko-htmlunit to parse the HTML.

@rbri I hope that you can please take a look at this OpenPDF-html project, maybe there is something we can improve in the way OpenPDF-html uses neko-htmlunit.

Activity

rbri commented on Jul 31, 2025

@rbri
Member

@andreasrosdal great, will have a look....

rbri commented on Aug 4, 2025

@rbri
Member

@andreasrosdal not sure why you closed this - currently took this as motivation to work a bit more on neko. Have added already a sax factory to be a bit more jdk like and some other stuff.
Have more on my list and will do a more detailed check for the correct setup of the parser.

andreasrosdalw commented on Aug 4, 2025

@andreasrosdalw
Author

I am glad you are interested in this! I think OpenPDF-html with neko-htmlunit as HTML parser can be quite successful in helping people create PDF files from HTML. I reopened this issue, not sure why I closed this either.

andreasrosdalw commented on Aug 14, 2025

@andreasrosdalw
Author

Any news on this? We are releasing openpdf 3.0 soon.

rbri commented on Aug 15, 2025

@rbri
Member

Hi @andreasrosdal,
sorry but as always i have too many things on my desk.

Spend some more minutes to think about and looking at the code. May impression is, the code uses the current neko parser to parse html/xhtml and xml.
In general we should not use neko for xml parsing.
And there is also a problem with html vs. xhtml. Xhtml needs some minor configuration tweeking (more or less disable some strange html stuff) (e.g. see nahsra/antisamy#531).
At least we have to think about this and maybe we can start with some unit tests checking for this kind o things.

rbri commented on Aug 15, 2025

@rbri
Member

@andreasrosdal if you have any idea how to place tests for the html/xhtml parsing please make a small sample and i will contribute something.

andreasrosdalw commented on Aug 21, 2025

@andreasrosdalw
Author

Please see LibrePDF/OpenPDF#1419
Making openpdf-html work with neko-htmlunit on Android would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions