andyhutch77 / MvcRazorToPdf

Create pdf documents within an asp .net mvc project by generating your views as normal but returning a PdfActionResult. This converts regular produced razor/html to pdf documents in the browser using the iTextXmlWorker.
125 stars 105 forks source link

Filename & Page Orientation #10

Closed cindro closed 9 years ago

cindro commented 10 years ago

This is a great tool, its also quite fast.

I was wondering if it is possible to change generate PDF's name?

Also if it is possible to change page orientation or width and height?

Thank you.

ElanHasson commented 10 years ago

supposedly you can use @page in css http://stackoverflow.com/questions/8535518/itext-generate-a-pdf-file-from-html-in-a3

CSS: @page { size: 8.5in 11in; }

I couldn't get it to work.

ElanHasson commented 10 years ago

@cindro i've updated the package to set PDF names and change Page orientation and width/hight.

See updated sample code.

@andyhutch77 please update here once you push the new Nuget Package.

cindro commented 10 years ago

@ElanHasson, thanks for your contribution to the package, but when will it get updated?

andyhutch77 commented 10 years ago

@cindro @ElanHasson Hi, Main is up to date in GitHub. I will hopefully get time to update the nuget package today. keep u posted.

andyhutch77 commented 10 years ago

@cindro Hi Cindro, sorry for the delay I have now updated the nuget package with @ElanHasson 's changes.

Thank you Elan, your changes have improved the project a lot. :+1:

cindro commented 10 years ago

@andyhutch77 @ElanHasson You guys are amazing, this is definitely the best and most simple MVC PDF generator imho. Thank you.