com.aspose.words

Class ColorMode

  • java.lang.Object
    • com.aspose.words.ColorMode
public class ColorMode 
extends java.lang.Object

Utility class containing constants. Specifies how colors are rendered.

Example:

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);

Field Summary
static final intNORMAL = 0
Rendering with unmodified colors.
static final intGRAYSCALE = 1
Rendering with colors in a range of gray shades from white to black.
 

    • Field Detail

      • NORMAL = 0

        public static final int NORMAL
        Rendering with unmodified colors.
      • GRAYSCALE = 1

        public static final int GRAYSCALE
        Rendering with colors in a range of gray shades from white to black.