html-to-docx icon indicating copy to clipboard operation
html-to-docx copied to clipboard

documentOptions margins honored?

Open BeanoKing opened this issue 2 years ago • 5 comments

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

BeanoKing avatar Apr 23 '23 00:04 BeanoKing

@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,
    },

privateOmega avatar May 09 '23 06:05 privateOmega

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

BeanoKing avatar Jun 15 '23 23:06 BeanoKing

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

privateOmega avatar Jun 16 '23 09:06 privateOmega

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

sanjanaweb123 avatar Jul 05 '23 13:07 sanjanaweb123

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

1990minds avatar Aug 02 '23 12:08 1990minds