[gs-bugs] [Bug 690742] PDF Writer Creating multiple XObjects for Repeated Images

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Fri Aug 13 09:50:54 UTC 2010


Ken Sharp <ken.sharp at artifex.com> changed:

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #1 from Ken Sharp <ken.sharp at artifex.com> 2010-08-13 09:50:50 UTC ---
(In reply to comment #0)
> Converting postscript with repetitive image calls, extremely large PDF files are
> generated and extreme conversion times are experienced. After dumping the output
> PDF if appears that ps2pdf is creating multiple XObjects per input EPS file.

Realistically, its extremely hard for pdfwrite to know that two images
presented separately are the same image. We would need to maintain a hash of
every image presented so far, temporarily store each new image, hash it and
compare the hash with every previous image in order to determine this.

Frankly that would slow down 'normal' processing quite considerably, especially
for people handling large images. While it would benefit your workflow, it
would penalise everyone.

Ideally the way to handle this is to construct the images as Form Resources in
PostScript. You then use each Form as required. Because each form is unique
there is no need to compare the images, and so a Distiller application can
reuse the forms.

Unfortunately at present pdfwrite does not properly honour PostScript forms, so
this approach would not help you yet. We will be adding this functionality in
the future (see #687561 and #691202)

I believe you will find that Adobe Acrobat Distiller behaves in the same
fashion with the workflow you describe, though in this case using forms *would*
reduce the output size and processing time considerably, as Distiller is able
to recognise forms.

However we won't address the case where the same image is imply thrown through
multiple times.

Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the gs-bugs mailing list