Working with a current Aspose.Total license, so I’ve tried this with both Aspose.PDF Version 19.11 (current production), and Version 20.5.0 (most recent on nuget).
Rougly 1 in 200,000 PDF documents I receive from an outside partner fail conversion to TIFF with the Exception “Unable to read beyond the end of the stream.”
I’ve stripped one of these “bad” documents of propriety information and left only a few elements, including the Widget annotations that trigger the failure. If I remove the Annotations that remain in the attached document, I can convert the document to TIFF.
Can you tell me what is wrong with the offending Widget Annotations, and if there is some Aspose Processing I could do to enable conversion to Image to complete.
Aspose.Pdf.Document pdfDoc = new Aspose.Pdf.Document(new MemoryStream(pdf));
Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(200);
Aspose.Pdf.Devices.TiffSettings tiffSettings = new Aspose.Pdf.Devices.TiffSettings();
tiffSettings.Compression = Aspose.Pdf.Devices.CompressionType.CCITT4;
tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Format1bpp;
tiffSettings.SkipBlankPages = false;
Aspose.Pdf.Devices.TiffDevice tiffDevice = new Aspose.Pdf.Devices.TiffDevice(resolution, tiffSettings);
MemoryStream outStrm = new MemoryStream();
tiffDevice.Process(pdfDoc, 1, 1, outStrm);MDRFailsConversionToTif.pdf (19.0 KB)