HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › Can I create multipe line/row header or footer?
- This topic has 6 replies, 3 voices, and was last updated Sep 01, 2015
15:29:53 byPD4ML.
-
AuthorPosts
-
December 28, 2009 at 21:34#26309
I am trying to create a 2-line footer, and was just wondering if it’s possible, and if anyone had done it?
Thanks!example:
footer1footer2
December 29, 2009 at 16:20#27752I guess you mean non-HTML, non-inline headers.
In the case you may define title- or page-number-template with “n” as line break character (in some contexts you would probably need to add an extra backslash: “\n”).
And do not forget to allocate a sufficient space for the multiline header with areaHeight property.
January 4, 2010 at 18:44#27753it’s java.
footer.setAreaHeight( 15 );
footer.setFont(new java.awt.Font(“Arial”, java.awt.Font.PLAIN, 7));
footer.setColor( java.awt.Color.black );
footer.setPagesToSkip( 0 );
footer.setTitleTemplate( Title );
footer.setPageNumberTemplate( “277GG11-06” );
footer.setTitleAlignment( org.zefer.pd4ml.PD4PageMark.LEFT_ALIGN );
footer.setPageNumberAlignment(org.zefer.pd4ml.PD4PageMark.RIGHT_ALIGN);
pd4ml.setPageFooter( footer );
There is a footer called Title, and I need to add another footer above it.
Thanks!January 4, 2010 at 18:54#27754There is no way to define more than one footer with pd4ml.setPageFooter()
I would workaround that way:
…
footer.setAreaHeight( 30 );
footer.setTitleTemplate( “upper footer textn” + Title );
footer.setPageNumberTemplate( “n277GG11-06″ );
…Also PD4ML Pro allows you to define an inline footer, which will co-exist with your current footer.
August 24, 2015 at 20:38#27755Is this still intended to work? The code below does not result in newlines being entered into the footer.
August 24, 2015 at 20:46#27756@jf wrote:
Is this still intended to work? The code below does not result in newlines being entered into the footer.
Sorry, I forgot to submit the code:
PD4PageMark footer = new PD4PageMark();<br /> footer.setAreaHeight(100);<br /> footer.setTitleTemplate( "upper footer textn" + "TEST" );<br /> footer.setPageNumberTemplate( "n277GG11-06" );<br /> pd4ml.setPageFooter(footer);The rendered PDF displays a single line: “upper footer text TEST”
Using the pro version.
September 1, 2015 at 15:29#27757The best way would be to define header/footer in HTML, i.e.:
[language=java:g3o09eri]header.setHtmlTemplate(“page $[page] of $[total]
second line”);[/language:g3o09eri]However in text-only headers/footers ‘n’ character should break a line.
-
AuthorPosts
The forum ‘General questions / FAQ’ is closed to new topics and replies.
