Example





In This Topic

RasterizationDPI Property (GdPictureDocumentConverter)

In This Topic
Sets the rendering resolution to be used when converting vector content to raster content, if any is included in the currently loaded document.
Syntax
'Declaration

 

Public Property RasterizationDPI As Single
public float RasterizationDPI {get; set;}
public read-write property RasterizationDPI: Single; 
public function get,set RasterizationDPI : float
public: __property float get_RasterizationDPI();

public: __property void set_RasterizationDPI( 

   float value

);
public:

property float RasterizationDPI {

   float get();

   void set (    float value);

}

Property Value

The default value is 200.
Example
Converting and saving a PDF document to a TIFF image file along with specifying the required DPI.
Using gdpictureDocumentConverter As New GdPictureDocumentConverter()

    Dim status As GdPictureStatus = gdpictureDocumentConverter.LoadFromFile("drawing.pdf", GdPicture14.DocumentFormat.DocumentFormatPDF)

    If status = GdPictureStatus.OK Then

        'Setting the required rasterization parameter.

        gdpictureDocumentConverter.RasterizationDPI = 300

        status = gdpictureDocumentConverter.SaveAsTIFF("drawing_image.tiff", TiffCompression.TiffCompressionAUTO)

        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("drawing.pdf", GdPicture14.DocumentFormat.DocumentFormatPDF);

    if (status == GdPictureStatus.OK)

    {

        //Setting the required rasterization parameter.

        gdpictureDocumentConverter.RasterizationDPI = 300;

        status = gdpictureDocumentConverter.SaveAsTIFF("drawing_image.tiff", TiffCompression.TiffCompressionAUTO);

        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