Page break in PDF

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Page break in PDF

Unread post by John Johann »

V7.3.6 Build 4521
I have a project for CHM and pdf output.
Some topics for structural purposes (not top level) in the TOC are empty.

Code: Select all

<topic template="Default" lasteditedby="Me" version="2">
  <title>Title for structuring</title>
  <body>
    <header>
      <para styleclass="Heading1">Title for structuring</para>
    </header>
    <para styleclass="PageBreak" style="page-break-before:always;"></para>
    <para styleclass="PageBreak"></para>
    <para styleclass="Normal"><conditional-text type="IF" value="CHM,HTML,EBOOK"/><text styleclass="Normal" style="font-weight:bold;">See:</text></para>
    <para styleclass="Normal"><link displaytype="text" defaultstyle="true" type="topiclink" href="Subchapter1"><%TARGETTITLE%></link></para>
    <para styleclass="Normal"><link displaytype="text" defaultstyle="true" type="topiclink" href="Subchapter2"><%TARGETTITLE%></link></para>
    <para styleclass="Normal"><link displaytype="text" defaultstyle="true" type="topiclink" href="Subchapter3"><%TARGETTITLE%></link><conditional-text type="END"/></para>
  </body>
</topic>
The styleclass "PageBreak" is defined with a tiny font size and no spacing. If I enclose those two lines in an IF PDF condition, the page break is lost. If I only insert one line with the page break, it is ignored.

What is the elegant solution here (while keeping empty topic :-))?
User avatar
Tim Green
Site Admin
Posts: 23154
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Page break in PDF

Unread post by Tim Green »

Hi John,

You don't need to enclose the page break paragraph in a condition because page breaks are ignored in all output formats except PDF and DOCX anyway. Losing the page break when it is directly followed by a conditional tag is a known limitation. You can get around it by inserting a single space directly before the opening IF tag, which will look like this in the XML:

</header>
<para styleclass="Normal" style="page-break-before:always;"><text styleclass="Normal" translate="true">&#32;</text><conditional-text type="IF" value="CHM,HTML,EBOOK"/><text styleclass="Normal" style="font-weight:bold;" translate="true">See:</text></para>
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: Page break in PDF

Unread post by John Johann »

Hi Tim,
Thanks.
I knew there was a reason why I had created the mini page break style --> to reduce the space between the header and the subchapter as otherwise the paragraph is formatted the same as the IF condition.

So for the moment, I insert one page break style paragraph with a space and the page break above the IF condition.
Post Reply