Issue: We are normally daily convert a lot of PDF to Tiff using Aspose library. Last week we received a new PDF file from another source and tried to convert it to TIFF and it failed with the below exception.
Class: PdfConverter
Method: PdfConverter.BindPdf
Version: 7.7
Exception: Object Reference not Set to Instance of an Object
Platform: .net 3.5
Technical detail of issue:
- We read the pdf file in FileStream and create an object fileToConvert that we use to convert-
- We try to Convert using PdfConverter.BindPdf(stream) method and it fails with an exception Object Reference not set to Instance of an object. This only occurs on some files and not others.
Interestingly when I open the pdf file that does not convert and save it again using Adobe Acrobat and convert the newly saved file I do not produce the exception.
var pdfMs=new MemoryStream();
var msStream=new MemoryStream(fileToConvert.File);
var pdfConverter=new PdfConverter();
pdfConverter.Resolution=new Aspose.Pdf.Devices.Resolution(tiffResolution);
var tiffSettings = new TiffSettings();
tiffSettings.Depth = ColorDepth.Format1bpp;
tiffSettings.Compression = CompressionType.CCITT4;
pdfConverter.BindPdf(msStream); Error Happens
pdfConverter.DoConvert();
I’ve checked the forums and found a similar issue in the PdfExtractor class. I’m guessing the exception occurs in the Facade super class? It was mentioned that this Ticket PDFNEWNET-35069 was created and later remediated in release 8.2. When I checked the release notes for 8.2 I did not see this Ticket appear. Could someone from Aspose please confirm if this Exception was indeed remediated?
Also please confirm if this fix remediated PDFConvertor.bindPdf error. Thank you!
For reference: NullReferenceException generated by PdfExtractor.BindPdf() - Aspose.PDF Product Family - Free Support Forum - aspose.com