Image decoding

I'm currently trying to extract an image from a pdf file \The pdf is
made from a scanner: it has a single page that contains one big image.

When looking at the file I find the following:

BlackIs1 true
/Columns 2544
/K -1

]

/Filter [
/ASCII85Decode
/CCITTFaxDecode
]

/Length 2 0 R

stream
jb4%GH6W]o

how to decode the CCITTFaxDecode ??

You can decode data from any PDF stream (including CCITTFaxDecode, JBIG2, etc) with obj.GetDecodedStream().

For example:

// C# pseudo-code (other languages are similar)

FilterReader reader = new FilterReader(image.GetSDFObj().GetDecodedStream());
StdFile file = new StdFile(“image.raw”, StdFile.OpenMode.e_write_mode);
FilterWriter writer = new FilteWriter(out_file);
writer.WriteFilter(reader);
writer.Flush();
file.Close();

Alternatively you may want to take a look at ImageExtract and ElementRewaderAdv samples:

ImageExtract: http://www.pdftron.com/pdfnet/samplecode.html#ImageExtract
ElementRewaderAdv (search for ProcessImage): http://www.pdftron.com/pdfnet/samplecode.html#ElementReaderAdv