Hello!!
I’m having an issue when converting a PDF to PNG with some scanned documents. Some pages are unreadable, no matter which resolution I use with the PngDevice. I’ve tried several resolution settings or rendering options, with no better results.
This is the code I’m using:
public static void ImageConverter(String nameMask){
Document doc = new Document(System.Web.HttpContext.Current.Server.MapPath("/DoctosAspose/Convert/output" + nameMask + ".pdf"));
int TotalPages = doc.Pages.Count;
for (int pageCount = 1; pageCount <= TotalPages; pageCount++)
{
using (FileStream imageStream = new FileStream(System.Web.HttpContext.Current.Server.MapPath("/DoctosAspose/Input/image" + nameMask + "-1" + pageCount + ".png"), FileMode.Create))
{
//I've tried with different resolution settings.
//create PNG device with specified attributes
//var res = new Resolution(300);
//var res = new Resolution(300,300);
//PngDevice pngDevice = new PngDevice(res);
PngDevice pngDevice = new PngDevice(); //default constructor at 150dpi
//pngDevice.RenderingOptions.UseNewImagingEngine = true;
//pngDevice.RenderingOptions.ScaleImagesToFitPageWidth = true;
//pngDevice.RenderingOptions.InterpolationHighQuality = true;
//Convert a particular page and save the image to stream
pngDevice.Process(doc.Pages[pageCount], imageStream);
//Close stream
imageStream.Close();
}This text will be hidden
}
}
We have worked with the data shared by you and have been able to reproduce the issue in our environment. A ticket with ID PDFNET-46011 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.
Please note PDFNET-46011 was reproduced with Aspose.PDF for .NET 19.1 and has not been resolved yet owing to previously logged tickets.
It has been logged under free support model where issues have low priority and are resolved on first come first serve basis. The resolution of the logged issue may take several months depending upon how long is the queue of previously logged issues. Whereas, issues have high priority in paid support model and are dealt with high precedence. Paid support option is recommended for the customers who want their issues to be resolved on urgent basis.
As soon as we have significant updates regarding resolution of your issue, we will surely inform you in this very thread. Please be patient and spare us little time.
We are afraid PDFNET-46011 is still unresolved owing to previously logged and critical tickets. However, we have recorded your concerns and will let you know once any update will be available in this regard.
This issue is still broken in v22.8. When will this issue be fixed?? The issue is fixed when UseNewImagingEngine = false, but we need to set UseNewImagingEngine = true when rendering to fix other issues present in the library. Please provide a fix for this ASAP, this issue is almost three years old!!!
Would you please share a sample PDF and code snippet that you are using? We will create a separate ticket for your files and case and share it with you.
Please see attached “TestImage.pdf” as input, TestImage.jpg as output, and code below. Setting jpegDevice.RenderingOptions.UseNewImagingEngine = false corrects the issue, but we need to leave jpegDevice.RenderingOptions.UseNewImagingEngine = true for other issues with Aspose rendering.
A separate ticket as PDFNET-52672 has been logged in our issue tracking system for your files along with your concerns. We will definitely pay attention to this issue and let you know as soon as it is resolved. Please spare us some time.
The issues have already been escalated to the next level of priority and your concerns have been recorded as well. We will surely inform you once the attached tickets are resolved. We apologize for the inconvenience.