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.
Unfortunately, activation email could not send to your email. Please try again.

Saving a PdfDocument by .save("output") does not work?

Thread ID:

Created:

Updated:

Platform:

Replies:

132897 Sep 27,2017 12:24 PM Oct 2,2017 02:48 AM Xamarin.Forms 3
loading
Tags: PDF
Johannes Berghult
Asked On September 27, 2017 12:24 PM

Hi,

I am trying to create and save a PDF document according to this:

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a page to the document.
PdfPage page = document.Pages.Add();
//Create PDF graphics for the page.
PdfGraphics graphics = page.Graphics;
//Set the standard font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 20);
//Draw the text.
graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document.
document.Close(true);

However, the document.save() method does not take String as parameter but only System.IO.Stream. What should I do? 
The instructions with the code is taken from: https://help.syncfusion.com/file-formats/pdf/getting-started?cs-save-lang=1&cs-lang=csharp 

Thank you in advance!

Sasi Kumar Sekar [Syncfusion]
Replied On September 28, 2017 05:09 AM

Hi Johannes, 
 
Thank you for contacting Syncfusion support. 
 
In Xamarin platform we can save the document as steam only. We have created the simple sample to Generate PDF. Please find the UG document link and simple sample to save PDF document below for your reference. 
UG documentation Link to Save PDF document : 
Sample : 
 
Please let us know if you need further assistance. 
 
Regards, 
Sasi Kumar S. 


Johannes Berghult
Replied On September 29, 2017 05:45 AM

Hi Sasi,

Thank you very much for the great support!

Best regards,
Johannes

Ranjani Prabhakaran [Syncfusion]
Replied On October 2, 2017 02:48 AM

Hi Johannes, 

You are most welcome. 

Regards, 
Ranjani 


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.

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.

;