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

Margins don't work

Open obrezalovro opened this issue 2 years ago • 1 comments

const options = {
  margins: {
    top: 10000,   // Set the top margin to 1 centimeter
    right: 2400, // Set the right margin to 2 centimeters
    left: 5000   // Set the left margin to 2 centimeters
  },
  pageNumber: true,
  font: 'Arial',
  fontSize: 18,
  footer: true,
  header: true,
}

This options object doesn't affect the exported document - did I create the object wrong?

obrezalovro avatar Oct 23 '23 08:10 obrezalovro

Hey, if you are using the params to define you files' margins, you have to define all of the params :

// WILL WORK
{
  "margins": {
    "header": 240,
    "footer": 240,
    "top": 80,
    "bottom": 80,
    "left": 90,
    "right": 90
  }
}
// WON'T WORK
{
  "margins": {
    "header": 240,
    "footer": 240,
    "top": 80,
    "bottom": 80,
    "left": 90
    // "right": 90
  }
}

See #57 for more info

AngrySquirrell avatar Feb 20 '25 15:02 AngrySquirrell