How to save Pdfsharp pdfDocument to a file path
I am using the pdfsharp for my project..
I am trying to save the converted PdfDocument object to a pdf file in a specified path..
i do have this method
public static PdfDocument ConvertTiff2Pdf(string docpath)
{
var pdfDoc = Tiff2Pdf(docpath);
return pdfDoc;
}
this will return PdfDocument and I want to save it to a "C:\temp\开发者_如何转开发docname.pdf" folder..
how can do it with csharp without using the http response.. because i have to first store it on the server then use.. please help me..
Just call the "void Save(string path)" method for your PdfDocument.
You can also save to a MemoryStream if you need both local file and http response. You can copy the stream to a local file and use stream.ToArray() for the http response.
Sample code (http response only) is here: http://www.pdfsharp.net/wiki/Clock-sample.ashx
精彩评论