Code breaks across multiple pages in PDF output

Hi,

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?

5 answers

1 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?

Hello

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 vote
Davin Studer Community Champion 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.

https://marketplace.atlassian.com/plugins/com.atlassian.confluence.plugins.editor.confluence-source-editor

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": ["advertiser.com"]
     }
}]]></ac:plain-text-body>
</ac:macro>

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 Champion 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>
<ac:plain-text-body><![CDATA[]]></ac:plain-text-body>
</ac:macro>

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! 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

264 views 11 10
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you