kempsteven / vue-html2pdf

vue-html2pdf converts any vue component or element into PDF, vue-html2pdf is basically a vue wrapper only and uses html2pdf.js behind the scenes.
https://www.npmjs.com/package/vue-html2pdf
MIT License
440 stars 74 forks source link

Uknown padding left in landscape mode #22

Closed PlinioMayer closed 4 years ago

PlinioMayer commented 4 years ago

First of all I would like to thank you for your software, it actually saved me in my work. I had a great time generating pdf's in portrait mode, no problems. But when I try to generate in landscape, the layout preview looks fine, but the generated pdf comes with a padding left that I can't get rid off

`<vue-html2pdf :show-layout="true" :enable-download="true" :preview-modal="true" :paginate-elements-by-height="3000" filename="file" :pdf-quality="2" pdf-format="a4" pdf-orientation="landscape" pdf-content-width="1123px" @hasGenerated="$emit('generated', $event)"

`

The layout I'm passing is just a section with width 100% and height 794px aligning some text. Some images:

Layout:

layout

Preview:

preview

kempsteven commented 4 years ago

Hey thanks for appreciating my work!

I tried replicating what you did from your example, Here is my code: image

and here is the result, I can't seem to replicate your issue. image

But when I added margin-left on the element, it seems to have that white space on the left like from your screenshot, so there could be margin on one of your elements I presume? could you give me a sample your styling? ill try it on my end.

kempsteven commented 4 years ago

Feel free to open this if the issue persist!

akbarism commented 3 years ago

i have same issue here,

cassioutfpr commented 3 years ago

I had a similiar issue here but in portrait mode. I checked my elements and none of them seems to have a margin left (of course that I can be wrong). But this is my code:

image

And this is the result:

image

I fixed it by appying a margin-left: -10px in the inner section component. I'm using vue 2. btw thanks for this repo!