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. Image for the cookie policy date

Sending PDF file to PDF viewer

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.

3 Replies

DG Deepak Gunasekaran Syncfusion Team 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



VC Vladimir Culum March 19, 2016 10:15 PM UTC

Deepak,

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

Vladimir


DG Deepak Gunasekaran Syncfusion Team 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

Loader.
Up arrow icon