Reputation: 16288
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?
Upvotes: 0
Views: 3931
Reputation: 21729
Use a function like Server.MapPath
to get the absolute path of the destination folder and pass that to the Save
method.
See also:
https://stackoverflow.com/a/1268755/1015447
Upvotes: 2