convert clipboard to pdf with equal size

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
tang
Posts: 1
Joined: 2016-01-04T23:39:34-07:00
Authentication code: 1151

convert clipboard to pdf with equal size

Post by tang »

hi, this question has been asked before (viewtopic.php?f=1&t=26825&p=121500&hilit=pdf+same+size) but I still can't get original image size in pdf

convert clipboard:myimage -alpha on test.pdf

image size is 200 x 200 pixel, after convert to pdf, become full page.
how to remain original image size?

thanks for help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert clipboard to pdf with equal size

Post by fmw42 »

PDF is a vector format and has no pixel size. For images a PDF shell is used to encase the image. -density is used to display the PDF so that it then is converted to pixels. Typically -density 72 is the normal default for converting to pixels. But that may not be the case, if the image in the PDF shell has some internal density. So you would have to extract the image and then display it or find the image's density first. IM has no way to extract the image from a PDF, but there are other tools that can do so. You can try IM's identify -verbose to see what the internal density is of the image. But if that does not show it, then try EXIFTOOL
Post Reply