Hi,
Would like to know any example code that able to convert multiple pages of PDF file gif? I’m not able to find any example show how to do this.
Appreciate for your help.
Thanks.
Hi,
Would like to know any example code that able to convert multiple pages of PDF file gif? I’m not able to find any example show how to do this.
Appreciate for your help.
Thanks.
You can convert each page of a PDF file to a GIF image with this code:
// load PDF with an instance of Document
var document = new Aspose.Pdf.Document(dataDir + "Sample.pdf");
foreach (Page page in document.Pages)
{
using (FileStream imageStream = new FileStream(dataDir + "image_out" + page.Number + ".gif", FileMode.Create))
{
// Create Resolution object
Resolution resolution = new Resolution(300);
// Create Jpeg device with specified attributes
// Width, Height, Resolution
GifDevice GifDevice = new GifDevice(500, 700, resolution);
// Convert a particular page and save the image to stream
GifDevice.Process(page, imageStream);
// Close stream
imageStream.Close();
}
}