Space export to PDF fails during conversion of intermediate HTML to PDF

Still need help?

The Atlassian Community is here for you.

Ask the community

 

 

 

Problem

When exporting a space to PDF the export progress stops and fails during {{Begin conversion of intermediate HTML to PDF}} of the export process. The following error will be in the UI:

Failed during PDF export. Exception message - Exception while rendering the PDF document <confluence_home>/temp/pdfexport-20161225-251216-1159-11/TEST-251216-1159-12.pdf

 

The following appears also in the atlassian-confluence.log file. Specifically the stacktrace below the Caused by referring tot he xhtml render issues.

2016-11-22 11:48:10,688 ERROR [Long running task: PDF Space Export] [core.task.longrunning.AbstractLongRunningTask] doInTransactionWithoutResult Error during PDF export
-- referer: http://localhost:8599/conf/spaces/flyingpdf/flyingpdf.action?key=TEST | url: /conf/spaces/flyingpdf/doflyingpdf.action | userName: admin | action: doflyingpdf
com.atlassian.confluence.importexport.ImportExportException: Exception while rendering the PDF document /Users/admin/atl/confluence/599/home/temp/pdfexport-20161122-221116-1147-11/TEST-221116-1147-12.pdf
     at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:102)
     at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerPdfExporterService.createPdfForSpace(FlyingSaucerPdfExporterService.java:73)
     at com.atlassian.confluence.extra.flyingpdf.PdfExportLongRunningTask$1.doInTransactionWithoutResult(PdfExportLongRunningTask.java:77)
[...]
Caused by: java.lang.NullPointerException
     at org.xhtmlrenderer.layout.Layer.paint(Layer.java:365)
     at org.xhtmlrenderer.layout.Layer.paintLayers(Layer.java:166)
     at org.xhtmlrenderer.layout.Layer.paint(Layer.java:353)
     at org.xhtmlrenderer.pdf.ITextRenderer.paintPage(ITextRenderer.java:505)
     at org.xhtmlrenderer.pdf.ITextRenderer.writePageByPage(ITextRenderer.java:302)
     at org.xhtmlrenderer.pdf.ITextRenderer.layoutAndPaint(ITextRenderer.java:329)
     at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:89)
     ... 12 more

Diagnosis

Environment

  1. The HTML macro is enabled

Cause

The XHTML renderer is experiencing problems with HTML somewhere in the space and is unable to export it.

Workaround

  1. Disable the HTML macros to successfully export the content
  2. Or remove the HTML content until you're able to find the offending content, however there could be multiple pieces of content causing issues

 

Last modified on Nov 2, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.