ColorMode

Inheritance: java.lang.Object

public class ColorMode

Specifies how colors are rendered.

Examples:

Shows how to change image color with saving options property.


 Document doc = new Document(getMyDir() + "Images.docx");

 // Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
 // to modify how that method converts the document to .PDF.
 // Set the "ColorMode" property to "Grayscale" to render all images from the document in black and white.
 // The size of the output document may be larger with this setting.
 // Set the "ColorMode" property to "Normal" to render all images in color.
 PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
 {
     pdfSaveOptions.setColorMode(colorMode);
 }

 doc.save(getArtifactsDir() + "PdfSaveOptions.ColorRendering.pdf", pdfSaveOptions);
 

Fields

FieldDescription
GRAYSCALERendering with colors in a range of gray shades from white to black.
NORMALRendering with unmodified colors.
length

Methods

MethodDescription
fromName(String colorModeName)
getName(int colorMode)
getValues()
toString(int colorMode)

GRAYSCALE

public static int GRAYSCALE

Rendering with colors in a range of gray shades from white to black.

NORMAL

public static int NORMAL

Rendering with unmodified colors.

length

public static int length

fromName(String colorModeName)

public static int fromName(String colorModeName)

Parameters:

ParameterTypeDescription
colorModeNamejava.lang.String

Returns: int

getName(int colorMode)

public static String getName(int colorMode)

Parameters:

ParameterTypeDescription
colorModeint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int colorMode)

public static String toString(int colorMode)

Parameters:

ParameterTypeDescription
colorModeint

Returns: java.lang.String