jwilk-archive / pdf2djvu

PDF to DjVu converter
GNU General Public License v2.0
94 stars 17 forks source link

Out of memory error 11x17 pdf color scan image #119

Open jwilk opened 8 years ago

jwilk commented 8 years ago

Issue reported by kjo at Bitbucket:

$ pdf2djvu --monochrome -o test.djvu HP5315-8.33c.pdf
HP5315-8.33c.pdf: - page #1 -> #1
Unrecognized DjVu Message: Message name: GException.outofmemory (GException.cpp:213) *** 'void DJVU::throw_memory_error()'

External command "C:\AppPgms\Compression\DjvuLibre\pdf2djvu\pdf2djvu-0.9.4\cjb2 ..." failed with exit status 1

AMD 64b 4G RAM

Basically I want to strip pdf of chroma.


Attachment: HP5315-8.33c.pdf

jwilk commented 8 years ago

The problem is that the physical size of this PDF is huge: it's 116 cm × 175 cm (45.7" × 68.8"). With the default resolution settings, pdf2djvu tries to create a DjVu image of 13716×20646 pixels. Use --dpi=72 or --guess-dpi to get a more reasonably-sized output image.

--monochrome, as currently implemented, is rarely a good idea, and almost certainly not what you'd like in this case. And in general, pdf2djvu is not well suited for PDFs containing scans at this time.

You may want to use pdfimages to extract raw images and then use didjvu. I got pretty decent results with the Sauvola method. (I don't know how to run any of these programs on Windows! Sorry!)


Attachment: HP5315-8.33c-color.djvu Attachment: HP5315-8.33c-bw.djvu