PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 28, 2024 8:56 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Sep 16, 2009 10:58 pm 
Offline

Joined: Wed Sep 16, 2009 10:36 pm
Posts: 2
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.


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 17, 2009 8:08 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 17, 2009 9:15 pm 
Offline

Joined: Wed Sep 16, 2009 10:36 pm
Posts: 2
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 21, 2009 8:35 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 343 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group