Why Acrobat won't recognize CSS page break when creating PDF from HTML, but does if I print to PDF from a browser?

I need to keep the CSS page breaks AND also have it freshly created from HTML so I can use the "New Bookmark from Structure" function (which goes away once you save the PDF)

This is surprising since every other way to make a PDF (even 3rd party products) use the CSS page break. What can I do?

This is true for version 9 and X


Jim Picariello

1 Answer

I haven't tried converting any Web pages other than printing to PDF from the browser, so I can only theorize, but it might help.

1. Are you opening or importing the HTML with Acrobat in order to create the PDF?

2. Are the CSS page-break codes embedded directly in the HTML, or are they a style defined in a linked CSS file?

3. Whatever you're doing, are other CSS formatting instructions being followed, or is the conversion simply looking at the raw HTML and ignoring the CSS?

4. Are the page-breaks defined in a separate "for print only" section of the CSS?

If the conversion is only respecting SOME of the CSS formatting, it could be a difference between how linked CSS is treated compared to CSS in the HTML file.

If almost all formatting is being respected except what is in a special "print media" section of the CSS, then it could be that your "non-print" method for converting simply doesn't realize that it should think of itself as print media, and it's ignoring that one section of the CSS.

You could test this by making some really obvious formatting change just in the "print" section, like making all your text red or using a strange font for your title or headings. If that format command is also ignored when you open/import the HTML file (but works if you move it up to the main section of CSS), then you know that Acrobat is simply ignoring the "print media" section of CSS. There may not be a way around that, although you could try moving the page-break codes/style definition to the main part of the CSS and see what happens.


Please specify a reason: