问题
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..
回答1:
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
来源:https://stackoverflow.com/questions/6194280/how-to-save-pdfsharp-pdfdocument-to-a-file-path