How can I control page breaks when creating a pdf?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We had the same problem with Confluence, and we wrote a user macro to solve this.
Just go to Confluence Admin->User Macros and add a new Macro.
Give it a name (e.g. pagebreak), make sure it's visible to all users and you have No Macro Body selected. Then put the following in the macro body:
## Macro name: pagebreak
## Has body: NO
## Generates: HTML markup
<div id="pagebreak" style="page-break-before:always;"></div>
You can then insert the page break macro on your pages, wherever you want a page break in PDF.
Hope this helps.
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My Confluence Admin doesn't even _have_ a "User Macros" section! :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does not work in V5.8.4
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This might not be perfect, but it was the only way I could do it with limited permissions.
Insert a page break: A line with Heading 1 style and a non-breaking space. Use the Insert / Symbol menu and pick the first empty area. You can't use normal space as it will get removed as well as the line when you save.
Configure Table of Contents: Exclude \u00A0 to filter out all headings containing non-breaking space.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't get page breaks before H1s, so I guess this isn't going to work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The new confluence requires that a param be defined for it to be visible. Below code did the trick for us.
## Macro title: pagebreak
## Macro has a body: N
## Body processing: Selected body processing option
## Generates: HTML markup
## Output: Selected output option
##
## Developed by: YOUR NAME
## Date created: 19/09/2014
## Installed by: YOUR NAME
## @paramBreak:title=break|type=string|desc=default value|required=false|multiple=false|default=always
<div id="pagebreak" style="page-break-before:$paramBreak;"></div>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I tried your suggestion but it still gives me the below error: There are user macros without any metadata configured in their template. They have been highlighted below. For these macros to be available for use in content they require parameter information. See the Guide to User Macro Templates. Can you verify if our code is good: ## Macro title: pagebreak ## Macro has a body: N ## Body processing: Selected body processing option ## Generates: HTML markup ## Output: Selected output option ## ## Developed by: NEERAJ TIWARI ## Date created: 09/30/2014 ## Installed by: NEERAJ TIWARI ## @paramBreak:title=break|type=string|desc=default value|required=false|multiple=false|default=always <div id="pagebreak" style="page-break-before:$paramBreak;"></div>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
## Macro title: pagebreak ## Macro has a body: N ## Body processing: Selected body processing option ## Generates: HTML markup ## Output: Selected output option ## ## Developed by: YOUR NAME ## Date created: 19/09/2014 ## Installed by: YOUR NAME ## @param Break:title=break|type=string|desc=default value|required=false|multiple=false|default=always <div id="pagebreak" style="page-break-before:$paramBreak;"></div>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I added this snippet. What do I insert at the place where I want the page break to happen? Meaning how do I get the desired page break at the desired location after adding this code in the PDF stylesheet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Similar to the previous post - with the Content Formatting plugin installed, we simply use on the wiki page:
{div:class=pagebreak}{div}
In the PDF stylesheet (although I guess this could go in the global/space stylesheet?) we'd have:
div.pagebreak {
page-break-before: always;
}
You could also set the CSS to any element on the page... like h1 headings, which makes sense for reports.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
have a look to this page http://confluence.atlassian.com/display/DOC/Editing+the+PDF+Stylesheet
works fine with Confluence version 3.5.x too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This link no longer exists in the Confluence documentation. Did they take this feature away?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.