Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Keep together in PDF export

Karie Kelly
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 11, 2013

Has anyone had any success developing a user macro that will allow you to put the content inside it and ensure that on PDF export, there are never any page breaks within it. Often, we want to make sure specific text and an image always remain together when generating documentation.

We have a pagebreak user macro. But, this keep together macro is provides better support such that you don't have to keep testing your exports, especially as content changes, to insert/correct manual page breaks - it's alot less overhead to maintain your exports, especially with ever changing content.

4 answers

1 vote
Kirstin Seidel-Gebert
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2013

Hello Karie

You could try something like

<div style="page-break-inside: avoid;">
	$body
</div>

if you don't need extra functionality provided by the Adaptavist plugin.

Kirstin

0 votes
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2013

I am not aware of any real good solutions. I played around with different combinations of "page-break-before" and "...-after" plus manual page breaks. But I never managed to find a solution that would always work.

0 votes
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2013

I don't know the correct syntax for the user macro. But perhaps this is not the real problem.

Support for "page-break-inside" is limited on the browser side. Especially the value "avoid" seems not to be supported by Firefox, Chrome, and Safari (at least it is said so here). So perhaps this could cause your problems?

Karie Kelly
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2013

I hadn't realized that avoid wasn't supported, which, as you indicate, is probably the reason it is being ignored (I'm a mac user, so don't use IE). Are you aware of any other options?

0 votes
Karie Kelly
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 11, 2013

I did try something like this, but could never get it to work correctly:

## Macro name: keep-together
## Has body: YES, Unprocessed
## Generates: WIKI markup
### Requires: adaptavist-plugin-contentFormattingMacros (div macro)
{div:style="page-break-inside: avoid;"}${body}{div}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events