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

Space/Page export to PDF takes too long and may failed if the page contain complex table

    XMLWordPrintable

Details

    Description

      STEPS TO REPLICATE

      1. Create a new Space in Confluence.
      2. Create a few page and insert multiple Table (table inside table) and some other macro in the table (such as Expand Macro) in every page as per storage format below:
      3. Save the page.
      4. Navigate to Space Tools > Content Tools > Export > PDF > Normal Export.

      EXPECTED RESULT
      The Space export to PDF will complete in time.

      ACTUAL RESULT

      1. The Space export to PDF will stuck at 50% simplifytabletext.xml with the message Begin conversion of intermediate HTML to PDF:
      2. No Error in the logs.
      3. Setting com.atlassian.confluence.extra.flyingpdf to DEBUG shows the following stack trace in the logs during the Space export to PDF:
        2018-03-08 21:33:03,026 DEBUG [Long running task: PDF Space Export] [extra.flyingpdf.html.RenderedXhtmlBuilder] renderToHtml Rendering to exported XHTML page id=1474562 (Export complex page)
        2018-03-08 21:33:03,227 DEBUG [Long running task: PDF Space Export] [extra.flyingpdf.html.AutoFontScaleUtils] scaleTableBaseOnNumberOfColumnsAndCharacter column count processing time : 5
        2018-03-08 21:33:03,822 DEBUG [Long running task: PDF Space Export] [extra.flyingpdf.html.AutoFontScaleUtils] scaleTableBaseOnNumberOfColumnsAndCharacter character count processing time : 595
        2018-03-08 21:33:04,052 DEBUG [Long running task: PDF Space Export] [extra.flyingpdf.html.AutoFontScaleUtils] scaleTableBaseOnNumberOfColumnsAndCharacter noOfTRCharacters 108
        2018-03-08 21:33:04,052 DEBUG [Long running task: PDF Space Export] [extra.flyingpdf.html.AutoFontScaleUtils] scaleTableBaseOnNumberOfColumnsAndCharacter numOfColumn 4
        2018-03-08 21:33:04,052 DEBUG [Long running task: PDF Space Export] [extra.flyingpdf.html.AutoFontScaleUtils] scaleTableBaseOnNumberOfColumnsAndCharacter colScaleFontSize 0.9
        2018-03-08 21:33:04,052 DEBUG [Long running task: PDF Space Export] [extra.flyingpdf.html.AutoFontScaleUtils] scaleTableBaseOnNumberOfColumnsAndCharacter chaScaleFontSize 1.0
        2018-03-08 21:33:04,053 DEBUG [Long running task: PDF Space Export] [extra.flyingpdf.html.AutoFontScaleUtils] scaleTableBaseOnNumberOfColumnsAndCharacter final 0.9
        2018-03-08 21:33:04,053 DEBUG [Long running task: PDF Space Export] [extra.flyingpdf.html.AutoFontScaleUtils] scaleTableBaseOnNumberOfColumnsAndCharacter column count processing time : 0
        2018-03-08 21:33:04,054 DEBUG [Long running task: PDF Space Export] [extra.flyingpdf.html.AutoFontScaleUtils] calculateLargestCellByColumns 4 Link
        

      Threaddump analysis found the RUNNABLE thread for rendering table cell:

      "Long running task: PDF Space Export" #275 prio=5 os_prio=31 tid=0x00007fbc4153d000 nid=0xb70f runnable [0x0000000206134000]
         java.lang.Thread.State: RUNNABLE
      	at org.xhtmlrenderer.layout.InlineBoxing.positionVertically(InlineBoxing.java:479)
      	at org.xhtmlrenderer.layout.InlineBoxing.saveLine(InlineBoxing.java:745)
      	at org.xhtmlrenderer.layout.InlineBoxing.layoutContent(InlineBoxing.java:228)
      	at org.xhtmlrenderer.render.BlockBox.layoutInlineChildren(BlockBox.java:955)
      	at org.xhtmlrenderer.render.BlockBox.layoutChildren(BlockBox.java:936)
      	at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:819)
      	at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:749)
      	at org.xhtmlrenderer.layout.BlockBoxing.layoutBlockChild0(BlockBoxing.java:293)
      	at org.xhtmlrenderer.layout.BlockBoxing.layoutBlockChild(BlockBoxing.java:271)
      	at org.xhtmlrenderer.layout.BlockBoxing.layoutContent(BlockBoxing.java:89)
      	at org.xhtmlrenderer.render.BlockBox.layoutChildren(BlockBox.java:939)
      	at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:819)
      	at org.xhtmlrenderer.newtable.TableRowBox.layoutCell(TableRowBox.java:453)
      	at org.xhtmlrenderer.newtable.TableRowBox.layoutChildren(TableRowBox.java:207)
      	at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:819)
      	at org.xhtmlrenderer.newtable.TableRowBox.layout(TableRowBox.java:89)
      	at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:749)
      	at org.xhtmlrenderer.layout.BlockBoxing.layoutBlockChild0(BlockBoxing.java:293)
      	at org.xhtmlrenderer.layout.BlockBoxing.layoutBlockChild(BlockBoxing.java:271)
      	at org.xhtmlrenderer.layout.BlockBoxing.layoutContent(BlockBoxing.java:89)
      	at org.xhtmlrenderer.render.BlockBox.layoutChildren(BlockBox.java:939)
      	at org.xhtmlrenderer.newtable.TableSectionBox.layoutChildren(TableSectionBox.java:136)
      	at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:819)
      	at org.xhtmlrenderer.newtable.TableSectionBox.layout(TableSectionBox.java:274)
      	at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:749)
      	at org.xhtmlrenderer.layout.BlockBoxing.layoutBlockChild0(BlockBoxing.java:293)
      	at org.xhtmlrenderer.layout.BlockBoxing.layoutBlockChild(BlockBoxing.java:271)
      	at org.xhtmlrenderer.layout.BlockBoxing.layoutContent(BlockBoxing.java:109)
      	at org.xhtmlrenderer.render.BlockBox.layoutChildren(BlockBox.java:939)
      	at org.xhtmlrenderer.newtable.TableBox.layoutChildren(TableBox.java:312)
      	at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:819)
      	at org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:749)
      	at org.xhtmlrenderer.newtable.TableBox.layoutTable(TableBox.java:278)
      	at org.xhtmlrenderer.newtable.TableBox.layout(TableBox.java:231)
      

      WORKAROUND
      Simplify the table by removing the first layer of the table in the page as per the simplify page storage format below:

      Attachments

        1. Comp_950326306277477082dbf555a86dafc0-051223-1459-4.pdf
          8 kB
        2. complextabletext.xml
          20 kB
        3. dumps.zip
          72 kB
        4. simplifytabletext.xml
          18 kB
        5. spaceexport.png
          spaceexport.png
          47 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dazmi Dayana
              Votes:
              20 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated: