0

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?

Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206

1 Answers1

2

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

Community
  • 1
  • 1