agl’s jbig2enc is an encoder for JBIG2:
www.jpeg.org/public/fcd14492.pdfJBIG2 encodes bi-level (1 bpp) images using a number of clever tricks to get
better compression than G4. This encoder can:
* Generate JBIG2 files, or fragments for embedding in PDFs
* Generic region encoding
* Perform symbol extraction, classification and text region coding
* Perform refinement coding and,
* Compress multipage documentsIt uses the (Apache-ish licensed) Leptonica library:
http://www.leptonica.com/
Jbig2enc can convert other format image to jbig2 or fragments for embedding in PDFs, and pdf.py can convert the fragments to PDF document.
for example, if you want to convert a.bmp to pdf, you can do it in this way
jbig2 -s -p a.bmp
you get output.0000 and output.sym files
python pdf.py output>jbig2.pdf
btw, itext and itextsharp also supports convert jbig2 to pdf now.
After some efforts, I have successfully compiled jbig2 under Window XP with GCC 4.2(MingW32+MSYS), for details and download, please visit Windows version of agl’s jbig2enc, from this page, you can also download the linux compiled version.
reference,
Windows version of agl’s jbig2enc
agl’s jbig2enc home page
Woof Woof!
Trying to build a pdf running pdf.py, This error message is showed
python pdf.py output>jbig2.pdf
File “pdf.py”, line 7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Ho can I solve?
Re-Woof
Ok, previous pdf.py was wrong, Now I have downloaded the right file but an error message is showed
# python pdf.py output>jbig2.pdf
Traceback (most recent call last):
File “pdf.py”, line 159, in
usage(“symbol table %s not found!”% sym)
TypeError: usage() takes exactly 2 arguments (1 given)
# python pdf.py output>jbig2.pdf
Traceback (most recent call last):
File “pdf.py”, line 159, in
usage(“symbol table %s not found!”% sym)
TypeError: usage() takes exactly 2 arguments (1 given)
line 159 is this:
usage(“symbol table %s not found!”% sym)
How Must I modify to get pdf.py working?
You should use jbig2.exe(windows) or Jbig2(Linux) to get the output.0000 and output.sym
by using this command, “jbig2 -s -p a.jpg“
Thanks I just realized my error
when I typed in console command to encode, I added the -S switch while omitting pdf.py works fine. a powerful program.
my university tends to make too large files when scans public domain books so I think jbig is a good utility to recompress all images and then assembling in pdf
you should try pdfsizeopt, maybe which is the best choise for you, but, pdfsizeopt only works well under Linux now, and I am working on the porting job to let it works under Windows.
btw, neither jbig2 or pdfsizeopt is developed by me, I just found them and do some jobs on them.