How do I save black & white (1 BPP) bitmaps from PDF files?

Q: The main goal of my development is to get pictures from PDF files.
All is working fine except when I try to get black & white (1 BPP)

The code I’ve used is :

       encoder_param.PutNumber("BPC", 1);
      draw.Export(doc.GetPageIterator((UInt32)page + 1).Current(),
uDstFileName, "BMP", encoder_param);

Is this correct ?

With this code the output is a 24 bits bitmap in grayscale.
How can I get a 1 bit bitmap ?
A: Monochrome output is at the moment limited to TIFF and PNG format.
So using the following line will solve the problem.

draw.Export(doc.GetPageIterator((UInt32)page + 1).Current(),
uDstFileName, "TIF", encoder_param);

If you specifically need monochrome BMP export, we could add support
for this option.

We are planning to add more options (i.e. hints) to control the
dithering process (such as dithering algorithm, threshold parameter,
etc) in the upcoming version of PDFNet. If you need this functionality
right you could obtain a grayscale image and then convert it to
monochrome on your end (e.g. using GDI+).

Please keep in mind that you could access raw bitmap data using
draw.GetBitmap() method. This way you could avoid having to save to &
and read from a file in case you need to do any post processing on the
output image.