privateOmega / html-to-docx

HTML to DOCX converter
MIT License
389 stars 143 forks source link

documentOptions margins honored? #199

Open BeanoKing opened 1 year ago

BeanoKing commented 1 year ago

When I set the left and right margins it doesn't seem to influence the format of the document at all. I've set them to zero but the Word file output looks exactly the same when I don't set them at all and use the object defaults. Is there a trick to influencing the margin left and right margin widths?

How I'm setting to zero:

documentOptions: {
  margins: {
    right: 0,
    left: 0
  }
}

Thanks

privateOmega commented 1 year ago

@BeanoKing Yea the merge logic isnt really great, but you can try the following to make it work with this, 0 doesnt work, so put 1 instead.

margins: {
      top: 1440,
      left: 1,
      right: 1,
      bottom: 1440,
      header: 720,
      footer: 720,
      gutter: 0,
    },
BeanoKing commented 1 year ago

BTW, setting to 1 didn't work. Still the same result

privateOmega commented 1 year ago

I wonder if it has anything to do with your typesetting software. This is how it looked for me in Word 2016 in MacOS

Before

Screenshot 2023-06-16 at 12 17 27 PM

After

Screenshot 2023-06-16 at 12 18 45 PM
sanjanaweb123 commented 1 year ago

top: 1440, left: 1, right: 1, bottom: 1440, header: 720, footer: 720, gutter: 0,

it's not working , please give me the solution . I have attached the my code screen short below
Screenshot 2023-07-05 185445

1990minds commented 1 year ago

Remove that documentOption object and use only margin also give the left, right higher values like above 400.