I'm new to PDFSharp and I'm trying to save a PDF document, but when I call renderer.PdfDocument.Save(filename)
it attempts to save it inside C:\Program Files\IIS Express\
and obviously it crashes out of denied permission.
How can I save the PDF document to /Content/ folder inside my MVC project?
Use a function like Server.MapPath
to get the absolute path of the destination folder and pass that to the Save
method.