Convert JBIG2 to PDF with free and open source software agl’s jbig2enc

agl’s jbig2enc is an encoder for JBIG2:
www.jpeg.org/public/fcd14492.pdf

JBIG2 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 documents

It 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

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • DotNetKicks
  • Fark
  • Fleck
  • Gwar
  • Haohao
  • IndianPad
  • Internetmedia
  • LinkaGoGo
  • MyShare
  • Netscape
  • NewsVine
  • Rec6
  • Reddit
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Webride

7 Responses to “Convert JBIG2 to PDF with free and open source software agl’s jbig2enc

  • 1
    pdfsizeopt-a Free and Open Source PDF Manipulation Tool to Reduce PDF File Size | RubyPDF Blog
    October 30th, 2009 01:22

    [...] pdfsizeopt home page Convert JBIG2 to PDF with free and open source software agl’s jbig2enc Windows version JBIG2 Encoder-Jbig2.exe Share and [...]

  • 2
    How to Let Python Send Binary data to stdout under Windows | RubyPDF Blog
    November 3rd, 2009 04:29

    [...] http://code.activestate.com/recipes/65443/ issue: pdf.py can not create correct pdf under windows Convert JBIG2 to PDF with free and open source software agl’s jbig2enc Windows Version Jbig2enc(Jbig2 Encoder) Share and [...]

  • 3
    Dingo
    November 7th, 2009 08:12

    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?

  • 4
    Dingo
    November 7th, 2009 08:47

    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?

  • 5
    rubypdf
    November 7th, 2009 09:00

    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

  • 6
    Dingo
    November 7th, 2009 09:27

    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

  • 7
    rubypdf
    November 7th, 2009 16:30

    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.

Leave a Reply

You must be logged in to post a comment.