GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureDocumentConverter Class / PdfColorImageCompression Property
Example





In This Topic
PdfColorImageCompression Property (GdPictureDocumentConverter)
In This Topic
Sets the scheme to be used to compress color image data when converting/saving the currently loaded document to PDF format.
Syntax
'Declaration
 
Public Property PdfColorImageCompression As PdfCompression
public PdfCompression PdfColorImageCompression {get; set;}
public read-write property PdfColorImageCompression: PdfCompression; 
public function get,set PdfColorImageCompression : PdfCompression
public: __property PdfCompression get_PdfColorImageCompression();
public: __property void set_PdfColorImageCompression( 
   PdfCompression value
);
public:
property PdfCompression PdfColorImageCompression {
   PdfCompression get();
   void set (    PdfCompression value);
}

Property Value

A member of the PdfCompression enumeration. The default value is PdfCompression.PdfCompressionJPEG.
Example
Setting up the required image compression.
Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter()
    Dim status As GdPictureStatus = gdpictureDocumentConverter.LoadFromFile("input.jpg", GdPicture14.DocumentFormat.DocumentFormatJPEG)
    If status = GdPictureStatus.OK Then
        MessageBox.Show("The file has been loaded successfully.", "GdPicture")
        'Set the required compression parameter here.
        gdpictureDocumentConverter.PdfColorImageCompression = PdfCompression.PdfCompressionJPEG
        status = gdpictureDocumentConverter.SaveAsPDF("output.pdf", PdfConformance.PDF)
        If status = GdPictureStatus.OK Then
            MessageBox.Show("The file has been saved successfully.", "GdPicture")
        Else
            MessageBox.Show("The file has failed to save. Status: " + status.ToString(), "GdPicture")
        End If
    Else
        MessageBox.Show("The file has failed to load. Status: " + status.ToString(), "GdPicture")
    End If
End Using
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
    GdPictureStatus status = gdpictureDocumentConverter.LoadFromFile("input.jpg", GdPicture14.DocumentFormat.DocumentFormatJPEG);
    if (status == GdPictureStatus.OK)
    {
        MessageBox.Show("The file has been loaded successfully.", "GdPicture");
        //Set the required compression parameter here.
        gdpictureDocumentConverter.PdfColorImageCompression = PdfCompression.PdfCompressionJPEG;
        status = gdpictureDocumentConverter.SaveAsPDF("output.pdf", PdfConformance.PDF);
        if (status == GdPictureStatus.OK)
        {
            MessageBox.Show("The file has been saved successfully.", "GdPicture");
        }
        else
        {
            MessageBox.Show("The file has failed to save. Status: " + status.ToString(), "GdPicture");
        }
    }
    else
    {
        MessageBox.Show("The file has failed to load. Status: " + status.ToString(), "GdPicture");
    }
}
See Also