Open pdfviewer with stream

5 posts, 0 answers
  1. MARIE
    MARIE avatar
    19 posts
    Member since:
    Mar 2013

    Posted 19 Apr 2013 Link to this post

    Hi,
    Sorry if question has already been post, but I need to have a full answer about how to manage the pdfviewer.
    I use raddocument to export pdf from a collection of data.
    My goal is to propose a window which embed the same pdf generated on the fly using your PdfViewer.
    I don't want to save a pdf nor in a server nor in the user hard disk.

    1) Is it possible after a clic on a button to realize this scenario?
    2) If 1) is ok, how long, user need to wait before displaying this window considering a stream of data greater that 20Mo?
    3) With a printpreview could I have the same aspect than my raddocument exported?
    4) Is there a difference if 1) is possible between Out of brower and In browser?

    Thank a lot for your answers.

    Regards,

    TB
  2. MARIE
    MARIE avatar
    19 posts
    Member since:
    Mar 2013

    Posted 23 Apr 2013 Link to this post

    Hi,
    Is this question too long?

    Regards

    TB
  3. DevCraft banner
  4. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 23 Apr 2013 Link to this post

    Hi TB,

    To your questions:
    1. Here you can find RadRichTextBox - RadPdfViewer integration demo that can help you in adopting the needed approach. Exporting the needed document and showing it on a button click in RadPDfViewer should be possible.
    2. It depends on the data. RadPdfViewer is designed to read pages on demand, so it should not take a long time. However, the export can be slow if the data is large (for example containing big images).
    3. Can you further explain what you are trying to achieve?
    4. We are not aware of a difference between OOB and In browser applications in this case.

    Regards,
    Kammen
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. MARIE
    MARIE avatar
    19 posts
    Member since:
    Mar 2013

    Posted 23 Apr 2013 Link to this post

    Hi Kammen,

    Thank a lot for answering as well!

    About 3 : I would like to realize something like :

    richtextbox.Document = generatePdfContentWithRaddoCument();
    richtextbox.printPreview();


    I create a RadWindow and it works well.

    About 1:

    I would exactly want to do this, but this morning, nothing works well :-(

    private void UpdatePdfViewer()
            {
                MemoryStream outputStream = new MemoryStream();
                this.providerPdf.Export(this.radRichTextBox.Document, outputStream);
                this.radRichTextBox.UpdateEditorLayout();
                this.pdfViewer.DocumentSource = new PdfDocumentSource(outputStream);
                this.pdfViewer.DocumentSource.Loaded += (s, e) => { outputStream.Close(); };
            }


    Just to say thanks again and tell for me  the problem resolved. :-)

    Regards,

    Thierry B
  6. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 24 Apr 2013 Link to this post

    Hi,

    We are glad that you were able to solve the problem. Don't hesitate to contact us if you have other questions.

    Regards,

    Kammen
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner