I have been researching for the best thirdparty dll to generate word document. Finally I found NPOI is very good to write word document.
But I am unable to add the hyperlink to document.
I have been researching for the best thirdparty dll to generate word document. Finally I found NPOI is very good to write word document.
But I am unable to add the hyperlink to document.
The new NPOI examples is added at https://github.com/nissl-lab/npoi-examples/tree/main/xwpf/CreateHyperlink
XWPFParagraph paragraph = doc.CreateParagraph();
XWPFRun run = paragraph.CreateRun();
run.SetText("This is a text paragraph having ");
XWPFHyperlinkRun hyperlinkrun = CreateHyperlinkRun(paragraph, "https://www.google.com");
hyperlinkrun.SetText("a link to Google");
hyperlinkrun.SetColor("0000FF");
hyperlinkrun.SetUnderline(UnderlinePatterns.Single);