PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 7:53 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Jan 16, 2014 4:10 pm 
Offline

Joined: Thu Jan 16, 2014 3:16 pm
Posts: 3
Hi,

I am looking for some performance advice.
I currently have collections of single page tiff (20,000+ images a set) images B&W G4 that I am building into PDF's.

At the moment I am using the following code

Code:
                    XImage img = XImage.FromFile(tiffFile);
                    PdfPage imagePage = new PdfPage();
                    imagePage.Height = img.PointHeight;
                    imagePage.Width = img.PointWidth;
                    document.Pages.Add(imagePage);
                    pageCount = pageCount+1;
                    XGraphics xgr = XGraphics.FromPdfPage(document.Pages[pageCount]);
                    xgr.DrawImage(img, 0, 0);


With this I can add around 100 pages to a PDF a minute and I am wondering if I can get it any quicker. I have tried moving the data to an SSD but there was no noticible difference in performance. I was wonder if there is a more efficient way to do this.

Many thanks

Rob Kenny


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 16, 2014 4:21 pm 
Offline
PDFsharp Guru
User avatar

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

If your PDFsharp version is newer than 1.30, then maybe try version 1.30 to see if it runs faster (but files might be larger).
Available here:
http://pdfsharp.codeplex.com/releases/view/31456

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 16, 2014 4:34 pm 
Offline

Joined: Thu Jan 16, 2014 3:16 pm
Posts: 3
Thanks, I am currently using 1.32

I'll try dropping in the 1.30 dll and see what happens.

As far as size goes, the PDF's I'm generating are already around 1.7GB which is about the same size as the original TIFF's. I am not too worried unless it is a large factor.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 16, 2014 4:38 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Variation in size should be small for most files (most likely far less than 10% for the final PDF).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 17, 2014 9:05 am 
Offline

Joined: Thu Jan 16, 2014 3:16 pm
Posts: 3
OK swapped out for 1.30 and it didn't really make any difference in speed and increased file size by almost 400MB (1.6GB PDF vs 1.2GB).

So it looks like my machine is going as fast as it can.

Thanks


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

All times are UTC


Who is online

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