NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Original Description

      Long words are being cut off in a PDF export. This causes problems for languages where spaces are uncommon, such as Japanese.

      Work around

      Note: In order to break long words in the PDF export a selector containing the word-wrap property with a value of break-word has to be added to the PDF stylesheet:

      http://confluence.atlassian.com/display/DOC/Editing+the+PDF+Stylesheet

      For example:

      div {  
          word-wrap: break-word;  
      }
      

        1. drawback-of-table-layout-fixed.png
          drawback-of-table-layout-fixed.png
          15 kB
        2. Sample_Linebreaks.pdf
          15 kB
        3. still not working.png
          still not working.png
          68 kB

            [CONFSERVER-24533] Long words fail to wrap in PDF export

            John Couch added a comment -

            This is not resolved in latest release. Code snippets are being cut off even when word wrap is enabled. 

             

            John Couch added a comment - This is not resolved in latest release. Code snippets are being cut off even when word wrap is enabled.   

            I've resolved this issue because a fix (similar to the workaround that aragot described in his comment) was implemented in Confluence 4.2.

            As pointed out in the comments, this change did have some impacts:

            • It surfaced a different bug in the word-wrapping algorithm where a single word is unnecessarily forced to break over two lines - CONF-26230
            • Exported tables are full-width - CONF-25233

            Unfortunately, these issues remain open as we have yet to come up with a technical solution that addresses all four of the following concerns:

            1. Wide tables shouldn't be truncated in the export
            2. Content shouldn't overlap adjacent columns
            3. Content should only wrap by 'breaking' words when absolutely necessary
            4. Columns shouldn't be any wider than they need to be

            Thank you for your patience, and please continue to watch and vote on the issues that are impacting you. In the absence of a perfect solution, this will help us prioritise the changes we can make to improve the status quo.

            edith (Inactive) added a comment - I've resolved this issue because a fix (similar to the workaround that aragot described in his comment ) was implemented in Confluence 4.2. As pointed out in the comments, this change did have some impacts: It surfaced a different bug in the word-wrapping algorithm where a single word is unnecessarily forced to break over two lines - CONF-26230 Exported tables are full-width - CONF-25233 Unfortunately, these issues remain open as we have yet to come up with a technical solution that addresses all four of the following concerns: Wide tables shouldn't be truncated in the export Content shouldn't overlap adjacent columns Content should only wrap by 'breaking' words when absolutely necessary Columns shouldn't be any wider than they need to be Thank you for your patience, and please continue to watch and vote on the issues that are impacting you. In the absence of a perfect solution, this will help us prioritise the changes we can make to improve the status quo.

            Karie Kelly added a comment - - edited

            I attached the still not working.png which shows that I still have the problem. However, my issue is the opposite. The words are breaking ... I don't want them to wrap. However, my original support ticket, JST-40432 , was linked to this. But, I really have a different issue - it is breaking when it shouldn't.

            Karie Kelly added a comment - - edited I attached the still not working.png which shows that I still have the problem. However, my issue is the opposite. The words are breaking ... I don't want them to wrap. However, my original support ticket, JST-40432 , was linked to this. But, I really have a different issue - it is breaking when it shouldn't.

            Karie Kelly added a comment - - edited

            My other comment is the significance of this. We had one of our employees export out a document to send to a customer and didn't catch these breaks. The result was providing unprofessional documentation out to the customer because he didn't catch that some of the words were breaking inside a table and the content was several pages long. My manager was none too pleased. Another two hours was spent just trying to get the information to export correctly, without any breaks. Since this was a VP spending 2 hours of his time doing it...he was none too happy and nor pleased that such a critical use of a Wiki solution was having such basic issues. If you cannot generate accurate PDFs, the solution is not usable. Would an Atlassian VP be happy about spending two hours, rewriting content, just to make it look presentable to Atlassian customers?

            Karie Kelly added a comment - - edited My other comment is the significance of this. We had one of our employees export out a document to send to a customer and didn't catch these breaks. The result was providing unprofessional documentation out to the customer because he didn't catch that some of the words were breaking inside a table and the content was several pages long. My manager was none too pleased. Another two hours was spent just trying to get the information to export correctly, without any breaks. Since this was a VP spending 2 hours of his time doing it...he was none too happy and nor pleased that such a critical use of a Wiki solution was having such basic issues. If you cannot generate accurate PDFs, the solution is not usable. Would an Atlassian VP be happy about spending two hours, rewriting content, just to make it look presentable to Atlassian customers?

            In response to the last comment, even if you don't put the layout instructions in the CSS, the export still always exports tables with columns of fixed width. That is a separate improvement request that was logged.

            Is this issue suppose to correct the general issue of any word breaking in a pdf export? For example, the text, the, breaks th on one line and e on another. We have the same issue with text in table cells. If the text has any format (bold/underline/italicize), the words break in the cell.

            Karie Kelly added a comment - In response to the last comment, even if you don't put the layout instructions in the CSS, the export still always exports tables with columns of fixed width. That is a separate improvement request that was logged. Is this issue suppose to correct the general issue of any word breaking in a pdf export? For example, the text, the, breaks th on one line and e on another. We have the same issue with text in table cells. If the text has any format (bold/underline/italicize), the words break in the cell.

            Although I can't think of an alternative, I just want to point out a drawback to aragot's workaround in the above comment.

            By forcing the word-wrap: break-word property through a fixed table layout, the resulting export will divide the column widths evenly. Users don't have the ability to specify column widths, so in some cases this will result in wasted horizontal space (see the attached screenshot).

            edith (Inactive) added a comment - Although I can't think of an alternative, I just want to point out a drawback to aragot 's workaround in the above comment . By forcing the word-wrap: break-word property through a fixed table layout, the resulting export will divide the column widths evenly. Users don't have the ability to specify column widths, so in some cases this will result in wasted horizontal space (see the attached screenshot ).

            Hi Stanislav,
            What happens if you add the following items to your PDF stylesheet?

            table 
            {
                table-layout: fixed;
                width:100%;
            }
            
            p, td, th {
                word-wrap: break-word;
            }
            

            AdrienA (Inactive) added a comment - Hi Stanislav, What happens if you add the following items to your PDF stylesheet? table { table-layout: fixed; width:100%; } p, td, th { word-wrap: break -word; }

            Anatoli added a comment - - edited

            Hi Stanislav, thanks for your comment. The latest fix didn't really fix the problems you mentioned. Will reopen this issue (the screenshot with the problem: http://screencast.com/t/afCtpUn1u).

            Anatoli added a comment - - edited Hi Stanislav, thanks for your comment. The latest fix didn't really fix the problems you mentioned. Will reopen this issue (the screenshot with the problem: http://screencast.com/t/afCtpUn1u ).

            @Anatoli Kazatchkov - Workaround described in CONF-16833 does not work in many instance. For example, it does not work in the notes body, in tables generated by macro and most Adaptavist layouts.
            Should I add this to CONF-16833 or create new issue report?

            Stanislav Kalianov added a comment - @Anatoli Kazatchkov - Workaround described in CONF-16833 does not work in many instance. For example, it does not work in the notes body, in tables generated by macro and most Adaptavist layouts. Should I add this to CONF-16833 or create new issue report?

            Anatoli added a comment -

            Hi Stanislav, this issue will be fixed in Confluence 4.2. We are unlikely to port it back to 3.5.x as there is an easy workaround for it.

            Anatoli added a comment - Hi Stanislav, this issue will be fixed in Confluence 4.2. We are unlikely to port it back to 3.5.x as there is an easy workaround for it.

              etom edith (Inactive)
              mseager Michael S
              Affected customers:
              5 This affects my team
              Watchers:
              13 Start watching this issue

                Created:
                Updated:
                Resolved: