pageMargins property

HtmlFixedSaveOptions.pageMargins property

Specifies the margins around pages in an HTML document. The margins value is measured in points and should be equal to or greater than 0. Default value is 10 points.

get pageMargins(): number

Remarks

Depends on the value of HtmlFixedSaveOptions.pageHorizontalAlignment property:

Examples

Shows how to adjust page margins when saving a document to HTML.

let doc = new aw.Document(base.myDir + "Document.docx");

let saveOptions = new aw.Saving.HtmlFixedSaveOptions();
saveOptions.pageMargins = 15;

doc.save(base.artifactsDir + "HtmlFixedSaveOptions.pageMargins.html", saveOptions);

let outDocContents = fs.readFileSync(base.artifactsDir + "HtmlFixedSaveOptions.pageMargins/styles.css").toString();

expect(outDocContents.includes(".awpage { position:relative; border:solid 1pt black; margin:15pt auto 15pt auto; overflow:hidden; }")).toBeTruthy();

See Also