【发布时间】:2011-12-30 04:25:02
【问题描述】:
我有一个 pdf 文件,其中包含不同章节的书签(每个章节都使用书签链接到单独文件夹中的另一个 pdf 文件)。单击每个章节名称将在同一个父 pdf 文件中打开一个新的 pdf。
我需要检索父 pdf 文件的书签 URL 并更改 URL。我使用下面的代码来检索书签属性(操作、文件、标题等),但是没有成功更改路径,因为它是字典键值对。
IList<Dictionary<String, Object>> bmProperties= SimpleBookmark.GetBookmark(new PdfReader(new RandomAccessFileOrArray("http://XXXX/Shared%20Documents/Chapters.pdf"),
null));
foreach (IDictionary<String, Object> bmProperty in bmProperties)
{
foreach (var fileProperty in bmProperty.Keys)
{
if (fileProperty == "File")
{
// need the edit the value of Key-"File". Will it be possible to alter the value using pdfwriter
}
}
【问题讨论】:
-
您使用的是哪个 PDF 操作库?
-
我已更新您的标签以反映。请记住包含与您的问题相关的所有标签(作为标签和标题中的 not)。
-
这些是真正的 Pdf 书签吗?它们是否出现在 Acrobat 的“书签”面板中?或者它们只是页面上的超链接?如果是后者,那么请看这篇帖子stackoverflow.com/a/8141831/231316
-
为什么这个问题被否决了?
标签: c# itextsharp bookmarks