Not able to convert pdf to tiff

Not able to convert pdf to tiff .Attaching the pdf file which cause the problem.
We are using Aspose.pdf v9.1.0

Using the below code:

public static System.Drawing.Image[] ConvertPDFtoMultiPageTiff(string OutputFolder, string FullInputFileName)
{
System.Drawing.Image[] sourceImages = null;
try
{
Document pdfDocument = new Document(FullInputFileName);
//create Resolution object
Resolution resolution = new Resolution(300);
//create TiffSettings object
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.CCITT4;
tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Format8bpp;
if (tiffSettings.Shape == ShapeType.Landscape)
tiffSettings.Shape = ShapeType.Portait;
tiffSettings.SkipBlankPages = false;
//tiffSettings.Brightness = .40f;
Stream output = null;
sourceImages = new System.Drawing.Image[pdfDocument.Pages.Count];
//create TIFF device
TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);
for (int page = 1; page <= pdfDocument.Pages.Count; page++)
{
Aspose.Pdf.ColorType pageColorType = pdfDocument.Pages[page].ColorType;
if (pageColorType == ColorType.Rgb)
{
tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Default;
}
else
{
tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Format1bpp;
}
output = new MemoryStream();
//tiffDevice.Process(pdfDocument, page, page, Path.Combine(OutputFolder, String.Concat(Path.GetFileNameWithoutExtension(FullInputFileName), “.”,page.ToString().PadLeft(3, ‘0’))));
tiffDevice.Process(pdfDocument,page,page, output);
sourceImages[page - 1] = System.Drawing.Image.FromStream(output);
sourceImages[page-1].Save(Path.Combine(OutputFolder, String.Concat(Path.GetFileNameWithoutExtension(FullInputFileName), “.”, page.ToString().PadLeft(3, ‘0’))));
output = null;
}
}
catch (Exception ex)
{
sourceImages = null;
throw new Exception(String.Format(“Error in splitTiffPages: {0}”, ex.Message));
}
return sourceImages;
}

Hi Shine,


Thank you for contacting Aspose support.

Your thread landed in Aspose.Imaging support forum whereas Aspose.Imaging APIs do not provide the feature of converting PDF files to TIFF images. However, Aspose.Pdf APIs support this feature, and your code segment also suggest that you are using the Aspose.Pdf for .NET API in your application. I am going to move this thread to the appropriate forum where my colleagues will evaluate your presented scenario and get back to you with updates in this regard.

Hi Shine

Thanks for using our API’s.

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-38437. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

The issues you have found earlier (filed as PDFNET-38437) have been fixed in Aspose.PDF for .NET 18.10.