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

Open pdfviewer with stream

4 Answers 74 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
MARIE
Top achievements
Rank 1
MARIE asked on 19 Apr 2013, 11:53 AM
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

4 Answers, 1 is accepted

Sort by
0
MARIE
Top achievements
Rank 1
answered on 23 Apr 2013, 08:15 AM
Hi,
Is this question too long?

Regards

TB
0
Kammen
Telerik team
answered on 23 Apr 2013, 08:50 AM
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.

0
MARIE
Top achievements
Rank 1
answered on 23 Apr 2013, 10:27 AM
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
0
Kammen
Telerik team
answered on 24 Apr 2013, 10:32 AM

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.

Tags
RichTextBox
Asked by
MARIE
Top achievements
Rank 1
Answers by
MARIE
Top achievements
Rank 1
Kammen
Telerik team
Share this question
or