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

Allow PDF exports to be larger than 2GB

    XMLWordPrintable

Details

    • 1
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      Problem Definition

      Confluence fails when attempting a PDF space export which is larger than 2GB. If the PDF gets larger than 2GB, the exception below is thrown in the atlassian-confluence.log file:

      2019-05-28 10:56:55,254 ERROR [Long running task: PDF Space Export] [core.task.longrunning.AbstractLongRunningTask] doInTransactionWithoutResult Error during PDF export
       -- url: /spaces/flyingpdf/doflyingpdf.action | referer: https://baseurl/spaces/flyingpdf/flyingpdf.action?key=FTS | traceId: df54d5bdae3red4e48 | userName: admin | action: doflyingpdf
      java.lang.IllegalArgumentException: Size exceeds Integer.MAX_VALUE
      

      There is an error in the GUI, but is not clear why the error is occurring:

      This is caused by a 2GB limit for PDF exports, due to the libraries utilized.

      • Flying Saucer v9.1.6 library is used to render XHTML in memory for a space/page export.
      • Flying Saucer uses iText v2.1.7 library to export the rendered contents into a PDF file.
      • The iText library prior version 5.3 has the limitation of 2GB for generated files.
      • This limitation exists due to java.nio.channels.FileChannel limit of 2GB for memory mapped files.

      Suggested Solution

      One or more of the following options:

      • Improve the error message, which indicates the 2GB limit and update Confluence documentation to reflect the 2GB Limit.
      • Update Confluence to use a version of FlyingSaucer/iText that doesn't have the 2GB limit.
      • Update Confluence to export/compose the PDF to the file system and not directly to memory.

      Workarounds

      Split the larger spaces into smaller spaces.

      Additionally, we have tested a third party app that works with larger exports. Consider trying Content Exporter (Word, PDF, HTML) if you require a single PDF that will be larger than 2GB.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wlintz Wade Lintz (Inactive)
              Votes:
              15 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated: