Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #26331

    Is there any way to use CSS in the header? I would like to use a background color. Thanks!

    #27847

    Yes. For example try to define the header like that:

    <div style="width: 100%; background-color: tomato">
    Header text: $[page] of $[total]
    </div>

    #27848

    I think I see what you are saying here. Now my question is: can I have dynamic content in the header based on what is in a variable as the page is being rendered?
    The value of myVar will change as the page is being rendered.

    <pd4ml:page.header scope="2+">
    <%=myVar%>
    </pd4ml:page.header>

    I am new to PD4ML — thanks for the help!

    #27849

    It is easy to mix different methods to define HTML headers in PD4ML.

    So first please take a look to the following topic:
    html-pdf-faq-f1/pdf-page-headers-footers-definition-options-t41.html

    In the code

    <pd4ml:page.header scope="2+">
    <%=myVar%>
    </pd4ml:page.header>

    <%=myVar%> will be substituted with myVar value before the document is passed to PD4ML. So from PD4ML perspective it is going to be a static text (value). The only variable dynamically changes its value from page to page is $[page]

    To define different headers for different pages you need to do something like that:

    <pd4ml:page.header scope="2">
    <%=myVar%>
    </pd4ml:page.header>
    <pd4ml:page.header scope="3-5">
    <%=myAnotherVar%>
    </pd4ml:page.header>
    <pd4ml:page.header scope="6+">
    yet another var or static text
    </pd4ml:page.header>

    #27850

    That is what I needed to know – I really think it is a great product!

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘General questions / FAQ’ is closed to new topics and replies.