We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Loading stream into PDFLoadedDocument. Unexpected type error

Thread ID:

Created:

Updated:

Platform:

Replies:

100260 Jul 20,2011 05:25 AM Jul 21,2011 04:36 AM Windows Forms 2
loading
Tags: PDF
John Owens
Asked On July 20, 2011 05:25 AM

Hi there,

I'm using the PDF component to load a stream from the database (SQL Server 2008). The stream in the database is stored as binary data type. Each stream has different contents and represent different file types e.g. .pdf, .doc, .jpg, .xls

I wrote a function to load the stream into a new PDF object.

==
Dim pdf As New Syncfusion.Pdf.Parsing.PdfLoadedDocument(strm)
pdf.Save("C:\lab\output.pdf")

pdf.Close()
pdf = Nothing
==

On the first line above, it would fail to load most time citing "Invalid/Unknown/Unsupported format". I noticed that when I loaded a stream that was a PDF file type, it would save. Any other types like .doc, .xls or .jpg, it would not save.

Can you please confirm if the stream is supposed to be a PDF type?

Is there any way I can 'convert' the stream to a PDF type so I can save it as a PDF?

Thanks.
John


John Owens
Replied On July 20, 2011 06:18 AM

Hi there,

I found the ExcelToPDF among your components. I was using a different namespace.

I've changed the code to check what file types are being returned so I can either save a PDF file directly or convert it first.

It works! Thanks.

John


Geetha M [Syncfusion]
Replied On July 21, 2011 04:36 AM

Hi John,

Thank you for your interest in Syncfusion products.

Glad to hear that you problem has been resolved.

Please let me know if you have any questions.

Regards,
Geetha


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;