You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
issue : setting the heading to TITLE in first paragraph causes other paragraph to inherit the heading style of first paragraph
code to generate the error:
constdocx=require('docx');constfs=require('fs');// Create a new documentconstdoc=newdocx.Document({sections: [{properties: {},children: [newdocx.Paragraph({text: "Document Title",heading: docx.HeadingLevel.TITLE,alignment: docx.AlignmentType.CENTER,}),newdocx.Paragraph({text: "",spacing: {before: 2000,// Adjust this value to move the content vertically},}),newdocx.Paragraph({children: [newdocx.TextRun({text: "This is the first centered paragraph.",}),],alignment: docx.AlignmentType.CENTER,}),newdocx.Paragraph({children: [newdocx.TextRun({text: "This is the second centered paragraph.",}),],alignment: docx.AlignmentType.CENTER,spacing: {before: 200,// Add some space between paragraphs},}),newdocx.Paragraph({children: [newdocx.TextRun({text: "This is the third centered paragraph.",}),],alignment: docx.AlignmentType.CENTER,spacing: {before: 200,},}),],}],});// Generate the documentdocx.Packer.toBuffer(doc).then((buffer)=>{fs.writeFileSync("centered_paragraphs_with_title.docx",buffer);});
The text was updated successfully, but these errors were encountered:
issue : setting the heading to TITLE in first paragraph causes other paragraph to inherit the heading style of first paragraph
code to generate the error:
The text was updated successfully, but these errors were encountered: