I used the following page as an example to generate the docx. https://github.com/dolanmiu/docx/blob/master/docs/usage/numbering.md
(docx)
PRE-DECLARATIONS
1. Previous Wills & Codicils
I revoke all previous wills and codicils.
2. Marital Status
Then used the serverless function from NativeDocuments to convert from docx to pdf. https://github.com/NativeDocuments/docx-to-pdf-on-AWS-Lambda
(generated pdf)
PRE-DECLARATIONS
Previous Wills & Codicils
I revoke all previous wills and codicils.
Marital Status
The following is the js code I have used to generate the numbered list
const numbering = new Numbering();
const abstractNum = numbering.createAbstractNumbering();
abstractNum.createLevel(0, "upperRoman", "%1", "start").addParagraphProperty(new Indent(720, 260));
abstractNum.createLevel(1, "decimal", "%2.", "start").addParagraphProperty(new Indent(1440, 980));
abstractNum.createLevel(2, "lowerLetter", "%3)", "start").addParagraphProperty(new Indent(2160, 1700));
const concrete = numbering.createConcreteNumbering(abstractNum);
doc.createParagraph('Previous Wills & Codicils').setNumbering(concrete, 0);
const packer = new Packer(doc, undefined, undefined, numbering);