We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Sending PDF file to PDF viewer

Thread ID:

Created:

Updated:

Platform:

Replies:

123439 Mar 17,2016 01:07 PM UTC Mar 21,2016 01:54 PM UTC WPF 3
loading
Tags: PdfViewer
Vladimir Culum
Asked On March 17, 2016 01:07 PM UTC

Hello,

In the app, I am creating PDF file from scratch.
I can create and save the file.

Is there any option that I don`t save file with some generic name and to open it in the viewer?

I want to create file and then send it to the viewer.

Then, user can save, print.... if there is need.

Other option is to create PDF file, save it, open it in Viewer and delete at the end (some kind of temp file).

Thank You.
Vladimir.

Deepak Gunasekaran [Syncfusion]
Replied On March 18, 2016 01:02 PM UTC

Hi Vladimir,


We can create a PDF file and display it in PDFViewer without saving the file by using the following code Snippet.


CS:

//Create a new PDF document.

PdfDocument document = new PdfDocument();

//Add a page to the document.

PdfPage page = document.Pages.Add();

//Save the document to Stream.

document.Save(Stream);

//Close the document.

document.Close(true);

// Load the stream in PdfViewerontrol

PdfViewerControl.Load(Stream);


We have created a simple sample to achieve the same and it can be downloaded from the following location:

http://www.syncfusion.com/downloads/support/forum/123439/ze/DisplayPDF1320875580.zip

Please try this and let us know whether it met your requirement.


Regards,

Deepak G


Vladimir Culum
Replied On March 19, 2016 10:15 PM UTC

Deepak,

Thank You. I made it to work as I wanted.

Vladimir

Deepak Gunasekaran [Syncfusion]
Replied On March 21, 2016 01:54 PM UTC

Hi Vladimir,

Thank you for your update. Please let us know if you need further assistance.

Regards,
Deepak G

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;