PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Apr 30, 2024 12:59 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Sep 09, 2009 3:46 pm 
Offline

Joined: Tue Sep 01, 2009 8:36 pm
Posts: 4
Hello everyone - am using MigraDoc to generate tables and adding rows that are dynamically retrieved from a DB. I had problems getting the tables across multiple pages, but now that's solved. Now the issue is it takes a very long time (5-10 minutes)to create the PDF doc that has tables with hundreds and possibly thousands of rows across multiple pages. Below is what i am using:

- using the latest version 1.30, with the GDI+ build
- on a Windows XP machine with code in VB.NET
- PDFsharp to create the PDF file and MigraDoc to create the table, rows and edit cells
- font is regular Verdana size 9, all through the doc (except title which is bold size 10)
- adding the Table to the Section, using the Renderer to add the Section to PDF Document and saving the file

With thousands of rows, the PDF document fails to create and there is an error from Windows - "ContextSwitchDeadlock was detected" the CLR has been unable to transition from COM to COM context for 60 seconds...most likely processing a very long running operation without pumping Windows messages, etc etc..

But the same set of results export to MS Excel and Word in few seconds. Could any one of you who has seen similar issues suggest a solution. Any kind of input would be greatly appreciated.

Thanks..Raghu


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 10, 2009 7:33 am 
Online
PDFsharp Guru
User avatar

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

We know it's slow (on the list for the next version).

Using the Search function you'll find patches that shall make it faster.

Using a background thread you can keep pumping messages and avoid the error message.
You can create an event handler to display e. g. a progress bar.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 11, 2009 3:58 pm 
Offline

Joined: Tue Sep 01, 2009 8:36 pm
Posts: 4
Hi Thomas,

Thanks a lot for your suggestions.

For now, I have quickly added a progress bar to keep the user informed. I'l search for the patches and also will look into pumping messages to avoid error messages (need to find out how).

Ragu


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 30, 2009 6:22 pm 
Offline

Joined: Wed Sep 30, 2009 6:18 pm
Posts: 2
Thomas Hoevel wrote:
Hi!
Using the Search function you'll find patches that shall make it faster.


This is such a great document tool, but the speed is just a little too slow for my project (1-10 pages). I have done a search but cannot find any patches to make it a little faster. Can you point me to these patches?


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 01, 2009 7:59 am 
Online
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3097
Location: Cologne, Germany
Look here:
viewtopic.php?p=470#p470

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 01, 2009 12:11 pm 
Offline

Joined: Wed Sep 30, 2009 6:18 pm
Posts: 2
With some stumbling (I'm not that good with C#) I made this change and my PDF file with tables converted 3.5 times faster! Thanx. Are there any similar changes I can make to improve the speed further?

NOTE: I added my changed (v1.3) DLLs below in case anyone finds them useful. I'm kinda surprised there aren't more "interim" versions to help with this speed issue. Even if all areas of code aren't fixed, even small speed changes such as this can make a big difference.

Attachment:
migradocspeed.zip [157.01 KiB]
Downloaded 423 times


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

All times are UTC


Who is online

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