Problem with Page Breaks not Working

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
CherylN
Propeller Head
Posts: 34
Joined: Thu Sep 30, 2010 9:53 am

Problem with Page Breaks not Working

Post by CherylN »

Hi Everyone,

I am having a problem with page breaks. In my stylesheet, I have defined a style of Heading3.PageBreak. When this style is applied, the topic should start on a new page. The page-break-before is set to "Always". The page-break-after and page-break-inside are set to "Avoid". The only way I can get a topic to start on a new page is to change the Break Type on the Printed Output tab in the TOC. I have a lot of topics in this project and would like to avoid setting this for the topics in every TOC. Is there a setting that I missed somewhere?

Cheryl
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Problem with Page Breaks not Working

Post by LTinker68 »

First, generally it would be h3.PageBreak, as heading3 is not a valid HTML tag. So h3 is the tag and PageBreak is the class.

Second, when you create that style, make sure the Stylesheet Editor is set to the correct medium for your print output. By default, print targets are set to use the print medium, but if you created your own medium (e.g., printPDF), then make sure the Stylesheet Editor is set to that custom medium when you create or modify the style.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
CherylN
Propeller Head
Posts: 34
Joined: Thu Sep 30, 2010 9:53 am

Re: Problem with Page Breaks not Working

Post by CherylN »

The style is H3.PageBreak, not Heading3.PageBreak. I entered it wrong.

I have checked the Medium and it is set to "Print". Are there other options I can check?
SteveS
Senior Propellus Maximus
Posts: 2087
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Problem with Page Breaks not Working

Post by SteveS »

I'd try ressetting the page break after and page break inside properties to default, I'd even go as far as opening the stylesheet in a text editor and remove them manually.

I think you could use the page break before (always) setting in the default medium, not just restricting it to print. I always find that if I get too fancy with my use of mediums I get myself in all sorts of trouble...

While you have the stylesheet open in a text editor, check to see if you have page break properties set anywhere else. That can help track down what is happening and why.

After you make changes to the stylesheet, 'clean' the project before the next build or view, just in case something that's cached is causing the problem.

HTH
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
CherylN
Propeller Head
Posts: 34
Joined: Thu Sep 30, 2010 9:53 am

Re: Problem with Page Breaks not Working

Post by CherylN »

Thank you for the suggestions.

I am having problems changing the stylesheet. I am trying to change H3.PageBreak from "Avoid" to "Default" in the page-break-after and page-break-inside properties. The program keeps reverting back to "Avoid". I've also tried to change this in H3 and get the same results. When I use the text editor and view the html, those properties are not found. Do I need to set up the properties in the html (text editor) with "avoid" in the property?

I deleted the output files before building the pdf and that did not make a difference. I am not sure what you mean by "clean" the project.

Any other ideas or suggestions?

Cheryl
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Problem with Page Breaks not Working

Post by LTinker68 »

This is where the medium of the stylesheet can screw you up. If the page-break attribute is set in the default medium, then the print medium will inherit it. The only way to override the attribute's value in the print medium is to select a different value in the print medium. If setting the attribute's value to default results in "Avoid" appearing, then it sounds like you're trying to change it in the print medium when the default medium is set to "Avoid". Set the value in the default medium to "default" or "not set", whatever the choice is.

"Clean the project" is available under the Project tab, I believe. It deletes the output folder so that you're creating a clean build. It's more of an issue with online outputs, as doing that helps to trick some browsers into thinking they're going to a new site, so it loads the output from scratch instead of loading some things from the browser's cache.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
CherylN
Propeller Head
Posts: 34
Joined: Thu Sep 30, 2010 9:53 am

Re: Problem with Page Breaks not Working

Post by CherylN »

Thank you for the suggestions.

I "cleaned" the project. Using the text editor, I finally changed "Avoid" to "Default". This still did not work.

I started looking at the target. This is a long, convoluted pdf and the target was changed frequently to try to get various things to work. After taking a portion of the TOC and moving it to my "test" target, the output had the correct page breaks. Checked some of the other targets, and those seemed ok with some minor tweaking. I recreated the target with the problem and after running the build, the pdf had the appropriate page breaks. It seems that the problem was with the target, although I don't know what it was, but it seems that the problem is resolved. Thank you for your help.

Cheryl
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Problem with Page Breaks not Working

Post by LTinker68 »

Glad you got it working. There are PDF options in the target, so it's possible something was set in there, or perhaps someone had manually modified the target file and it was indeed corrupted.
CherylN wrote:Using the text editor, I finally changed "Avoid" to "Default". This still did not work.
FYI... "Default" is not a valid value for CSS attributes. If you see that in the Stylesheet Editor, then it's a visual clue that the attribute is using the CSS-specified default value for that attribute, not that the actual value is the word "default". When I said to set the value to default, I meant selecting that option in the Stylesheet Editor, which is the equivalent to deleting the line from the stylesheet file itself. Sorry, I should have been more explicit about that.

If you're in the text editor and you want to set the attribute back to what it should be by default, simply delete the entire line. Alternatively, give the attribute the value of inherit.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
CherylN
Propeller Head
Posts: 34
Joined: Thu Sep 30, 2010 9:53 am

Re: Problem with Page Breaks not Working

Post by CherylN »

I used the Text Editor and changed the parameter to "Inherit". Everything is still working.

Thanks for your help.

Cheryl
kel322
Propeller Head
Posts: 34
Joined: Tue Jan 03, 2017 12:56 pm

Re: Problem with Page Breaks not Working

Post by kel322 »

This forum is from quite a few years ago, but I just worked through an issue with page breaks in my PDF. Hopefully, this helps someone.

I had all <h1> headings set to have a page break before, but only some were working. I discovered that because my target has "Use TOC depth for heading levels" checked, it was seeing some of my <h1> headings as <h2> headings. So when I included the page break before with my <h2> css, my page breaks worked as planned.
Post Reply