We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF Convert to TIFF Exception "Unable to read beyond the end of the stream."

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)


Thanks for sharing further details.

We have logged an investigation ticket as PDFNET-48152 in our issue tracking system. We will further look into details of it and keep you posted with the status of its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

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