Unable to Export to PDF due to Invalid CSS

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Symptoms

When exporting Page or Space to PDF, the following appears in the atlassian-confluence.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2012-09-26 22:48:02,605 ERROR [http-8443-8] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action -- url: /spaces/flyingpdf/pdfpageexport.action | userName: admin | referer: https://confluence/display/SANDBOX/Excel+Export+Test com.atlassian.confluence.importexport.ImportExportException: Exception while rendering the PDF document /opt/app/confluence/data/temp/pdfexport-20120926-260912-2248-1/SANDBOX-ExcelExportTest-260912-2248-2.pdf at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:111) at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:39) at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerPdfExporterService.createPdfForPage(FlyingSaucerPdfExporterService.java:78) at com.atlassian.confluence.extra.flyingpdf.ExportPageAsPdfAction.execute(ExportPageAsPdfAction.java:28) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165) at com.atlassian.confluence.core.ConfluenceWorkflowInterceptor.intercept(ConfluenceWorkflowInterceptor.java:64) .... Caused by: java.lang.IllegalArgumentException: Font size too small: 0.0 at com.lowagie.text.pdf.PdfContentByte.setFontAndSize(Unknown Source) at org.xhtmlrenderer.pdf.ITextOutputDevice.drawString(ITextOutputDevice.java:485) at org.xhtmlrenderer.pdf.ITextTextRenderer.drawString(ITextTextRenderer.java:42) ....

Cause

The export fails due to invalid Stylesheet set in your Confluence Admin or Space Admin.

Resolution

  • Remove the PDF Stylesheet in Confluence Admin > Global PDF Stylesheet and Space Admin > PDF Stylesheet

  • Try to export to PDF again

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.