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

RadPDFViewer to wcf Stream object

1 Answer 125 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 14 Dec 2012, 04:05 PM
I am having trouble getting the RadPDF Viewer to bind to a wcf stream.

I am able to work with the stream and collect the bytes of the PDF in test so I know the wcf constructs are working,  however when I attempt to bind the radPDFViewer to the stream object from wcf I get the error below. Is the RadPDFviewer only able to support memory stream and file streams?

A first chance exception of type 'System.NotSupportedException' occurred in Telerik.Windows.Documents.Fixed.dll

... snippet from wcf call.

StreamAttachment = client.DownloadAttachment(txtDocumentOID.Text); PdfDocumentSource source = new PdfDocumentSource(StreamAttachment); //, FormatProviderSettings.ReadOnDemand); this.pdfViewer.DocumentSource = source; this.pdfViewer.DocumentSource.Loaded += (s, e) => { StreamAttachment.Close(); };

Thanks

1 Answer, 1 is accepted

Sort by
0
Kammen
Telerik team
answered on 19 Dec 2012, 09:47 AM
Hi Eric,

Can you check if this StreamAttachment supports both Read and Seek operations? This is a requirement that will allow PdfFormatProvider to work correctly. If this stream does not support Seek, you can read all bytes to a MemoryStream and then create the PdfFontSource with it.

If you have further problems do not hesitate to contact us.


Greetings,
Kammen
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PDFViewer
Asked by
Eric
Top achievements
Rank 1
Answers by
Kammen
Telerik team
Share this question
or