Force page title to be the highest heading level for a page

Comments

7 comments

  • Avatar
    Cassandra Targett

    As soon as I posted this, I had an idea and it seems to work.

    I added a style to the Static Pages definition to force a page break before the page title, and then removed the rule from my CSS to page break before every h1. Now I get the behavior I want for my scenario.

    For others who may be interested in the same, here is my definition for the 'Content' section of the Static Pages configuration:

    <div style ="page-break-before: always;">
    <h1>$page.title</h1>
    </div>

    0
    Comment actions Permalink
  • Avatar
    Selvakumar Samraj Eliyezar

    Thanks for the tip. It works.

    However I faced a problem.

    The page title now appears in the page that I'm exporting. However the "h2" headers are of the same size as the "h1" thus making the exported PDF look a bit weird with all the headers of the same size.

    I know I can tweak the css. But is there any other way to let the page title to be treated as a "h1" header?

    0
    Comment actions Permalink
  • Avatar
    Nils Bier

    Hi James,

    I don't know if I understand your problem right. Have you had a look at this page: http://www.k15t.com/display/PDF/Changing+the+Font+Size+on+the+Title+page
    Does this help?

    Why doesn't change the font size of h1 (respectively h2) via CSS work for you? If you'd provide some further information, I'd be happy to help.

    Cheers,
    Nils

    0
    Comment actions Permalink
  • Avatar
    Selvakumar Samraj Eliyezar

    Hi Nils,

    My page has the following structure:

    - Page title

      - h2 header

      - more h2 headers...

    When I export my page as PDF, without the "title" page, I don't get the page title listed anywhere. All my "h2" headers are exported as "h1" headers with page breaks.This is the structure of my exported PDF:

    - h1 header

    - more h1 headers...

     

    I understand this is the expected behaviour. So when I applied the "Static page" tweak, along with the css tweak to remove page break before "h1" headers, the page title appears as a "h1" header and so do my "h2" headers which are still treated as "h1" headers. So my exported PDF has the following structure now:

    - Page title (h1)

    - h1 header

    - more h1 headers...

     

    I understand, I can further tweak the css here to treat only the "page title" as "h1" and treat other "h1" (div.section1 h1) headers as h2.

    0
    Comment actions Permalink
  • Avatar
    Nils Bier

    Hi James,

    please try to add the placeholder "$page.title" to your Scroll PDF Exporter template.

    This placeholder will automatically get replaced with the pagetitle you start the export from.

    Does this information help?

    Cheers,Nils

    0
    Comment actions Permalink
  • Avatar
    Selvakumar Samraj Eliyezar

    Hi Nils,Thanks for the information. I'm already using it.
    It's okay, with a little css tweak, I think I can meet my requirement.

     

    0
    Comment actions Permalink
  • Avatar
    Ravi Teja

    Hi,

     

    Can you please let me know the tweak that you had implemented with css? I have the same concern with the PDF export :)

     

    Cheers,

    Ravi

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk