hearsid / ng-html-to-pdf-save

Save HTML as pdf file on the browser with angularjs .
28 stars 35 forks source link

Landscape format #25

Closed elmeerr closed 6 years ago

elmeerr commented 7 years ago

Hi,

I'm using this directive and it works properly, however my layout is to print as landscape. There is a property do make the PDF landscape?

Kind regards.

Slowair6 commented 7 years ago

Have you find a solution yet? I'm looking for a way to resize the paper which is similar thing.

the question is how to config the directive

elmeerr commented 7 years ago

@Slowair6 I didn't look at anymore...I was trying to find another solution in the meantime. I'll also see the directive to try to implement the landscape option

kmilovm commented 7 years ago

You just have to play around with jsPDF and its initialization parameters, in this case you should look for jsPDF object creation and replace with the one that you want, ie: new jsPDF('l', 'pt', 'legal'); that works for me. If you want to look at deeper on those parameters you should look at here: http://rawgit.com/MrRio/jsPDF/master/docs/index.html

I strongly recommend you download the debug versions of the js for making that adjustments.

Hope that it helps, because this great lib seems to be alone on the web....

hearsid commented 6 years ago

Sorry for the late reply, I agree with @kmilovm

elmeerr commented 6 years ago

This issue can be closed