Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-29840

HTML Macro and PDF Export Limitations

    XMLWordPrintable

Details

    Description

      When you try to export a page with the below scripts to PDF file, you will face the following System Error:

      Cause
      com.atlassian.confluence.importexport.ImportExportException: Exception while rendering the PDF document D:\Confluence\data\temp\pdfexport-20130701-010713-1406-1\DCAM-CAConfigurationAutomation(CCA)SupportReadinessTraining-010713-1406-2.pdf
      at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:110)
      caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
      at java.lang.String.charAt(Unknown Source)
      Stack Trace:[hide]
      com.atlassian.confluence.importexport.ImportExportException: Exception while rendering the PDF document D:\Confluence\data\temp\pdfexport-20130701-010713-1406-1\DCAM-CAConfigurationAutomation(CCA)SupportReadinessTraining-010713-1406-2.pdf
      at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:110)
      at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:38)
      at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerPdfExporterService.createPdfForPage(FlyingSaucerPdfExporterService.java:78)
      at com.atlassian.confluence.extra.flyingpdf.ExportPageAsPdfAction.execute(ExportPageAsPdfAction.java:28)
      

      The script experiencing issues is attached as a text file in order to reproduce the same behaviour in different Confluence instances.

      *In this specific case the workaround is to remove the following code from the script:

       #cover {
              background: url("") no-repeat scroll center center #026890;
              position: absolute;
              color: #ffffff;
              height: 100%;
          }
      

      One of the customer also found out that @font-face rule in CSS is causing the same error too.

      Removing this will work to remedy the problem, but I believe Confluence needs to handle more gracefully PDF page export with HTML macro embedded.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gdecampos Giuliano C.
            Votes:
            5 Vote for this issue
            Watchers:
            15 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: