Convert From JPG to PDF - Geometry and Resolution are changed

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
leinsr
Posts: 4
Joined: 2017-02-13T02:50:02-07:00
Authentication code: 1151

Convert From JPG to PDF - Geometry and Resolution are changed

Post by leinsr » 2017-02-14T19:43:23-07:00

I used Magick.Net to convert a JPG file to a PDF file.
But the Geometry and Resolution of the result file are changed by converting.
How can I keep the image quality?

Magick.Net:Magick.NET-7.0.4.700-Q16-x64
source:
using (MagickImageCollection images = new MagickImageCollection("test.jpg"))
{
// Save frame as pdf
images.Write("test.pdf"));
}

JPG file "test.jpg":
Geometry: 1664x2256+0+0
Resolution: 200x200

PDF file "test.pdf":
Geometry: 599x812+0+0
Resolution: 72x72

User avatar
fmw42
Posts: 25159
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert From JPG to PDF - Geometry and Resolution are changed

Post by fmw42 » 2017-02-14T20:02:55-07:00

PDF files actually have no Resolution. You set the size when you either convert to another raster format or when you print. The PDF file is a vector shell containing the raster image from which it was created. So by default it gets the equivalent pixel size converted to a default density of 72.

The pixels size 599 = 1664 * 72/200

Post Reply