On 2002-12-08 19:26:06 +0100, Hartmut Henkel wrote:
But already when writing the first page, the required page 0 info is to be written out as PDF object. The PDF definition seems to require, that all page 0 info is collected in ONE PDF stream.
--- Or can one define a continuation stream in PDF? ---
No. But each image can have its own JBIG2Globals: "The stream _can_ be shared by multiple image XObjects whose JBIG2 encodings use the same global segments." (emph mine)
This would mean, that for writing an additional, later page (e. g. page 2), this page has to be accompanied also by its page 0 information---which is a waste of space in the PDF file, as part of the page 0 PDF info has been already written before.
This seems to be the only way. :-{ The PDF Reference says nearly nothing on multi-image files.
What to do?
(1) Accompany any page N with all its page 0 information upto the EOP(N) flag. This is straight-forward, but it increases the size of the PDF file, as the same page information is included several times. So it makes part of the JBIG2 compression advantages void.
How large is a typical page 0 information compared to the actual images? [...]
(3) Planning ahead (= knowing in advance), which images (e. g. up to which page) will be included from a given JBIG2 file. Then the included page 0 segment could be kept at a minimum. Just take everything up to the maximum image number. Or utilize a real JBIG2 decoder (XPDF) to cleverly decide which segments are really needed for the image subset. But the decoder would have almost nothing to decode (the UNdecoded JBIG2 stream is included), it only would have to decide... :-)
This sounds like a two-pass approach, which we can not do. Best regards Martin -- Martin Schröder, MS@ArtCom-GmbH.DE ArtCom GmbH, Grazer Straße 8, D-28359 Bremen Voice +49 421 20419-44 / Fax +49 421 20419-10