PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Tables with several pages taking too long!!
https://forum.pdfsharp.net/viewtopic.php?f=2&t=865
Page 1 of 1

Author:  ragu [ Wed Sep 09, 2009 3:46 pm ]
Post subject:  Tables with several pages taking too long!!

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

Author:  Thomas Hoevel [ Thu Sep 10, 2009 7:33 am ]
Post subject:  Re: Tables with several pages taking too long!!

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.

Author:  ragu [ Fri Sep 11, 2009 3:58 pm ]
Post subject:  Re: Tables with several pages taking too long!!

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

Author:  kinglerch [ Wed Sep 30, 2009 6:22 pm ]
Post subject:  Re: Tables with several pages taking too long!!

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?

Author:  Thomas Hoevel [ Thu Oct 01, 2009 7:59 am ]
Post subject:  Re: Tables with several pages taking too long!!

Look here:
viewtopic.php?p=470#p470

Author:  kinglerch [ Thu Oct 01, 2009 12:11 pm ]
Post subject:  Re: Tables with several pages taking too long!!

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 438 times

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/