toondaey / nestjs-pdf

Nest js pdf generator
MIT License
83 stars 37 forks source link

Change PDF orientation #7

Closed luizsandoval closed 4 years ago

luizsandoval commented 4 years ago

Hi there,

I want to change the PDF orientation to use landscape instead of portrait. I've tried to change it using custom styling with CSS, but even so the content is still printed as portrait when I generate the PDF.

I also took a look at the docs, but I didn't found anything about this configuration.

Can you help me, please?

Best regards, Luiz Sandoval.

toondaey commented 4 years ago

Thanks for noting this. I think the option you need to change is in the PDFModuleOptions i.e. updating the view value object.

luizsandoval commented 4 years ago

Thanks for the quickly response!

I found the option as one of the parameters passed to the function that generates the PDF. As described on the docs, the parameters extends the CreateOptions from html-pdf and there is an option called orientation that serves exactly for what I need.

Once again, thanks :)

toondaey commented 4 years ago

Glad to be of help.