Confluence Page export to PDF cuts off left edge?
Asked by Mac Newbold:

I have a simple confluence page. No tables, just a table of contents at the top and some header hierarchy. Single column layout. When I export to PDF, all but the top header have the leftmost character or two cut off in the margin of the page. Any ideas why or how to fix it?


Answers:
author: Steve Ostopchuck
body: If it's of help to anyone, the below PDF Stylesheet CSS is fixing the issue for me:

(Space settings -\> Look and Feel -\> PDF Stylesheet)

[@pagetTeng](/t5/user/viewprofilepage/user-id/2589484)  
{  
size: 216mm 279mm;  
margin: 6mm;  
}

div.wiki-content {  
width: 190mm !important;  
align-self: center !important;  
margin: 18px !important;  
}

comments: author: jayant yadav
body: Thanks for the code! saved me a lot of time to change each page layout in order to export to PDF.


author: Jim Brashears
body: Saved me lots of time as well


author: James Garford
body: Thanks Steve!


author: George Smith
body: Special thanks, that worked :).


author: Anthony Clark
body: Perfect, that worked for me, and gave me a good starting point for further customizations. Thank you!


author: Alis-Hathway Ward (DO NOT USE)
body: same here. thanks!


author: ash.smith
body: Thank you so much! :))


author: Per Schrader
body: Thank you so much:-)


author: Prabhu Chilukuri
body: Above code is working fine for cuts off left edge. But now I am facing cuts off Right edges. Could you please assist me on this?


author: Suzy Rokke
body: This worked great! Thank you for sharing it. It worked both in space settings and in the master settings for the style sheets! Total lifesaver!


author: Zack Dorey
body: This worked for me. I would like to know in a bit more detail how we can use CSS in Spaces as this is a really handy tool and I think the would be a lot more you could do to make the Export to PDF look more like the original page on Confluence.


author: Jean
body: This worked for me as well. It's 2021 and this is still a problem.


author: Mitch Flindell
body: Hi there Atlassian, we have this issue on every PDF export we do in our team of 20. We're using confluence cloud and ive seen this issue for the last 3 months.

Is there really nothing you can do? It seems like a pretty simple and important thing to fix.

Cheers, have a lovely day

![Screen Shot 2020-01-06 at 9.50.20 am.png](https://community.atlassian.com/t5/image/serverpage/image-id/77882i71F45D72E731913C/image-size/large?v=v2&px=999 "Screen Shot 2020-01-06 at 9.50.20 am.png")


author: Jeff Krigstein
body: Hi Shannon,

I can confirm that this issue is still happening for us as well.

Even with the top CSS fix applied, it aligns the left side of the page but still cuts off on the right.

I agree with Greg and Jordan's frustration. A feature that doesn't work as indented isn't available.

Is there any news on this being fixed? Thanks for any information you can provide us with.

For reference, we are using Cloud.

-Jeff

comments: author: norton
body: Hi Jeff,

Just in case you haven't found a solution yet. I had the same problem with the right side being cut off with the above fix. I just edited the CSS since the page widths minus the margins were wrong. Code is below that worked for me, hope it helps.

{  
size: 216mm 279mm;  
margin: 6mm;  
}

div.wiki-content {  
width: 168mm !important;  
align-self: center !important;  
margin: 18px !important;  
}


author: Tom Vian
body: Worked perfectly - thanks


author: Jonathan Holdsworth
body: This is still broken a year later.

If the person you want to work with doesnt have a confluence licence or is a low level user there is literally nothing you can do to collaborate with them. I have invested so much time into Confluence I want to cry. I agree with Jordan Smith from over a year ago, this destroys the value of confluence.

comments: author: Carolina Rizzotto
body: agreed! i'm running into the same issue and it's ridiculous. when you export into Word doc though, you get the entire text... it just messes up the entire formatting of the document, which doubles up the work.


author: Laura Ortiz
body: Any updates? I wonder if there's a way to "fix" this by adding some CSS rules to the PDF Stylesheet.

comments: author: Shannon S
body: Hi Laura,

If you watch the bug ticket linked ([CONFCLOUD-59605](https://jira.atlassian.com/browse/CONFCLOUD-59605)), then you will receive any updates there once there is progress or any further workarounds.

If you want, you could also comment there with your question above about adding CSS rules; perhaps someone is able to help come up with a workaround using that theory.

Regards,

Shannon


author: Gregory Nash
body: It looks like you linked the wrong bug ticket. Here's the one that I'm watching:

<https://jira.atlassian.com/browse/CONFCLOUD-68183>


author: Shannon S
body: Whoops! Thank you for pointing that out, [@Gregory Nash](/t5/user/viewprofilepage/user-id/3554315)!


author: Shannon S
body: Mac,

Can you show us an example of what it looks like? Did you add any PDF Export customizations? What version of Confluence are you running?

Shannon

comments: author: Mac Newbold
body: Here are two examples. One when I export PDF using "Single Column" layout, which cuts off left edge, and one where the only change is to switch to "Full Width" layout, which works fine on paper, but is not very usable when viewed online on a wide screen, because it makes extremely long lines that are hard to read.

![screen at 2018-04-20 at 9.08.42 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/20233i7CEC9E90258B7D30/image-size/large?v=v2&px=999 "screen at 2018-04-20 at 9.08.42 AM.png")![screen at 2018-04-20 at 9.08.23 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/20234iE13485FFFA0635BA/image-size/large?v=v2&px=999 "screen at 2018-04-20 at 9.08.23 AM.png")


author: Shannon S
body: Thanks, Mac.

I tried to replicate this on my Confluence instance, single column layout, but I'm not able to.

Can you confirm your Confluence version? Maybe that makes a difference. Also, can you let me know if it happens on all pages or only certain ones? Do you have all custom PDF export CSS turned off?

Regards,

Shannon


author: Mac Newbold
body: We're using the Cloud version:  

### 1000.0.0-81f15a8ab0a {#toc-hId-1598608363}

No custom PDF export stuff, just totally vanilla.


author: Mac Newbold
body: Also confirmed It happens on other pages, not just this one.


author: Shannon S
body: Hi Mac,

Thank you for confirming.

So I'm not able to replicate this on my own instance, and as a support engineer, I'm also able to see the one that is associated with your email address. If that is the instance that you're having an issue with (vi\*\*\*\*.atlassian.net), I am also not able to replicate the issue there.

Can you just confirm, you're going to the page, click . . . and then select **Export to PDF**, correct? Using this method, I am not able to get any of the PDF cut off in the end result.

Are you able to provide me with the title of a page on your instance where you're currently able to replicate the issue? You can make a test page if you like so I can test with that.

Lastly, can you confirm this is happening in all browsers? I'm trying right now with the latest Google Chrome release.

Regards,

Shannon


author: Mac Newbold
body: Well they aren't much good to me when they're getting cut off, so I changed them back to full width instead of single column. Since this is a public forum I'm hesitant to post anything revealing here. Is there a private way to pass you the details?


author: Shannon S
body: Hi Mac,

This is why I suggested that you make a test page on your instance with a generic title, add some data to that page, and confirm that you have the issue there.

Then you can provide me with the name of the test page so I can have a look.

Can you also clarify what you mean by full width vs single column? When you enable single column in page layout, saving the page will remove that since a page is already in single column layout.

Regards,

Shannon


author: Mac Newbold
body: Okay, there are two demo pages here: [https://vivint.atlassian.net/wiki/spaces/\~358430864/pages](https://vivint.atlassian.net/wiki/spaces/~358430864/pages)

Here are screen shots of the PDFs I get out from Export PDF, using the method you describe above.

Below them is a screenshot of what I mean by Full Width vs Single column. To recreate, Edit a page. In the top bar, there's a Page Layout icon (box with two rectangles inside it). Click that, and it brings up the Layout bar, as shown in the screen shot. The first icon in the bar is the Full Width (default) layout, and I'm hovering over the Single Column layout.

The _only_ difference between these two pages, after I copied the Full Width one, is the title, changed for clarity, and the Layout switch.

Please confirm you can duplicate this.

Browser: I'm using Chrome Version 65.0.3325.181 (Official Build) (64-bit) on OSX at the moment, but since the PDF export happens on the server side, it doesn't seem to be dependent on my browser or OS.

![screen at 2018-04-24 at 5.08.01 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/20562iFD8F885F01DEB1DA/image-size/large?v=v2&px=999 "screen at 2018-04-24 at 5.08.01 PM.png")![screen at 2018-04-24 at 5.07.50 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/20563iFA6AF28A4616F632/image-size/large?v=v2&px=999 "screen at 2018-04-24 at 5.07.50 PM.png")![screen at 2018-04-24 at 4.49.45 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/20564i2A17E11A4E1EA0BE/image-size/large?v=v2&px=999 "screen at 2018-04-24 at 4.49.45 PM.png")


author: Shannon S
body: Thank you, Mac!

Apologies for that, as it appears the layout options had not been available in my Cloud instance (and of course not Server as it's not an offering for that). The previous *Single Column Layout* was what is now the *Full-Width Layout*. I do now see the options on your instance and I was able to test properly.

I searched this, and I found a bug ticket that sounded very similar to the issue you were encountering. I've cleaned it up a bit to describe the exact behavior and you can find the bug below:

* [CONFCLOUD-59001](https://jira.atlassian.com/browse/CONFCLOUD-59001)

I discovered that I am not able to replicate the issue with other page layouts as well. In addition, if I enter the text into a single Fixed Width table cell, I can somewhat replicate the appearance of a *Single Column Layout*. You can try this as well, but unfortunately, it will not work if you need to include another table inside of the layout.

Lastly, I noticed our documentation on [Add formatting to your page](https://confluence.atlassian.com/confcloud/add-formatting-to-your-page-724764836.html) does not mention the new version of *Single Column Layout* so I have requested a documentation update here. It's probably not relevant to you since you were already able to find it, but I'm including it in case other users do not know it's an option now:

* [CONFCLOUD-59605](https://jira.atlassian.com/browse/CONFCLOUD-59605)

Thank you for all your patience and help in tracking down the cause of this issue. I would recommend that you watch the bug so you can be updated of any changes. Do let us know if you have any questions!

Regards,

Shannon


author: Balirka
body: Hello,  

How is this low priority? Is this bug even close to getting into the dev pipeline?  

Exporting to PDF is like the only way to export the documents that are not looking like garbage.   

Cheers,  
Lovrenc


author: Shannon S
body: Hello there, [@Balirka](/t5/user/viewprofilepage/user-id/1272163)!

The bug is currently low because it hasn't been prioritized any differently. You can see the bug currently has 5 votes and 5 watchers, and so it can appear that not very many customers are running into this issue.

We prioritize bugs according to the following:

[Atlassian Bug Fixing Policy - How we approach bug fixing](https://confluence.atlassian.com/support/atlassian-bug-fixing-policy-201294573.html#AtlassianBugFixingPolicy-Howweapproachbugfixing)

I encourage anyone who has run into this issue to please vote on the bug to help show the number of users encountering it, watch it, and comment there with your findings. That will help us to properly prioritize the bug.

Thank you for your understanding!

Shannon


author: Jordan Smith
body: This should be high priority. It's honestly such a problem that we're considering moving our knowledge base to another platform. It's frankly unacceptable you'd let such a simple bug continue on like this. As it stands, your PDF export is BROKEN. You essentially have no PDF export.


author: Jordan Smith
body: Btw we're running the Server version, still garbage. Our CSMs have to manually rebuild our Confluence docs in Word or Google Docs in order to PDF them. Frankly it's ridiculous.


author: Aparna R
body: i too face the same issue: the left margin words are being cut off to 2 characters.

above mentioned code also doesn't work? any other fixes


author: Greg Macdonald
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046) According to the bug fixing policy you linked, this should be a Severity 2 because the feature is unavailable. And, by unavailable, I mean it does not produce a fully legible PDF document with all the words in it. It would be available if it actually worked, perhaps with cosmetic errors. But, missing data is not a cosmetic error. This is completely not usable. It is not available to us as a feature we can use. So, it is a Severity 2 bug... still after almost two years.


author: Shannon S
body: Hi Greg,

Thank you for bringing this to my attention.

Now, I can't say for sure since the development teams handle the prioritization of bugs and feature requests, but from what I can tell, it would likely be classified as a **Severity 3.** The reason is that the the PDF export feature itself is still available, and this issue is only encountered when using a specific page layout. If users weren't able to export to PDF at all, under any circumstance, it would be classified as Severity 2.

There also appears to be a workaround provided by [@Steve Ostopchuck](/t5/user/viewprofilepage/user-id/2717184) at the start of this thread. Were you able to test that?

Regards,

Shannon


author: Greg Macdonald
body: The hack works, but, we don't know yet what if anything it breaks. So, now we just need to apply that hack to every Space in our world and train all our users to set that up on each new Space they create. Well, we could wait until something doesn't work for them and they submit a help ticket and...

We also see that if the page does not have problems if we don't use any layout elements at all. But, if we use any, then the only space for single column content is between layout elements and this is the stuff that has the left edge clipped. And, since you have taken away the ability to add a layout element and set it to single column, there is no trick for laying out pages that avoids the problem.

The workaround is survivable for a short period. It has been a long time now. And the new page editor seems to drive us more often to hit this problem if you count on exporting documents to PDF, which we do. Come to find out, the workaround my folks have been using is to copy the entire page into a Word document, fixing it up there and exporting that to PDF. Yikes.


author: Shannon S
body: Hi Greg,

I'm testing this in my Global PDF Stylesheet, and when I apply it there, if I export the page again, it's not cut off. Can you try that and see if it prevents you from having to apply the workaround to each space?

I also wanted to mention that I tested this in the 2 and 3 column layouts on the new editor, and I was not able to replicate the issue there, only when using the old editor with the single column layout. Can you let me know under which circumstances the issue occurred for you?

As for the workaround, it appears to just be re-adjusting the margins, alignment, and font size. This shouldn't cause too many issues, but it's definitely a concern.

Regards,

Shannon


author: Greg Macdonald
body: I am unable to attach images here. When I click the Reply button the browser indicates it is waiting for Google Analytics and we never get past that.

Reproducing the failure is very simple.

1. Create a new page
2. type some stuff
3. Add a 2-column layout element
4. type some stuff in the layout element
5. publish the document
6. export the doc to pdf

Notice the stuff you entered outside the 2-col element is clipped on the left.

I guess the design intends to assume anything outside a layout element is single-column area. Which makes sense. But, since it doesn't work and there is no 1-column element for us to insert, the only workaround is to hack the CSS for every space


Tags: confluence-cloud

css

export

pdf