Hi,
I am using Aspose.Pdf.Kit for processing Pdf Documents in C# .Net Application.
I am Getting “Cannot access closed stream” Exception while processing GetNextImage function for retrieving image for a particular page.
I have used following code:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Image bitmap = null;
private PdfConverter _pdfDocument = new PdfConverter();
_pdfDocument.BindPdf(_fileName);
_pdfDocument.StartPage = index + 1;
_pdfDocument.EndPage = index + 1;
_pdfDocument.Resolution = 96;
_pdfDocument.DoConvert();
using (MemoryStream strem = new MemoryStream())
{
_pdfDocument.GetNextImage(strem, System.Drawing.Imaging.ImageFormat.Bmp);
bitmap = Image.FromStream(strem);
}
please let me know if anything wrong in my code and provide me the correct solution.
Thanks,
Sarath