为有中文需求的客户提供多渠道中文技术支持.

Wed Oct 18, 2023 3:45 am

如图:正文中的脚注角标1为红色,页尾的脚注角标1为红色。
需求:正文中的脚注角标1为红色,页尾的脚注角标1为黑色。
是否有api支持,将正文中的角标和页尾处的角标设置不同的颜色
参考代码:
Code: Select all
//找到脚注目标文字
        TextSelection selection = document.findString("VMFS", false, true);

        //添加脚注
        TextRange textRange = selection.getAsOneRange();
        Paragraph paragraph = textRange.getOwnerParagraph();
        int index = paragraph.getChildObjects().indexOf(textRange);
        Footnote footnote = paragraph.appendFootnote(FootnoteType.Footnote);
        paragraph.getChildObjects().insert(index + 1, footnote);

        //在脚注中添加一个段落
        Paragraph paragraph1 = footnote.getTextBody().addParagraph();

        //在脚注的段落中添加文本
        textRange = paragraph1.appendText("VMware Virtual Machine File System,虚拟机文件系统。");

        //设置脚注文本的格式
        textRange.getCharacterFormat().setFontName("Arial");
        textRange.getCharacterFormat().setFontSize(11);
        textRange.getCharacterFormat().setTextColor(Color.green);

        //设置脚注标示文本的格式
        footnote.getMarkerCharacterFormat().setFontName("Calibri");
        footnote.getMarkerCharacterFormat().setFontSize(12);
        footnote.getMarkerCharacterFormat().setBold(true);
        footnote.getMarkerCharacterFormat().setTextColor(Color.red);

aeon123456
 
Posts: 3
Joined: Fri Jun 30, 2023 9:27 am

Wed Oct 18, 2023 6:23 am

您好,

感谢您的咨询。
我们的Spire.Doc 目前不支持设置不同的样式,您的需求暂时无法满足,感谢您的理解。

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to 中文技术支持

cron