Write a page to an image file.
convertPageToBMP2([in] int page, [in] double dpi, [in] int color, [in] BSTR fileName)
This function converts a PDF page to an image file on disk, in BMP format.

The arguments are:

Note that the color settings are read-only properties on the XpdfViewer control, so you'll need to use viewer.imageMono, etc.
' convert page 5 to a 72 dpi color BMP file viewer.convertPageToBMP2 5, 72, viewer.imageRGB, "test1.bmp"