Reference Guide
GdPicture14 Namespace / GdPictureDocumentConverter Class / PdfEnableColorDetection Property
Example





In This Topic
    PdfEnableColorDetection Property (GdPictureDocumentConverter)
    In This Topic
    Enables or disables the automatic color detection feature when converting/saving the currently loaded document to PDF format.

    The purpose is to automatically detect the original color of documents scanned in color mode and convert the B/W and/or grayscale ones to the appropriate bpp (bits-per-pixel) encoding. The result is allowing preservation of image quality while considerably reducing the file size.

    Syntax
    'Declaration
     
    
    Public Property PdfEnableColorDetection As Boolean
    public bool PdfEnableColorDetection {get; set;}
    public read-write property PdfEnableColorDetection: Boolean; 
    public function get,set PdfEnableColorDetection : boolean
    public: __property bool get_PdfEnableColorDetection();
    public: __property void set_PdfEnableColorDetection( 
       bool value
    );
    public:
    property bool PdfEnableColorDetection {
       bool get();
       void set (    bool value);
    }

    Property Value

    The default value is false.
    Example
    Re-compressing an existing PDF document using color detection.
    Using gdpictureDocumentConverter As New GdPictureDocumentConverter()
        gdpictureDocumentConverter.LoadFromFile("input.pdf", GdPicture14.DocumentFormat.DocumentFormatPDF)
        gdpictureDocumentConverter.PdfEnableColorDetection = True
        gdpictureDocumentConverter.SaveAsPDF("output.pdf", PdfConformance.PDF1_7)
    End Using
    using (GdPictureDocumentConverter gdpictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
    {
        gdpictureDocumentConverter.LoadFromFile("input.pdf", GdPicture14.DocumentFormat.DocumentFormatPDF);
        gdpictureDocumentConverter.PdfEnableColorDetection = true;
        gdpictureDocumentConverter.SaveAsPDF("output.pdf", PdfConformance.PDF1_7);
    }
    See Also