PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Wed Dec 17, 2025 11:33 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Oct 29, 2012 8:14 pm 
Offline

Joined: Sun Oct 28, 2012 11:27 am
Posts: 6
Hi again,

I am creating a different type of list of artists and concerts now and would like the headers to to show the names of the first and the last artist on each page.

But as I don't know when a new page is starting I can't set the value for the first name on the page right.

I could try to count the lines but they have differing spacings and I think the renderer can do that a lot better..

So how can I tackle this problem? Is there maybe a callback for the renderer's page change event?

Thanks again for any hints,

Thomas


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 30, 2012 10:50 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3139
Location: Cologne, Germany
Hi, Thomas!
tawulf wrote:
Is there maybe a callback for the renderer's page change event?
None that I know.

You can add a tag to each paragraph - this tag could be a string with the artists name.

After layouting the document, you can use GetDocumentObjectsFromPage (or maybe GetRenderInfoFromPage) to find which tags are on which page.
Then create a new document with correct headers based on the information from the first run.

GetDocumentObjectsFromPage is public, so this is the preferred method.

See also (on how to make GetRenderInfoFromPage available):
viewtopic.php?p=1960#p1960

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 287 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