dcpdf_SetImageGrayscale

Specifies how gray areas of a grayscale image are handled when you convert a PDF file to TIFF.

Member of namespace

dcpdf

Syntax

bool dcpdf_SetImageGrayscale (strParam)

Parameters

The parameter can be True or False.
  • True: Gray areas of the image must not be dithered.
  • False: Gray areas of the image must be dithered. This option is the default.

Returns

False, if the parameter is invalid. Otherwise, True.

Level

Batch or Document.

Details

Sets a Grayscale flag for images in a PDF file that is generated by an action such as dcpdf_CreateTiffFromPDF.

This action controls how gray areas of a grayscale image are handled when converted to black and white. For example, if you have a text document with a gray background, it is recommended to call this action and pass True. This option causes the gray area below a predefined tolerance to be converted to white, producing an image that can be recognized. If you have a grayscale image and this action is set to False, gray areas are dithered to simulate gray in the resulting TIFF image. The default value is False.

If this action is used, it must be called before dcpdf_CreateTiffFromPDF or dcpdf_CreateTiffFromPDF_CreateDocs.

Example:
dcpdf_SetImageGrayscale("True")
dcpdf_CreateTiffFromPDF("True")