PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Jun 04, 2024 5:41 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: Fri Dec 28, 2012 7:41 pm 
Offline

Joined: Fri Dec 28, 2012 12:12 am
Posts: 2
Location: Portland, OR
I am generating a report that pulls syslog events from a SQL database. Depending on the criteria, the report can get quite large. When I have run the report with a narrow criteria set (i.e. ~ 125 records returned), the page generates relatively quickly (< 1min for query and rendering). However, when I run the report with a wide criteria set (i.e. > 14000 records returned), the page seems to get stuck on the "DocumentRenderer.PrepareDocument()" command.

I have developed this as an ASP.NET application where the MigraDoc document is saved to a MemoryStream, then PDFSharp opens the stream and throws the document directly to the browser. It works wonderfully on small queries. It's the large queries that seem to be the issue. I've ran the code thru the debugger and can see it complete the query and build the table. It's just when it gets to the PrepareDocument step that it hangs up. It doesn't seem to be taking up a lot of memory. The w3wp process for the site only consumes about 256MB of memory and uses about 50% of the CPU, but I have let it run for > 30 minutes without any document being thrown back to the browser.

For reference, 125 records = ~1.5 pages. So, 14000 records should only be ~200 pages.

Any suggestions would be greatly appreciated.

Thanks,
Eric


Last edited by eacrittenden on Mon Dec 31, 2012 5:32 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 31, 2012 2:16 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 341
Table rendering is a bit slow with MigraDoc.
A faster table renderer is overdue, but is not yet available with PDFsharp/MigraDoc.

You can try the patch shown here:
viewtopic.php?p=1601#p1601

If you find that your code entered an endless loop in MigraDoc, please provide the MigraDoc team with e.g. the MDDDL file to replicate the problem so it can be fixed in future versions.
http://www.pdfsharp.net/wiki/MigraDocDDL.ashx

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 31, 2012 5:31 pm 
Offline

Joined: Fri Dec 28, 2012 12:12 am
Posts: 2
Location: Portland, OR
That updated dll that pakeha_by posted works perfectly. I was never able to get my 14k+ row query to ever finish rendering with the current v1.32 assemblies. With pakeha_by's patch, it rendered in <2 minutes.

Are there plans to incorporate those fixes into the official code/assemblies?

The patched code/assemblies are here (for anyone looking): http://www.pakeha_by.my-webs.org/MigraDocFastTableRender.html

Thanks,

Eric


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 02, 2013 6:07 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 341
eacrittenden wrote:
Are there plans to incorporate those fixes into the official code/assemblies?
There are plans (but currently no time frame) to make table rendering much faster while keeping full compatibility with existing code.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


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