Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Code breaks across multiple pages in PDF output


I'm using the code macro. When I create a PDF with the default Confluence settings, near the end of the code block the code breaks across 2 extra pages.

The odd thing is the page break starts more than halfway up the page. The empty space contains more than enough room for my remaining code, its just 3 lines.

What causes these excessively large page breaks and is there a fix for it?

6 answers

1 accepted

1 vote
Answer accepted

I found out this is a known bug in our version. The systems team has an upgrade scheduled.

Do you have a link you can share to the information about this known bug?


Tell me please if the issue is fixed?
I'm using version 5.4.3, and the error is present and prevents me to live ...

Was there a bug # that we could track from?

0 votes
Davin Studer Community Leader Feb 20, 2014

What version of Confluence are you using? I use the code macro and don't see that when I export to PDF. Have a look at your page source. Is there anything there that could be doing it? You'll need this plugin to see the source easily.

Hi Davin,

Thanks for the advice.

Regarding Confluence, we're using version 5.1-OD-6. This would indicate we have an "on-demand" version, but we migrated off that to hosted. This is kind of an odd set up. However, I'm not sure this is the problem. Other blocks of code in the code macro don't behave this way. Perhaps it's the length. The original code block is 77 lines long. I'll try with different code.

I did download the source plugin (great recommendation), however there's nothing unusual in the code that would inidcate "insert a weird page break here."

//more code above
"user": {
        "id": "xxxx",
        "buyeruid": "xxxxx",
        "data": [{
            "id": "ABC",
            "name": "XXXXX",
            "segment": [{
                "id": "ABC-123"
        "at": 2,
        "tmax": 30,
        "wseat": ["1", "2"],
		"cur": ["USD"], //breaks to new page here
        "bcat": ["IAB1", "IAB1-2"],
		"badv": [""]

What's weird here is the macro appears to be inserting the double ]] brackets before the closing angle > on the next to last line.

Davin Studer Community Leader Feb 20, 2014

The brackets are fine. That is part of the CDATA block ... it's and XML thing.

<ac:macro ac:name="code">
<ac:parameter ac:name="linenumbers">true</ac:parameter>
<ac:parameter ac:name="language">js</ac:parameter>

Not sure what to tell you if you don't see anything in the source that could be causing it. Maybe try rebuilding the page. Cut and past the content in notepad to strip and formatting and then rebuild it from scratch and see if it goes better.

We are experiencing the same issue here with code blocks spanning several pages ending with empty pages and the last two lines of code being put on the last page. We're currently running Confluence 5.4. Does anyone know if there is an ETA on the fix from the "systems team" Joe mentioned above? And is that the Atlassian systems team by the way?

I opened a ticket with Atlassian support. They indicated this problem is a confirmed bug and could be fixed by upgrading to the latest version. We haven't had a chance to perform the upgrade yet to verify.

Thanks for the speedy reply Joe.

We have had this bug since 3.1.1 and it is still present in 5.4 which we are running now. The latest version that I know of is 5.4.4, so if they fixed it between 5.4 and 5.4.4 that would be incredible.

I just read through all release notes from 5.4.1 to 5.4.4 and there is no mention of this bug being fixed unfortunately. I suppose we will update to 5.4.4 and test it, in case it was fixed and just not added to the release notes.

June 2017 and we're now running v6.1 and this is STILL an issue. My workaround is to manually break the code into page size blocks and tag the start with "cont." on the first line of each page that follows. Cludgy, but what else can we do, It makes is a mess to do HTML and PDF. I wish this bug would get resolved. Some of our long code blocks run fine and paginate beautifully, over three pages. Most not. DOH! A three year bug! HELP! 

This is still an issue.  

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

101 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you