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

Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

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:

1 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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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

Cause

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

Solution

Workaround

  1. Disable the HTML Macro 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

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.