Advertisement
rozayppv

Rotativa

Jun 26th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. var pdf = new ActionAsPdf("ActionName", new { parameters })
  2. {
  3. FileName = $"{fileName}.pdf",
  4. CustomSwitches = "--disable-smart-shrinking --load-error-handling ignore",
  5. PageSize = Size.A4,
  6. PageMargins = new Margins(0, 0, 0, 0),
  7. };
  8.  
  9. var pdfByteArr = pdf.BuildFile(this.ControllerContext);
  10.  
  11. this.Response.AddHeader("Content-Type", "application/pdf");
  12. this.Response.AddHeader("Content-Disposition", "inline");
  13.  
  14. return this.File(pdfByteArr, "application/pdf");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement