PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 04, 2024 10:26 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue May 14, 2013 2:58 pm 
Offline

Joined: Tue May 14, 2013 2:26 pm
Posts: 1
Basic Setup
Windows 2007
PDF Sharp Version :1.31.1789.0
PDF Sharp Runtime Version: v2.0.50727


I'm seeing an issue when converting JPG's to PDF's. The situation is this: The user uploads a high resolution JPG to our web site,
For example the properties of the file are as follows,
[list=]The file size is 3.3 MB
Dimensions: 5100 X 6600
Horizontal Resolution: 600 dpi
Vertical Resolution: 600 dpi
Bit Depth: 8[/list]

The conversion process works fine and no errors are thrown, but the PDF that is created is unreadable as the characters/text overlay each other. Due to the size restrictions on file uploads I am unable to upload the actual files we are using, but if you take the largeCopy_reduced.jpg and bring it back to its original size of 5100 by 6600 and try to convert it, the pdf that will appear will be similar in looks to the Untitled.gif, Due to size restrictions I was unable to get the actual pdf uploaded either? What properties/Transformation do I need to do so that this overlapping doesn't occur?

Also, I have converted the jpg to a .tiff file and it will upload correctly then, but our application services a wide student base and not all them understand how to convert .jpg to .tif. Any ideas of why we might be seeing this and what I might be able to do to correct it?

Thanks,


Here is the code that I am using, the source and destination are the file paths.
Code:
  string source = (e.Argument as string[])[0];
                string destinaton = (e.Argument as string[])[1];

                PdfDocument doc = new PdfDocument();
                doc.Pages.Add(new PdfPage());
                XGraphics xgr = XGraphics.FromPdfPage(doc.Pages[0]);
                XImage img = XImage.FromFile(source);

                xgr.DrawImage(img, 0, 0);
                doc.Save(destinaton);
                doc.Close();
                success = true;


Attachments:
Untitled.gif
Untitled.gif [ 232.79 KiB | Viewed 3404 times ]
File comment: 600 DPI file large resolution
largeCopy_reduced.jpg
largeCopy_reduced.jpg [ 137.23 KiB | Viewed 3404 times ]
Top
 Profile  
Reply with quote  
PostPosted: Tue May 14, 2013 4:29 pm 
Offline
PDFsharp Guru
User avatar

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

It's a bug in Windows.

See also:
viewtopic.php?p=6963#p6963

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

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