This is a migrated thread and some comments may be shown as answers.

Can't see PDF doc received from WCF's ByteArray

1 Answer 72 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Davide
Top achievements
Rank 1
Davide asked on 27 Oct 2012, 03:04 PM
Hello,
I'm trying to create an application where there is a WCS service that sends a Byte Array to a Silverlight Client. The Byte Array is created directly reading a PDF document through a Binary Reader. The PDF document is dinamically created server side.
In the Silverlight Client I use a MemoryStream to read the byte array that represents the PDF file.
Finally I pass the MemoryStream to the PDFDocumentSource that I use as DocumentSource Property in the PDF Viewer.
The problem is that I see "Loading..", then "Loading..." disappears and the document is not shown in the window.

Here's my VB code
Dim MyOutputStream as IO.MemoryStream
Dim MyFileContent As List(Of Byte)
.....retrieving data from WCF.....
MyOutputStream = New MemoryStream(MyFileContent.ToArray)
Dim MyPDFDocumentSource As New PdfDocumentSource(MyOutputStream)
AddHandler MyPDFDocumentSource.Loaded, AddressOf MyPdfDocumentSourceLoaded
RadPdfViewer1.DocumentSource = MyPdfDocumentSource
....Then I close the stream in the MyPdfDocumentSourceLoaded routine.....

I've also tried to read the PDF source file opening it in your online demo and everything works properly.
Do you have any ideas? Is it an encoding problem? Do you think I have to save the file in the Isolated Storage before open it in the Pdf Viewer Control?
Best regards.
David

1 Answer, 1 is accepted

Sort by
0
Davide
Top achievements
Rank 1
answered on 27 Oct 2012, 05:51 PM
Sorry,
it works perfectly, I made a mistake in the byte array index.
Thank you.
David

Tags
PDFViewer
Asked by
Davide
Top achievements
Rank 1
Answers by
Davide
Top achievements
Rank 1
Share this question
or