RadPDFViewer to wcf Stream object

2 posts, 0 answers
  1. Eric
    Eric avatar
    3 posts
    Member since:
    Aug 2012

    Posted 14 Dec 2012 Link to this post

    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(); };

  2. Kammen
    Kammen avatar
    313 posts

    Posted 19 Dec 2012 Link to this post

    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.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top