How to create heading when generating a docx document with OpenXML?
Is there some simple solution that will take a few lines?
How to create heading when generating a docx document?
private static void AddChapterHeader(WordprocessingDocument doc, string text, bool isFirstChapterHeaderOfLecture) { var t = new Text(text); Break[] topBrs = isFirstChapterHeaderOfLecture ? [new Break { Type = BreakValues.TextWrapping }, new Break { Type = BreakValues.TextWrapping }] : [new Break { Type = BreakValues.Page }]; var btnBr = new Break { Type = BreakValues.TextWrapping }; var run = […]