node-html-pdf icon indicating copy to clipboard operation
node-html-pdf copied to clipboard

How to set margin top on all pages?

Open golubvladimir opened this issue 3 years ago • 3 comments

I created project - https://github.com/golubvladimir/nestjs-generate-pdf

I want to create document with same header on all pages. I created header by element with id pageHeader. After I set height to 1px in options.

header: {
	height: '1px'
}

I don't know, how to set margin for all pages from header. Now it works only on first page.

golubvladimir avatar Apr 29 '22 13:04 golubvladimir

I have this problem only on Windows.

golubvladimir avatar May 05 '22 06:05 golubvladimir

I don't think you can set margins explicitly. However, if you apply a margin to the body like so:

body{
  margin: 30px;
}

This will apply a 30px margin around the content inside the document.

matthew-boston avatar Aug 21 '22 15:08 matthew-boston

It only adds the top margin on 1st page. How to do this at all page

DaraSingh1998 avatar May 17 '23 12:05 DaraSingh1998