dolanmiu / docx

Easily generate and modify .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
https://docx.js.org/
MIT License
4.36k stars 484 forks source link

how to add horizontal line? #437

Closed cool-firer closed 4 years ago

cool-firer commented 5 years ago

is there a way to add horizontal line, cant find api related to it.

rajavijayavendan commented 4 years ago

@cool-firer Any workaround for drawing shapes?

cool-firer commented 4 years ago

@rajavijayavendan no solution.

nasriime commented 4 years ago

try this works in version 5.0.0-rc5

new Paragraph({ text: " ", thematicBreak: true, }),

dolanmiu commented 4 years ago

This is how you do it with docx. It add's a border to a paragraph

https://github.com/dolanmiu/docx/blob/master/demo/26-paragraph-borders.ts

This is how it is done officially with Microsoft Word too:

Word generated code:

<p w:rsidR="00F371A5" w:rsidRDefault="00F371A5">
    <pPr>
        <pBdr>
            <bottom w:val="single" w:sz="12" w:space="1" w:color="auto" />
        </pBdr>
    </pPr>
    <bookmarkStart w:id="0" w:name="_GoBack" />
    <bookmarkEnd w:id="0" />
</p>