We have a PDF with 11 pages, the conversion is taking 3 minutes. Is there anything that can be improve in this code:
//LoadLicense
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(licenseName);
//create return object
List<byte[]> images = new List<byte[]>();
//Load Byte Array to Stream
using (MemoryStream inputStream = new MemoryStream(InputFile))
{
//Load PDF
Document pdfDocument = new Document(inputStream);
//Set TIFF Options
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.CCITT4;
tiffSettings.Depth = ColorDepth.Format1bpp;
tiffSettings.SkipBlankPages = false;
//create TIFF device
Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(DefaultPdi);
TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);
//convert each page
for (int i = 0; i < pdfDocument.Pages.Count; i++)
{
using (MemoryStream outputStream = new MemoryStream())
{
//Process
tiffDevice.Process(pdfDocument, i + 1, i + 1, outputStream);
//Add Images
images.Add(outputStream.ToArray());
}
}
}
//return
return images;