PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

Page numbering in PDFSharp
http://forum.pdfsharp.de/viewtopic.php?f=2&t=875
Page 1 of 1

Author:  PeterR [ Wed Sep 16, 2009 10:58 pm ]
Post subject:  Page numbering in PDFSharp

I want to add text like "page 1 of 4" to my document. I see several posts on doing this using MigraDoc, but how would I do it with PDFSharp or is it not possible?

Thanks
Peter.

Author:  Thomas Hoevel [ Thu Sep 17, 2009 8:08 am ]
Post subject:  Re: Page numbering in PDFSharp

PDFsharp is low-level PDF file generator and page numbering is your task (it's also your task to add page breaks).
MigraDoc is a high-level document generator with automatic page numbering.

Author:  PeterR [ Thu Sep 17, 2009 9:15 pm ]
Post subject:  Re: Page numbering in PDFSharp

Thanks for the reply.

I realize I need to "do this myself". The "page 1 of" part is easy, its inserting the 'totalpages counter' that I don't know how to do.

The PDF reference manual talks about "Variable Text" saying "...In some cases, however, the field may contain text whose value is not known until viewing time...." and goes on to say "...In such cases, the PDF document cannot provide a statically defined appearance stream for displaying the field; rather, the viewer application must construct an
appearance stream dynamically at viewing time..."

I assume it's these PDF features I'd be using, but how do I go about that with PDFSharp?

Thanks again.
Peter.

Author:  Thomas Hoevel [ Mon Sep 21, 2009 8:35 am ]
Post subject:  Re: Page numbering in PDFSharp

I think this can be solved much easier.

Just keep references to all pages you create - and create the page header/footer when all pages are done and you know how many pages you need.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/