且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在iText7中使用文本超链接创建PDF/UA

更新时间:2023-02-08 21:38:10

您可能想要一个Link对象:

A Link object might be what you want:

            Link lnk = new Link("This is a Text link",
                PdfAction.CreateURI("https://itextpdf.com/"));
            lnk.SetFont(font);
            lnk.GetLinkAnnotation().SetBorder(new PdfAnnotationBorder(0, 0, 0));//Remove the default border
            lnk.GetAccessibilityProperties().SetAlternateDescription("Click here to go to the iText website");
            Paragraph para = new Paragraph();
            para.Add(lnk);
            document.Add(para);