Does a page class or container tag exist for PDF export?

Dave C.'s Avatar

Dave C.

06 Jun, 2016 01:37 AM

I'd like to add a border around each page in a PDF document. Is there a tag that wraps each "page" or should I try writing a preprocessor to add it?

I will be using `hr` or `h2` page breaks in the prefs (unless there's an easier way).

  1. Support Staff 1 Posted by Brett on 06 Jun, 2016 02:00 AM

    Brett's Avatar

    There's really no good way to do this in the current setup. The PDF generator sees the document as one long element and splits it over pages, so at the time of rendering, the rectangles for each page aren't defined.

    -Brett

  2. 2 Posted by David Cross on 07 Jun, 2016 11:40 AM

    David Cross's Avatar

    Hi Brett,

    I was thinking a pre-processor that wrapped horizontal rules in tags (ie. `<\div>---------<div>` with returns in the right places). Then, size those divs with points (not pixels) in the print styles.

    Which leads to a secondary question: what measurement do the margins in prefs use. It doesn't specify.

  3. Support Staff 3 Posted by Brett on 07 Jun, 2016 12:36 PM

    Brett's Avatar

    The div plan is feasible, but it's going to be painful. Let me know if you figure out a solution.

    The margins in prefs are points that are passed to the print system the way a print setup dialog does. They're not CSS.

    -Brett

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac