We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to add paragraph to STRUCTURED_DOCUMENT_TAG

Desired Output:-
<w:sdtContent>
<w:p w:rsidR=“00A254A6” w:rsidRDefault=“00A254A6” w:rsidP=“00830A06”>
<w:pPr>
<w:pStyle w:val=“NoSpacing” />
<w:spacing w:after=“240” />
</w:pPr>
<w:r>
<w:t>This is to test the spacing of the header.</w:t>
</w:r>
</w:p>
<w:p w:rsidR=“009C7F4A” w:rsidRPr=“00506F3E” w:rsidRDefault=“00A254A6” w:rsidP=“00830A06”>
<w:pPr>
<w:pStyle w:val=“NoSpacing” />
<w:spacing w:after=“240” />
</w:pPr>
<w:r>
<w:t>Spacing of header is messed up</w:t>
</w:r>
</w:p>
</w:sdtContent>

Current output, by just adding Run element(losing format, if we add just run):-
<w:sdtContent>
<w:r>
<w:rPr>
<w:rFonts w:ascii=“Times New Roman” w:eastAsia=“Times New Roman” w:hAnsi=“Times New Roman” w:cs=“Times New Roman” />
<w:sz w:val=“20” />
</w:rPr>
<w:t>This is to test the spacing of the header.</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii=“Times New Roman” w:eastAsia=“Times New Roman” w:hAnsi=“Times New Roman” w:cs=“Times New Roman” />
<w:sz w:val=“20” />
</w:rPr>
<w:t>Spacing of header is messed up</w:t>
</w:r>
</w:sdtContent>

Please suggest how to deal with it

Desired Output:-
<w:sdtContent>
<w:p w:rsidR=“00A254A6” w:rsidRDefault=“00A254A6” w:rsidP=“00830A06”>
<w:pPr>
<w:pStyle w:val=“NoSpacing” />
<w:spacing w:after=“240” />
</w:pPr>
<w:r>
<w:t>This is to test the spacing of the header.</w:t>
</w:r>
</w:p>
<w:p w:rsidR=“009C7F4A” w:rsidRPr=“00506F3E” w:rsidRDefault=“00A254A6” w:rsidP=“00830A06”>
<w:pPr>
<w:pStyle w:val=“NoSpacing” />
<w:spacing w:after=“240” />
</w:pPr>
<w:r>
<w:t>Spacing of header is messed up</w:t>
</w:r>
</w:p>
</w:sdtContent>

Current output, by just adding Run element(losing format):-
<w:sdtContent>
<w:r>
<w:rPr>
<w:rFonts w:ascii=“Times New Roman” w:eastAsia=“Times New Roman” w:hAnsi=“Times New Roman” w:cs=“Times New Roman” />
<w:sz w:val=“20” />
</w:rPr>
<w:t>This is to test the spacing of the header.</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii=“Times New Roman” w:eastAsia=“Times New Roman” w:hAnsi=“Times New Roman” w:cs=“Times New Roman” />
<w:sz w:val=“20” />
</w:rPr>
<w:t>Spacing of header is messed up</w:t>
</w:r>
</w:sdtContent>

Please suggest how to deal with it

@wrushasendakhane

Thanks for your inquiry. Please use StructuredDocumentTag.AppendChild method to add the Paragraph node to content control. We suggest you please read the following article.
Working with Content Control SDT