File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -129,11 +129,19 @@ function wrapInDocument(xmlSnippet: string): string {
129129 return xmlSnippet ;
130130 }
131131
132- // Wrap the snippet in a document structure
132+ // Wrap the snippet in a document structure with small page size and margins
133+ // for better display in the preview container.
134+ // Page width: 4 inches = 5760 twips
135+ // Left/right margins: 0.1 inches = 144 twips
136+ // Top/bottom margins: 0.25 inches = 360 twips
133137 return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
134138<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
135139 <w:body>
136140 ${ xmlSnippet }
141+ <w:sectPr>
142+ <w:pgSz w:w="5760" w:h="15840"/>
143+ <w:pgMar w:top="360" w:right="144" w:bottom="360" w:left="144" w:header="720" w:footer="720"/>
144+ </w:sectPr>
137145 </w:body>
138146</w:document>` ;
139147}
You can’t perform that action at this time.
0 commit comments