conversion to PDF

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
zaphod
Posts: 2
Joined: 2013-05-02T18:21:57-07:00
Authentication code: 6789

conversion to PDF

Post by zaphod »

i've run into this before and never found a good answer

i have created a miff file with the following specs as per identify:

geometry of 4400x3400
resolution of 400x400
page geometry of 792x612.

if i use convert (

Code: Select all

convert bar.miff result.png
) to create a png file, i get a file that matches those specs and prints very crisply.

if i convert to a pdf (

Code: Select all

convert bar.miff result.pdf
) i get a pdf file with a very very small image in the lower left corner of the page

from identify -verbose specs of the pdf are

geometry 792x612
resolution 72x72
page geometry 792x612

how should i be using the convert program to create a PDF where the image isn't stuffed into the lower left corner?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: conversion to PDF

Post by fmw42 »

try adding +repage

convert bar.miff +repage result.pdf

However IM will stuff the raster image into a vector environment. So you will not get the right size back from converting the pdf to anything else. You would need some external PDF software to extract the images. But I am not sure, you may be better off putting the PNG version into the PDF rather than the miff version.
zaphod
Posts: 2
Joined: 2013-05-02T18:21:57-07:00
Authentication code: 6789

Re: conversion to PDF

Post by zaphod »

i tried the +repage option, but it didn't help.

at the end the day the problem was that the display program showed the entire canvas of the pdf (3000x4000 or so) with the small actual image in the bottom. using display on a png file did not do this. hence my confusion.

take this file (called bigx.ps

Code: Select all

%!
0 0 moveto 612 792 lineto 612 0 moveto 0 792 lineto stroke showpage
convert it as follows:

convert -density 400 bigX.ps d400.miff
convert d400.miff d400.png
convert d400.miff d400.pdf

use display to show the two files. both have a huge canvas, but the PNG has the X fill the canvas while the pdf has the X very small and in the lower left corner.

interesting.

the good news is that if i print the pdf with FoxIt or acrobat, it prints at the correct size and crispness meaning that I can send my file to staples/fedex for final printing
Post Reply