In This Topic
Programming / TIFF / Convert PDF, Documents, and Images to TIFF

Convert PDF, Documents, and Images to TIFF

In This Topic

The GdPicture.NET SDK includes the GdpictureDocumentConverter class, which provides many different methods and properties for document conversion of 100+ document/image formats.

Now, let’s see how to convert any supported format to a .tiff file:

Copy Code
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())

{

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

    if (status == GdPictureStatus.OK)

    {

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

    }

}

Do not forget to use the GdPictureStatus enumeration to have a following of your process and get potential errors.

As you can see in this example, we took as input a PDF, but you can select another format by just changing the path and the GdPicture14.DocumentFormat.DocumentFormatPDF in the «LoadFromFile » method.

GdPictureDocumentConverter provides two ways of saving your document as a TIFF:

You can also change properties of your convertion in order to select the range of pages you want to convert, the amount of DPIs, if you want to keep or not the annotations within the converted document, and more.
For example, this is how you change the DPIs of the output TIFF:

gdpictureDocumentConverter.RasterizationDPI = 300;

You will find all the properties here.