[Poppler-bugs] [Bug 81760] pdftops sometimes creates huge PS 3 files out of small PDFs

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Feb 7 07:15:51 CET 2016


https://bugs.freedesktop.org/show_bug.cgi?id=81760

--- Comment #18 from William Bader <williambader at hotmail.com> ---
I have it working. I'm going to clean it up and send patches Sunday night after
the "taronjada" http://lameva.barcelona.cat/carnaval/ca/taronjada.php
I made a new FlateEncoder.cc and FlateEncoder.h.
It can be enabled with ./configure --enable-zlib-compress separately from the
zlib flate decoder which can still be enabled by --enable-zlib.
I removed the pdftops -nolzw flag.
I initialized enableLZW.
Flate happens only with enableFlate and Level 3 output.
LZW happens only with enableLZW and Level 2 output (or Level 3 if
!enableFlate).
The Flate stream is encoded with ASCII85. Is that necessary? I thought that
level 2 and higher supported binary data.
The deflate stream patch was very helpful, but I did not use it because the
deflate stream writes the compressed data while the flate encoder gets the
compressed data pulled from it, which turns the logic inside out, especially
with the way that the zlib deflate() function works.
What should the encoder do if deflateInit() returns an error status?
I am calling deflateInit with Z_DEFAULT_COMPRESSION. Should the compression
level be settable?
I used 16K buffers like the deflate stream patch and the zlib examples. Should
the buffers be larger or configurable?
Regards, William

$ ls -l tux-yellow.ps 
-rw-rw-rw- 1 william william 183552 Feb  7 05:59 tux-yellow.ps
$ pdftops -level2 tux-yellow.pdf tux-yellow2.ps
$ pdftops -level3 tux-yellow.pdf tux-yellow3.ps
$ ls -l tux-yellow.pdf tux-yellow2.ps tux-yellow3.ps 
-rw-r--r-- 1 william william   65720 Feb  2 19:58 tux-yellow.pdf
-rw-rw-rw- 1 william william 1126366 Feb  7 06:39 tux-yellow2.ps
-rw-rw-r-- 1 william william  183552 Feb  7 06:39 tux-yellow3.ps
$ grep --text Decode tux-yellow2.ps tux-yellow3.ps | grep filter
tux-yellow2.ps:    /ASCII85Decode filter
tux-yellow2.ps:    /LZWDecode filter
tux-yellow3.ps:  /ReusableStreamDecode filter
tux-yellow3.ps:    /ASCII85Decode filter
tux-yellow3.ps:    /FlateDecode filter

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20160207/0cf89935/attachment.html>


More information about the Poppler-bugs mailing list