Q: We are converting gray scale pdfs to monochrome using
pdftron.PDF.PDFDraw and a "BPC" hint (similar to your PDFDraw sample -
http://www.pdftron.com/pdfnet/samplecode.html#PDFDraw). It appears
that the conversion preformed is a fairy simple threshold conversion.
Is there any way to us a more sophisticated conversion method with in
pdfnet, as opposed to getting it out as a gray scale image and
converting it ourselves.
Also is there any complete documentation of the \"hints\" taken by the
functions? I know the ones in the docs are incomplete as I am using
ones not listed.
A: You can use BPC and Dither option to produce high quality
All the options are documented as part of PDFNet API Reference:
Parameter/Key Output Format Description/Value Example
Quality JPEG The value for compression 'Quality' must be a number
between 0 and 100 specifying the tradeoff between compression ratio
and loss in image quality. 100 stands for best quality.
See the Example 2 in PDFDraw sample project.
Dither PNG, PNG8, TIFF or TIFF8. A boolean used to enable or disable
dithering. Relevent only for when the image is exported in palettized
or monochrome mode. hint.PutBool("Dither", true);
PNG/TIFF for grayscale; TIFF for CMYK. A name object used to select
the rendering and export color space. Currently supported values are
"Gray", "RGB, and "CMYK". The output image format must support
specified color space, otherwise the parameter will be ignored. An
example of image format that supports CMYK is TIFF. Image formats that
support grayscale are PNG and TIFF. By default, the image is rendered
and exported in RGB color space. hint.PutName("ColorSpace", "CMYK");
BPC PNG or TIFF. A number used to specify 'bits per pixel' in the
output file. Currently supported values are 1 and 8 (default is 8). To
export monochrome (1 bit per pixel) image, use 1 as the value of BPC
parameter and use TIFF or PNG as the export format for the image. By
default, the image is not dithered when BPC is 1. To enable dithering
add 'Dither' option in the export hint. hint.PutNumber("BPC", 1);