Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).


New Forum | Previous | Next | (P-PDF) Developers


Topic: Zlib parameters
Conf: (P-PDF) Developers, Msg: 74651
From: awild1
Date: 10/22/2002 02:33 AM

Hello,

I'm trying to write a PDF output stage for some very simple documents,
involving text and image data. I'd like to compress it using Flate.
I'm looking at a PDF allegedly produced by Acrobat Distiller 3.01 on
Solaris as an example. I can recover the uncompressed data using
zlib routines, but despite exploring several of the parameters, I
can't get from the uncompressed back to the compressed as it was in
the example file (it compresses by a comparable amount, but the data
is different: for example, the Distiller compressed data begins
x488994574D73DB38 but about the closest I could get after inflating
and then deflating again was x4889ED974D73DBC8, using level=6 and
windowBits=12 - I established from the code that the first
couple of bytes are header, and the initial four bits contains
windowBits-8, so windowBits=12 was clearly nearer to the Distiller
original that the default 15 (in which case the output began
x789CED98CB96DB38).

The question is, does this matter? ... I understand that the PDF
implementation of Flate is "adapted from" zlib. If I just go ahead
and use the zlib defaults for everything, can I rely on the compressed
stream always being accepted by Acrobat Reader etc.? Do Adobe
recommend particular parameters? Are the ones they effectively
use for their FlateEncode filter - which appear not to be the defaults
- publicly available? (I don't particularly mind if not, but I'd like
to know where I stand. My documents aren't big enough to make it
worthwhile putting effort into optimizing the parameters for performance,
but if there's a recommended "official" set then I'd prefer to use that,
just for the elegance of the thing. It looks to me like Ghostscript
uses all the zlib defaults - but I might be misreading the code).

Thanks.

AJW


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.