Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Specifying height of putput images

0 views
Skip to first unread message

laredotornado

unread,
Mar 19, 2008, 4:34:02 PM3/19/08
to
Hi,

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

ken

unread,
Mar 20, 2008, 4:38:11 AM3/20/08
to
In article <7793c539-1d7d-4e4f-ad01-be26364f6623
@a23g2000hsc.googlegroups.com>, laredo...@zipmail.com says...

> 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

abe...@hotmail.com

unread,
Mar 21, 2008, 3:35:27 PM3/21/08
to
On Mar 19, 4:34 pm, laredotornado <laredotorn...@zipmail.com> wrote:

> 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

0 new messages