Keeping sections together in a PDF file

Michele C November 14, 2011

Our wiki consists of various topics. Each topic has a header, a screen shot of the dialog, and a table that explains the options in the screen shot. When I export the space into a PDF file, the heading appears on one page, and then then the screen shot appears on the second page.

Example of page 1:

Heading 1

Screen shot

Heading 1

Page 2:

Screen shot

Heading 1

Page 3:

Screen shot

In RoboHelp, I was able to keep topic headings with the screen shot. This was similar to using "Keep with next" section breaks in MS Word. If the screen shot did not fit on the first page, the heading 1 would appear on the second page with the screen shot.

I found some information in the wiki user reference documentation that shows how to edit the PDF style sheet and create a page break after each topic. This does not solve the issue. I am left with topic headings that appear on a page by itself.

  1. .pagetitle
  2. {
  3. page-break-before: always;
  4. }

I could possibly change the page top/bottom margins, but I don't think that will work. Basically, I want to keep the heading so that it appears on the next page with the screen shot.

Are there any suggestions on how I would be able to use "Keep with next" like I would in MS Word?

2 answers

0 votes
tk385 December 5, 2014

I have the same need.  Whenever I include a large screenshot, it flows to the next page while leaving the description paragraph in prior page.  

Is there any solution?

0 votes
Sander Brienen [Avisi]
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.
November 14, 2011

The 'keep with next' is not really implemented. What I normally use to force a page-break in the pdf document is the {divbox} macro, like {divbox:class=pagebreak}{divbox}. The class pagebreak is then a (custom) css class in your PDF stylesheet with a page-break-before.

But we have also implemented the pagebreaks on PDF's. You should then set the page-break-before style on the h1 tag instead of the pagetitle class, like:

h1 {

page-break-before: always;

}

Michele C November 16, 2011

The solution helped, but I am still having some issues. In the PDF, I am actually using H1, H2, H3. I inserted page breaks on H1, but it caused some issues where there was H3 on a page, and a screen shot on the next page.

I then tried using a page break on H1 and on H3. That almost solved the problem. I skipped through the document and I have some blank pages. I think it's because there is some white space and then it breaks when it find the H3 heading.

I think I may need to manually insert the page breaks within the document using a macro. I am not sure if that would still fix the problems with the blank pages that end up in the PDF file.

Is there a feaure request for "keep with next"? If so, what is the status in having it implemented?

Michele C November 29, 2011

I tried using a page break. I still end up with a heading on one page and an image on the next page.

Is there a feaure request for "keep with next"? If so, what is the status in having it implemented?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events