PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 3:09 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Dec 06, 2017 9:03 pm 
Offline

Joined: Mon Oct 12, 2015 7:33 pm
Posts: 9
This is how we do:
1. Create a new Document();
2. Add sections/tables/charts/paragraphs to the last section of the Document (This is all done in memory).
3. Finally, we use DocumentRenderer to save the document.

This last step takes a lot of time to save the Document.

I was wondering if there is a better way in to render and save the PDF on disk as we add last sections.

Would really appreciate an example.


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 06, 2017 9:14 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
Hi!

Make sure you use a current version (1.50 beta 3 or beta 4).
See this post:
viewtopic.php?p=9380#p9380

See also:
viewtopic.php?f=2&t=832


njdotnetdev wrote:
This last step takes a lot of time to save the Document.
Whatever "a lot of time" may mean here.

njdotnetdev wrote:
2. Add sections/tables/charts/paragraphs to the last section of the Document (This is all done in memory).
We don't know how many tables or how many rows there are.

If the latest version is still too slow for you needs, feel free to run it in a profiler and optimise the code further.
My changes from 2015 reduced the time by factor 10 - not bad for a start.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


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 148 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