4

I'm trying to extract all images out of PDF files in C++. I'm stuck in decoding CCITT encoded images.

Does anyone know an opensourced code for this?

I use the ImageMagick Magick++ Library, is it possible to do the decoding with this library, too?

Thanks for your help!

Andrea
  • 11,801
  • 17
  • 65
  • 72
Van Coding
  • 24,244
  • 24
  • 88
  • 132

2 Answers2

5

CCITT is one of the encodings TIFF supports, though in a PDF file the CCITT images are probably raw data.

You can convert a raw CCITT image into a Tiff image using Fax2Tiff. It should be easy enough to work with the image once it is encoded as a Tiff.

Fax2Tiff is part of LibTiff. See LibTiff Source

Brian
  • 25,523
  • 18
  • 82
  • 173
  • Thanks for your answer! Fax2Tiff seems not to be a library, it is a tool. I need to do the conversion in the program. – Van Coding Jan 05 '11 at 12:24
  • @FlashFan: While Fax2Tiff *is* a tool, it's also open source. Find the source code for it within LibTiff and adjust it as needed for your purposes. – Brian Jan 05 '11 at 15:08
3

Or you can append a header on it and treat it as a tiff file.

mark stephens
  • 3,205
  • 16
  • 19