Closed germanger closed 9 years ago
Yes, I believe so as the ViewBag is used for the Title in all the examples. :)
Awesome! works great! Thanks.
Maybe there should be an overload for the PdfActionResult constructor so that it is not needed to pass a null
Instead of this:
return new PdfActionResult(null, (writer, document) =>
{
document.SetPageSize(new Rectangle(792f, 612f));
document.NewPage();
})
{
FileDownloadName = "foo.pdf"
};
Just this:
return new PdfActionResult((writer, document) =>
{
document.SetPageSize(new Rectangle(792f, 612f));
document.NewPage();
})
{
FileDownloadName = "foo.pdf"
};
I could make a pull request
Yes, I would probably just add a default parameter and initialise it to null, that way we won't need to create an overload but it will achieve the same effect. :+1:
Ah right, I would do it that way too
Can I use ControllerContext.GeneratePdf
with ViewBag instead of passing the model?
Can I use ViewBag instead of passing a model?
eg. Instead of this:
Something like:
Why? because I don't like the idea of creating a model only for the purpose of transporting two different objects to that view.