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

Free Support Forum - aspose.com

Stream was not readable


hi there, amm i have a bug found i think…
here is the prob that i found, i have this customized control.
now on the control i added a property

Public property PDFS as Stream
Get
Return m_pdfstream
End Get
Set(value As MemoryStream)
m_pdfstream = value
End Set
End Property

on the main form i added the control name of the control is PDFView1
and on the button1_click event of the form1 i added the code:
PDFView1.PDFS = stream
'this “stream” is from msg.attachments.item(0).save(stream) or the aspose.email.outlook

now on the control i have a button and i have this code on the click event:

Dim pdfdoc As Aspose.Pdf.Document = New Aspose.Pdf.Document(m_pdfstream)
SaveFileDialog1.Filter = “PDF (.pdf)|.pdf”
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor
pdfdoc.Save(SaveFileDialog1.FileName)
End If
but when i click the button the error says: Stream was not readable
and the VS highlights the line:
Dim pdfdoc As Aspose.Pdf.Document = New Aspose.Pdf.Document(m_pdfstream)

Hi Ivan,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the details.

Well, such error is thrown if the stream is not available or is null. To identify the cause of the issue, please create a sample application and post it here to show the issue. This will help us identify the issue and reply you soon.

Sorry for the inconvenience,