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
XHTML element with attribute "id" throws an error #17
Comments
Because the iText dependency is old. @teemoo7 use this dependency import instead: ("pdf" %% "pdf" % "0.5").exclude("org.xhtmlrenderer", "core-renderer"), I exclude the one embedded in this library and specify the latest saucer release. Should be better to update the project build config. Cheers |
@diadys Thank you for the advice, your solution probably improves the general plugin behaviour but it still does not work with the ID attribute bug. Same error as before. Any help is welcome! |
@teemoo7 did you ever find a workaround for this? Hitting same issue with Play 2.2 |
For anyone getting bitten by the "id" problem, Flying Saucer PDF author has hard coded namespaces to true: Apparently this is, for some reason, what breaks .... based markup; see xerces user group:https://groups.google.com/d/msg/flying-saucer-users/3nzExUJ3kfY/qcnu_B3N6acJ I spent yesterday afternoon trying to work around the issue, but none of the configuration overrides took, the -Dxr java flag in particular. Anyway, my current use case for the plugin is generating customer invoices from a single template, so going with replacing "id" with "class" as the quick & dirty workaround for now. |
@diadys Unfortunately no, no good workaround. The only thing I do now, like @godenji , is to use the "class" attribute instead of the "id" attribute. Not perfect, but works out finely. |
I see the exception with play 2.1.5, but the exact same source code (with id attributes in the pdf templates) works like a charm if run with play 2.1.3. |
@teemoo7 @fhars @diadys and anyone else looking to use css
Without the above, namespace support is hard coded to true, which for some reason (Xerces?) breaks PDF generation when |
another way to work around is try to parse the xml document and then pass it to flying-saucer |
I updated all the dependencies to the most recent version. |
Hi, it sounds that since an element in the XHTML template has an "id" attribute, the PDF generation fails:
Console log:
Since I remove the "id" attribute, it works out finely. The XHTML template above is valid given http://validator.w3.org/check
The text was updated successfully, but these errors were encountered: