PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PDF File Size

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
sarabjs



Joined: 21 May 2009
Posts: 2

PostPosted: Thu May 21, 2009 4:06 am    Post subject: PDF File Size Reply with quote

Hi,

First - Thank You to the authors for putting this library together. Great work!

I'm trying to build a C# application to convert JPEG images into PDF files. It works well. The only issue is that the output PDF file size is around 4-5 times larger than that of the original JPEG.

I searched through this forum, and realized that the default setting in PDF Writer is Verbose, and I need to get a 'Release' build.

So to pick up a copy from the 'Release' build (which should use the Compact setting instead), I opened the PdfSharp project in VS C# Express, and built the solution. This created a Release folder in the bin directory, and a PdfSharp.dll file inside.

Using this new dll however does not change the PDF file sizes. They are exactly the same as they were before:

Original JPEG size - Output PDF size
129KB - 582KB
123KB - 484KB

Any ideas?

Thanks.

Sarab
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Mon May 25, 2009 7:44 am    Post subject: Reply with quote

Hi!

I can't explain this because JPEG files are (or at least should be) copied into the PDF file. The PDF file size should be only few kB larger than the JPEG file size.
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
sarabjs



Joined: 21 May 2009
Posts: 2

PostPosted: Fri May 29, 2009 11:07 am    Post subject: Reply with quote

Hmm. Could it be that I'm still not using the 'Release' dll ?
Anything else I can do to make sure that's not the case ?

Thanks...
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Tue Jun 02, 2009 10:18 am    Post subject: Reply with quote

Are you using the GDI+ build (PDFsharp-VS2008.sln) or the WPF build (PdfSharp-WPF.sln)?

I just noticed that the WPF build treats JPEG images incorrectly. This could explain the increase in size.
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
Siva



Joined: 04 Jun 2009
Posts: 3

PostPosted: Fri Jun 05, 2009 3:27 am    Post subject: Reply with quote

I am hitting the exact same problem. I am using WPF version of it. PdfSharp-WPF.sln.

I spent sometime debugging the problem, looks like the logic of handling Jpeg images in WPF is not working.

In file ximage.cs
string pixelFormat = this.wpfImage.Format.ToString();
switch (pixelFormat)
{
case "Bgr32":
case "Bgra32":
case "Pbgra32":
case "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}": // bmp
case "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}": // png
this.format = XImageFormat.Png;
break;

Even for jpeg it is getting png.


Can I get a fix for this?
Back to top
View user's profile Send private message
Siva



Joined: 04 Jun 2009
Posts: 3

PostPosted: Fri Jun 05, 2009 4:27 pm    Post subject: Reply with quote

I changed to use the non WPF version and it is working great. I will switch to WPF version once it is fixed. Also I noticed that WPF version does not load multi page tiff files. I did not do much research though.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com