How to convert a picture to a PDF of the exact same resolution?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
colordrop
Posts: 2
Joined: 2015-08-27T14:06:35-07:00
Authentication code: 1151

How to convert a picture to a PDF of the exact same resolution?

Post by colordrop »

I made a test picture which I need to convert to PDF.
But the PDF must have the same resolution as the original picture.
The picture must not be resampled or stretched in any way.
The PDF must not have any borders.

Can you do this with ImageMagick?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to convert a picture to a PDF of the exact same resolution?

Post by snibgo »

Try:

Code: Select all

convert rose: -density 100 -units pixelsperinch r.pdf
Adobe Reader correctly reports the dimensions as 0.70x0.46 inches.
snibgo's IM pages: im.snibgo.com
colordrop
Posts: 2
Joined: 2015-08-27T14:06:35-07:00
Authentication code: 1151

Re: How to convert a picture to a PDF of the exact same resolution?

Post by colordrop »

Ok maybe everything is OK after all, it's just that GIMP, which with I created the picture, reports different resolutions.
Image Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to convert a picture to a PDF of the exact same resolution?

Post by snibgo »

Gimps reports my r.pdf as 70x46 pixels, 100 pixels per inch.

What resolution is your input PNG? What version of IM and Ghostscript are you using?

Failing that, please provide your input PNG and the exact command you used.
snibgo's IM pages: im.snibgo.com
Post Reply