Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pdf = new ActionAsPdf("ActionName", new { parameters })
- {
- FileName = $"{fileName}.pdf",
- CustomSwitches = "--disable-smart-shrinking --load-error-handling ignore",
- PageSize = Size.A4,
- PageMargins = new Margins(0, 0, 0, 0),
- };
- var pdfByteArr = pdf.BuildFile(this.ControllerContext);
- this.Response.AddHeader("Content-Type", "application/pdf");
- this.Response.AddHeader("Content-Disposition", "inline");
- return this.File(pdfByteArr, "application/pdf");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement