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

JPG High Resolution to PDF results in Text Tiling or Overlay
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2445
Page 1 of 1

Author:  verifiedcredentials [ Tue May 14, 2013 2:58 pm ]
Post subject:  JPG High Resolution to PDF results in Text Tiling or Overlay

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 3401 times ]
File comment: 600 DPI file large resolution
largeCopy_reduced.jpg
largeCopy_reduced.jpg [ 137.23 KiB | Viewed 3401 times ]

Author:  Thomas Hoevel [ Tue May 14, 2013 4:29 pm ]
Post subject:  Re: JPG High Resolution to PDF results in Text Tiling or Ove

Hi!

It's a bug in Windows.

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

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