PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 6:21 pm

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: Sat Dec 03, 2011 11:06 pm 
Offline

Joined: Mon Nov 21, 2011 12:28 pm
Posts: 2
Hi!

I developed a software tool to create invoices. In many cases the invoice has several pages. The products that are in the invoice are printed in a big table which uses more than one page. The automatical page break works great.
I need to implement a page-summery for every page. This means that on every page there should be a footer with the summary of alle product prices on THIS page.
I had the idea to sum up the product prices for alle products on a page while rendering and printing the price sum in the footer. But while rendering I have no information about on which page the renderer is currently. Any ideas how to implement this?

Or any suggestion about a totally different way to create that summary?


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 05, 2011 12:49 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!

No simple solution available.

You can call "renderer.RenderPage" to create the document page by page. You can call "renderer.GetDocumentObjectsFromPage" to get the objects on that page. You can add Tags to all MigraDoc objects (e.g. "row.Tag = price;" or define a class if you need more than a single value).

Problem is that GetDocumentObjectsFromPage will return the whole table for every page where a part of the table appears.
You will need a GetRenderInfoFromPage routine to get the TableRenderInfo which contains a FormatInfo of type TableFormatInfo that contains startRow and endRow.
See here for "GetRenderInfoFromPage":
viewtopic.php?p=1960#p1960

Then you can get all the information you need to calculate the sum and draw on the page using PDFsharp routines after RenderPage drew the table.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 14, 2011 10:06 am 
Offline

Joined: Mon Nov 21, 2011 12:28 pm
Posts: 2
Now I got a solution in counting the printed table rows and adding a manual page break. Not a good solution but works :D


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 27, 2014 1:30 pm 
Offline

Joined: Fri Jan 25, 2013 7:20 am
Posts: 9
GetRenderInfoFromPage routine returns only the top-level objects and there is no solution to get all rendered objects?

e.g. currently I am searching for the rendered Textframe object inside an Paragraph element that is inside the primary footer.
GetRenderInfoFromPage returns two paragraph objects but I can't get 'down' to the text frame object inside one of them :(


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: No registered users and 45 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