I have a method called Save which saves a PDF document at a specified location.
PdfDocument Document=new PdfDocument();
public void Save(string pathWithFileName)
{
Document.Save(pathWithFileName);
}
Now I draw some paragraphs, using XGrahics class. Then I save the document using Save method. It works perfectly.
Now I want to reopen document, add some stuff and again save the document. How can I do this?
To open an existing document, use Open() with the correct pathname:
PdfDocument document = PdfReader.Open(filenameDest);
Then make the changes. Finally save it as you already do:
document.Save(filenameDest);
PDFsharp comes with several samples.
You can download the complete sample code here:
http://pdfsharp.codeplex.com/releases/view/618773
Sample snippets and explanations can be found here:
http://www.pdfsharp.net/wiki/PDFsharpSamples.ashx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With