In a previous thread, it was kindly pointed out to me that I could
adjust the DPI to improve the quality of JPGs converted from PDFs
through Ghostscript. I notice adjusting the DPI also changes the
height of my output JPGs, which I'm producing like so ...
gs -I/usr/share/fonts/default/Type1/:/usr/share/libwmf/fonts/ -
dNOPAUSE -dBATCH -dTextAlphaBits=4 -dJPEGQ=100 -sDEVICE=jpeg -r72 -
sOutputFile=ViralCopy%d.jpg ViralCopy.pdf -c -quit
My question is, if I want my ouptut JPGs to be of height 828 pixels,
is there a way to specify that in Ghostscript 8.62, which I'm using on
Fedora Core 6 Linux? - Dave
> My question is, if I want my ouptut JPGs to be of height 828 pixels,
> is there a way to specify that in Ghostscript 8.62, which I'm using on
> Fedora Core 6 Linux? - Dave
If you know the page size of the pages in the PDF you can calculate a
resolution which will give that size. For example, assume your page is
8.5 inches by 11.
You want 828 pixels output height, that means you need a resolution (in
dots per inch) of 828/11 = 75.27. 75 will give a height of 825 pixels,
close enough ?
However, note that each page in a PDF file can be a different size or
orientation, so its not a guarantee that all pages will be the desired
height. The PDF interpreter in Ghostscript will look at the dimensions
of each page and issue a request for media of that size.
Depending what media the device has available, and the page size policy,
you will get different results. If you configure a device which only has
one medium, of hte desired size, then you will always get the size you
want, no matter what the original job contained. You can then use the
PageSize policy to select whether to crop the job, or scale it to fit.
This is reasonably complex, enough so that I don't know how to do it at
the moment.
Ken
> My question is, if I want my ouptut JPGs to be of height 828 pixels,
> is there a way to specify that in Ghostscript 8.62, which I'm using on
> Fedora Core 6 Linux? - Dave
Unless the newer version stopped support the -g option fixes width and
height in pixels e.g.
gs -g666x862
Ed