PDFsharp & MigraDoc Foundation

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

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: Tue Nov 17, 2020 2:10 pm 
Offline

Joined: Wed Nov 04, 2020 10:23 am
Posts: 2
Dears,

I'm wondering if there's way to have an optimized RenderDocument method.
Maybe in an up-to-date version? Using nuget, I got version 1.50.5147.0.
Here's a part of my code to generate document:
Code:
public void Write(string pdfPath, PdfInformation info, PdfHeader header, PdfFooter footer, PdfBody body)
        {
            var document = new Document {Info = {Title = info.Title, Subject = info.Subject, Author = info.Author}};

            SetContent(document, header, footer, body);

            var renderer = new PdfDocumentRenderer
            {
                Document = document
            };
            renderer.RenderDocument();
            renderer.PdfDocument.Save(pdfPath);
        }

Using Performance monitor on VS2019, it is clear that RenderDocument takes 26000 ms. I'd like to add that my table got 8490 rows.
Thanks for your advices.

Kind regards


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 17, 2020 5:26 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
GLDavid wrote:
I'm wondering if there's way to have an optimized RenderDocument method.
I recommend the DIY approach: Take the latest source, run your code in a profiler, and look for bottle necks that can be improved.

I already tried my best:
viewtopic.php?p=9380#p9380

_________________
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 151 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