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

Creating PDF files w/o recompressing images

8 views
Skip to first unread message

Marco

unread,
Aug 8, 2005, 6:01:28 PM8/8/05
to
Hi,

I think many of you know pdflatex. You have a latex document with some
graphics (png) and photographs (jpg). When creating a pdf file, you'll
get the best quality document without recompressing the image files
(that means pdflatex PRESERVES the ORIGINAL image quality).

Is there an appropriate option with Ghostscript: No resampling of
images, no recompressing of images, NO BIG document file size?

I need it when creating PDF files from other than LaTeX source (e.g.
OpenOffice).

Thanks.

Marco

Helge Blischke

unread,
Aug 9, 2005, 7:23:43 AM8/9/05
to

Yes, look into Adobe's distiller parameters spec - all of them are accepted by gs,
and most of them are honoured. Switch off downsampling and only use lossless
compression (like LZW or flate) for images.

Helge

--
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de

bugbear

unread,
Aug 9, 2005, 9:39:13 AM8/9/05
to
Helge Blischke wrote:
> Yes, look into Adobe's distiller parameters spec - all of them are accepted by gs,
> and most of them are honoured. Switch off downsampling and only use lossless
> compression (like LZW or flate) for images.

No - I think what the OP wants, (and what I'd like) is for a
(e.g.) JPEG stream in the PostScript (with parameters) to be transcribed
into the PDF without decompression or recompression of any kind.

This both minimises CPU load, and has desirable properties w.r.t
file size and control of quality from the PostScript generating
application.

BugBear

sags...@gmail.com

unread,
Aug 9, 2005, 10:46:01 AM8/9/05
to
bugbear wrote:
> ...

> No - I think what the OP wants, (and what I'd like) is for a
> (e.g.) JPEG stream in the PostScript (with parameters) to be transcribed
> into the PDF without decompression or recompression of any kind.

For Ghostscript, this is currently listed as a
project-to-address-in-the-future in its DOC\Projects.htm.

Newer versions of Acrobat Distiller have this capability. Not sure how
new; definitely 4 does not, don't know about 5, I think 6 implements
this.

> ...

bugbear

unread,
Aug 9, 2005, 11:16:09 AM8/9/05
to

OK. I've read the (Acrobat 7) doc carefully:
http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/DistillerParameters.pdf

Can you (pretty please?) tell me the option that
controls this, 'cos I can't find it.

BugBear

Marco

unread,
Aug 9, 2005, 3:08:34 PM8/9/05
to
Helge Blischke schrieb:

> Marco wrote:
>
>>Hi,
>>
>>I think many of you know pdflatex. You have a latex document with some
>>graphics (png) and photographs (jpg). When creating a pdf file, you'll
>>get the best quality document without recompressing the image files
>>(that means pdflatex PRESERVES the ORIGINAL image quality).
>>
>>Is there an appropriate option with Ghostscript: No resampling of
>>images, no recompressing of images, NO BIG document file size?
>>
>>I need it when creating PDF files from other than LaTeX source (e.g.
>>OpenOffice).
>>
>>Thanks.
>>
>>Marco
>
>
> Yes, look into Adobe's distiller parameters spec - all of them are accepted by gs,
> and most of them are honoured. Switch off downsampling and only use lossless
> compression (like LZW or flate) for images.

Right, but then I'll get BIG files, that I don't want.

Is there an option that keeps the original image quality and size (like
pdflatex does)?


Marco

>
> Helge
>

Marco

unread,
Aug 9, 2005, 3:11:12 PM8/9/05
to
sags...@gmail.com schrieb:

Seems that there's no way around creating good looking and small-sized
PDF-documents with latex?

Marco


>
>
>>...
>
>

Aandi Inston

unread,
Aug 9, 2005, 3:54:47 PM8/9/05
to
Marco <marc...@hotmail.com> wrote:

>> Yes, look into Adobe's distiller parameters spec - all of them are accepted by gs,
>> and most of them are honoured. Switch off downsampling and only use lossless
>> compression (like LZW or flate) for images.
>
>Right, but then I'll get BIG files, that I don't want.

Look further into the Distiller Parameters, especially the section
"passing through JPEG images". Of course, you need also to have an
application and driver combination that generates the PostScript file
without recompressing an original graphic. Does OpenOffice do that?
----------------------------------------
Aandi Inston qu...@dial.pipex.com http://www.quite.com
Please support usenet! Post replies and follow-ups, don't e-mail them.

sags...@gmail.com

unread,
Aug 10, 2005, 3:35:59 AM8/10/05
to
bugbear wrote:
> ...

> OK. I've read the (Acrobat 7) doc carefully:
> http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/DistillerParameters.pdf
>
> Can you (pretty please?) tell me the option that
> controls this [keep JPEG's as-is, without decompress+recompress], 'cos I can't find it.
> ...
> BugBear

It's PassThroughJPEGImages. According to the section "Changes Since
Last Revsion", this was introduced with Distiller 6.

bugbear

unread,
Aug 10, 2005, 4:56:10 AM8/10/05
to

Curse my blindness!

Thanks you.

BugBear

bugbear

unread,
Aug 10, 2005, 7:12:28 AM8/10/05
to
Marco wrote:
>
>
> Right, but then I'll get BIG files, that I don't want.
>
> Is there an option that keeps the original image quality and size (like
> pdflatex does)?

No, but you can turn OFF sub-sampling, and enable
JPEG compression with a high quality number,
which will get you close to where you want to be.

BugBear

bugbear

unread,
Aug 10, 2005, 7:23:12 AM8/10/05
to

I was doing something similar recently:

http://groups-beta.google.com/group/comp.text.pdf/msg/d74c9a65eed81757?hl=en&

Which combined with this (which google doesn't have yet)
should provide your answer:

>>>
>>>> >
>>>> >
>>>> > (1) the joboptions parameter as interpreted by Acrobat Distiller in fact causes
>>>> > a PostScript file to be consumed, which (usually) contains a set of distiller parameters
>>>> > and the default page size.
>>>> >
>>>> > (2) you may tyke this(these)file(s) and feed them directly into Ghostscript, entering
>>>> > their paths just before the main PS job.
>>
>>>
>>> How do I do this - ps2pdf (which is a wrapper, I know) just takes
>>> a single file, and I though gs generates an output file for
>>> each input file.
>>>
>>> BugBear (foolish and mystified)
>
>
> Try to use "-fyourjoboptionsfile" (without the quotes) as a commandline option to
> the ps2pdf script. Note that between the option flag ("f") and the file name there
> MUST NOT be any white space.
>
> Helge
>

BugBear

0 new messages