Cannot save using filepath as in Getting Started example

Hi,

I am using the getting started example in the below link to write text.

Create or Generate PDF file in C# and VB.NET | Syncfusion

The example shows the doc.Save function accepting a string for the filepath. But when I try it, the doc.Save function only accepts an IOStream. Is the Save(string) (and the documentation) deprecated?


I installed this nuget package, because my console app is targeting .net6.0

Syncfusion.Pdf.Net.Core.nupkg


Is that the right package? This code may be used on Winforms or WPF at some point. But for now I want it in a Console App.






Attachment: screenshots_22aaa570.zip

1 Reply

IJ Irfana Jaffer Sadhik Syncfusion Team June 9, 2022 12:29 PM UTC

Hi Lorenzo,


In your update, you are referring the User Guide for Winforms platform. Please refer the below for the UG documentation of Net core Platform:



Please refer to the below code snippet to save the pdf document as filestream:

//Creating the stream object

MemoryStream stream = new MemoryStream();


//Save the document as stream

loadedDocument.Save(stream);


//If the position is not set to '0' then the PDF will be empty.

stream.Position = 0;


//Close the document.

loadedDocument.Close(true);


File.WriteAllBytes("Output.pdf", stream.ToArray());



Please let us know if you need any further assistance in this.


Regards,

Irfana J.


Loader.
Up arrow icon