Add Convenience functions
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// Example on how to customise the look at feel using Styles
|
||||
// Import from 'docx' rather than '../build' if you install from npm
|
||||
import * as fs from "fs";
|
||||
import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, TextRun, UnderlineType } from "../build";
|
||||
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, Packer, Paragraph, TextRun, UnderlineType } from "../build";
|
||||
|
||||
const doc = new Document({
|
||||
creator: "Clippy",
|
||||
@ -56,7 +56,7 @@ const doc = new Document({
|
||||
},
|
||||
paragraph: {
|
||||
indent: {
|
||||
left: 720,
|
||||
left: convertInchesToTwip(0.5),
|
||||
},
|
||||
spacing: {
|
||||
line: 276,
|
||||
@ -168,8 +168,7 @@ doc.addSection({
|
||||
text: "Strong Style",
|
||||
}),
|
||||
new TextRun({
|
||||
text:
|
||||
" - Very strong.",
|
||||
text: " - Very strong.",
|
||||
}),
|
||||
],
|
||||
}),
|
||||
|
Reference in New Issue
Block a user