Page 1 of 1

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

Posted: 2015-08-27T14:11:17-07:00
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?

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

Posted: 2015-08-27T14:31:47-07:00
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.

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

Posted: 2015-08-27T14:40:40-07:00
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

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

Posted: 2015-08-27T14:54:11-07:00
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.