You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I try to convert an HTML with CDATA sections to PDF, I get a NullPointerException back. If one tries to execute the following snippet:
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.toStream(outputStream);
builder.withHtmlContent("<html><body><div><![CDATA[test]]></div></body></html>", "");
builder.run();
The following error will occur
Exception in thread "main" java.lang.NullPointerException
at com.openhtmltopdf.layout.BoxBuilder.doBidi(BoxBuilder.java:1250)
at com.openhtmltopdf.layout.BoxBuilder.createChildren(BoxBuilder.java:1207)
at com.openhtmltopdf.layout.BoxBuilder.createChildren(BoxBuilder.java:132)
at com.openhtmltopdf.render.BlockBox.ensureChildren(BlockBox.java:970)
at com.openhtmltopdf.layout.BoxBuilder.createChildren(BoxBuilder.java:1199)
at com.openhtmltopdf.layout.BoxBuilder.createChildren(BoxBuilder.java:132)
at com.openhtmltopdf.render.BlockBox.ensureChildren(BlockBox.java:970)
This happens because the paragraph splitter doesn't recognize CDATA sections as text. The pull request #15 fixes this issue.
The text was updated successfully, but these errors were encountered:
Whenever I try to convert an HTML with CDATA sections to PDF, I get a NullPointerException back. If one tries to execute the following snippet:
The following error will occur
This happens because the paragraph splitter doesn't recognize CDATA sections as text. The pull request #15 fixes this issue.
The text was updated successfully, but these errors were encountered: