Hi, We are trying to convert PDF to image using CCIT4 compression and the attached files are not converting in a readable way. Could you please review the same. We are using Aspose Total version 25.6. Thank you
Sampletest.zip (516.5 KB)
Would you kindly share the sample code snippet for our reference that you have been using to convert PDF into TIFF? We will test the scenario in our environment and address it accordingly.
Hi @asad.ali …Please find the code snip below
Document pdfDocument = new Document(FullInputFileName);
#region Flatten
pdfDocument.Flatten();
#endregion
//create Resolution object
Resolution resolution = new Resolution(600);
//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.None;
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;
pdfDocument = null;
tiffSettings = null;
We faced an Exception while converting your files into TIF using Aspose.PDF for .NET 25.10. Would you please confirm by using the latest version that if you are also noticing it?
System.Runtime.InteropServices.ExternalException
HResult=0x80004005
Message=A generic error occurred in GDI+.
Source=System.Drawing
StackTrace:
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
In the meanwhile, we will generate ticket(s) in our issue tracking system and share the ID with you.
Hi @asad.ali ,
We’re currently using version 25.6 and are not encountering the error you mentioned. Could you please provide an estimated timeframe for when we can expect a resolution for this issue?
A ticket as PDFNET-61179 has been logged in our issue tracking system to further investigate the issue we faced with the latest version of the API. It will be investigated and resolved on first-come, first-served basis as per free support policies and as soon as we make some progress towards ticket resolution, we will update you via this forum thread. Please be patient and spare us some time.
We are sorry for the inconvenience.
Hi @asad.ali ,
Do we have and ETA for this ticket. We have a production issue and waiting for your response.
Thank you
We are afraid that the earlier logged ticket hasn’t been yet resolved due to other issues in the queue. Please note that the issue is logged under free support model and as per the policies, it will be prioritized on a first-come, first-served basis. As soon as your ticket is scheduled for an investigation or we have any kind of news about its ETA, we will inform you via this forum thread. Please be patient and spare us some time.
We are sorry for the inconvenience.