Double pdf:pagenumber without linefeed before closing tag

249 views
Skip to first unread message

ofo

unread,
Jul 8, 2011, 2:22:14 PM7/8/11
to Pisa XHTML2PDF Support
Hi,
Awesome tool! A little odd behavior of the <pdf:pagenumber /> tag
causing double pagenumbers:

xhtml2pdf.exe filename.html

filename.html:

<html>
<head>
<style>
@page { @frame footer { -pdf-frame-content: footerContent; bottom:
1cm; height: 1cm; } }
</style>
</head>
<body>
<div id="footerContent">Page <pdf:pagenumber /></div>
</body>
</html>

renders: "Page 11" whereas

<html>
<head>
<style>
@page { @frame footer { -pdf-frame-content: footerContent; bottom:
1cm; height: 1cm; } }
</style>
</head>
<body>
<div id="footerContent">Page <pdf:pagenumber />
</div>
</body>
</html>

renders: "Page 1".

That is a newline is needed before the closing tag of the div (or p)
to avoid double line numbers.
May save someone else some time some time.

> xhtml2pdf.exe --version
XHTML2PDF/pisa 3.0.33 (Build 2010-06-16)

Same result with ho.pisa.CreatePDF (Windows XP, SP3).

Philippe Raoult

unread,
Jul 11, 2011, 5:29:44 AM7/11/11
to xhtm...@googlegroups.com
Might be just a parser quirk. In default mode self-closing tags aren't
recognized properly so the parser would probably add another pdf tag
right after ? This is on top of my head, I had similar issues with the
python API not the command line. Check for a command-line xhtml
option/flag.

> --
> You received this message because you are subscribed to the Google Groups "Pisa XHTML2PDF Support" group.
> To post to this group, send email to xhtm...@googlegroups.com.
> To unsubscribe from this group, send email to xhtml2pdf+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/xhtml2pdf?hl=en.
>
>

Josh Stratton

unread,
Jul 11, 2011, 9:33:04 AM7/11/11
to xhtm...@googlegroups.com
I believe I had a similar issue, where I had to the page number to
it's own line.
Reply all
Reply to author
Forward
0 new messages