【问题标题】:Apply Formatting to pdf bookmarks using itextsharp使用 itextsharp 将格式应用于 pdf 书签
【发布时间】:2014-01-02 06:08:01
【问题描述】:

这是我的问题Add Page bookmarks to an existing PDF using iTextSharp using C# code

在 Bruno Lowagie 的指导下,我设法使用 iTextShrp 添加了 pdf 书签,但现在我需要为书签添加颜色和粗体格式。

请帮忙...

我确信这是可能的,因为我使用 ExportToXML 来检索已经格式化的书签,然后它也有格式化信息。

【问题讨论】:

    标签: c# pdf itextsharp


    【解决方案1】:

    就像我之前的回答一样,我希望你please read the documentation

    CreateOutlineTree 示例中解释了您的问题。如果bookmark 的类型是PdfOutline,您可以像这样更改样式和字体:

     bookmark.setStyle(Font.BOLD);
     bookmark.setColor(BaseColor.BLUE);
    

    如果您查看the C# port of the example,您会发现 iTextSharp 的细微差别:

     bookmark.Style = Font.BOLD;
     bookmark.Color = BaseColor.BLUE; 
    

    【讨论】:

    • 谢谢...真的很抱歉说我自己错过了找到它..下次会更加小心...
    猜你喜欢
    • 1970-01-01
    • 2015-02-28
    • 2013-08-10
    • 1970-01-01
    • 1970-01-01
    • 2012-06-15
    • 1970-01-01
    • 2012-08-18
    • 2018-02-24
    相关资源
    最近更新 更多