Hello,
I have a question related to export to pdf. I am using SmartGWT 5.1p.
I have the following simple HTML. The path to the image is not correct, but I would like to export it either way to pdf, skipping the image.
<html>
<body>
Text in here 2<br/>
<img src="img/image_name_in_here.gif" alt="Alternate Text" />
</body>
</html>
If I use RPCManager.exportContent I get the following warning: “Builtin RPC: getPdfObject: Server returned FAILURE with no error message performing operation 'custom'.” and no errors in the server console.
If I use PdfExport- getPdfRenderer I get an error (caused by the path of the image that does not exist).
ITextRenderer renderer = export.getPdfRenderer(html, settings);
renderer.createPDF(file);
java.lang.NullPointerException
at com.isomorphic.contentexport.B64ImgReplacedElementFactory.createReplacedElement(B64ImgReplacedElementFactory.java:146)
at org.xhtmlrenderer.render.BlockBox.calcDimensions(BlockBox.java:674)
at org.xhtmlrenderer.render.BlockBox.calcDimensions(BlockBox.java:628)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:763)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:732)
at org.xhtmlrenderer.layout.InlineBoxing.layoutInlineBlockContent(InlineBoxing.java:393)
at org.xhtmlrenderer.layout.InlineBoxing.layoutContent(InlineBoxing.java:290)
at org.xhtmlrenderer.render.BlockBox.layoutInlineChildren(BlockBox.java:938)
at org.xhtmlrenderer.render.BlockBox.layoutChildren(BlockBox.java:919)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:802)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:732)
at org.xhtmlrenderer.layout.BlockBoxing.layoutBlockChild0(BlockBoxing.java:293)
at org.xhtmlrenderer.layout.BlockBoxing.layoutBlockChild(BlockBoxing.java:271)
at org.xhtmlrenderer.layout.BlockBoxing.layoutContent(BlockBoxing.java:89)
at org.xhtmlrenderer.render.BlockBox.layoutChildren(BlockBox.java:922)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:802)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:732)
at org.xhtmlrenderer.pdf.ITextRenderer.layout(ITextRenderer.java:209)
at com.isomorphic.contentexport.PdfExport.getPdfRenderer(PdfExport.java:347)
If I do not use PdfExport and create a new ITextRenderer it will work correctly.
ITextRenderer renderer = new ITextRenderer();
renderer.setDocumentFromString(html);
renderer.layout();
renderer.createPDF(file);
Is there a parameter that I can set on the settings map so that PdfExport – getPdfRenderer will work the same as creating a new ITextRenderer.
Thank you very much for your help,
Andreea
I have a question related to export to pdf. I am using SmartGWT 5.1p.
I have the following simple HTML. The path to the image is not correct, but I would like to export it either way to pdf, skipping the image.
<html>
<body>
Text in here 2<br/>
<img src="img/image_name_in_here.gif" alt="Alternate Text" />
</body>
</html>
If I use RPCManager.exportContent I get the following warning: “Builtin RPC: getPdfObject: Server returned FAILURE with no error message performing operation 'custom'.” and no errors in the server console.
If I use PdfExport- getPdfRenderer I get an error (caused by the path of the image that does not exist).
ITextRenderer renderer = export.getPdfRenderer(html, settings);
renderer.createPDF(file);
java.lang.NullPointerException
at com.isomorphic.contentexport.B64ImgReplacedElementFactory.createReplacedElement(B64ImgReplacedElementFactory.java:146)
at org.xhtmlrenderer.render.BlockBox.calcDimensions(BlockBox.java:674)
at org.xhtmlrenderer.render.BlockBox.calcDimensions(BlockBox.java:628)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:763)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:732)
at org.xhtmlrenderer.layout.InlineBoxing.layoutInlineBlockContent(InlineBoxing.java:393)
at org.xhtmlrenderer.layout.InlineBoxing.layoutContent(InlineBoxing.java:290)
at org.xhtmlrenderer.render.BlockBox.layoutInlineChildren(BlockBox.java:938)
at org.xhtmlrenderer.render.BlockBox.layoutChildren(BlockBox.java:919)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:802)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:732)
at org.xhtmlrenderer.layout.BlockBoxing.layoutBlockChild0(BlockBoxing.java:293)
at org.xhtmlrenderer.layout.BlockBoxing.layoutBlockChild(BlockBoxing.java:271)
at org.xhtmlrenderer.layout.BlockBoxing.layoutContent(BlockBoxing.java:89)
at org.xhtmlrenderer.render.BlockBox.layoutChildren(BlockBox.java:922)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:802)
at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:732)
at org.xhtmlrenderer.pdf.ITextRenderer.layout(ITextRenderer.java:209)
at com.isomorphic.contentexport.PdfExport.getPdfRenderer(PdfExport.java:347)
If I do not use PdfExport and create a new ITextRenderer it will work correctly.
ITextRenderer renderer = new ITextRenderer();
renderer.setDocumentFromString(html);
renderer.layout();
renderer.createPDF(file);
Is there a parameter that I can set on the settings map so that PdfExport – getPdfRenderer will work the same as creating a new ITextRenderer.
Thank you very much for your help,
Andreea
Comment