3

在 Windows 8 中,我可以在本地新 PDF 查看器中打开任何 PDF 文件,并通过突出显示文本并单击“添加注释”来添加注释。

我希望能够使用 C# 以编程方式访问这些笔记。但我很难找到它们。我可以很容易地枚举文档属性,但我根本找不到注释......

这是我的代码:

        FileOpenPicker openPicker = new FileOpenPicker();
        openPicker.ViewMode = PickerViewMode.Thumbnail;
        openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
        openPicker.FileTypeFilter.Add(".pdf");
        StorageFile file = await openPicker.PickSingleFileAsync();

        var props = await file.Properties.RetrievePropertiesAsync(new List<string> { });

        foreach (var key in props.Keys)
        {
            Debug.WriteLine("key: " + key + " value: " + props[key]);
        }

        var docProp = await file.Properties.GetDocumentPropertiesAsync();
        var allDocProperties = await docProp.RetrievePropertiesAsync(new List<string> { });

        foreach (var key in allDocProperties.Keys)
        {
            Debug.WriteLine("key: " + key + " value: " + allDocProperties[key]);
        }

但是我在输出窗口中看到的所有属性都与我在 PDF 中创建的注释无关。

其他人可以在这里帮助我吗?

4

2 回答 2

1

这样做的结果是我不得不将足够多的代码从 iTextView 移植到 .NETCore 中,这很痛苦,但我得到了足够多的工作,这样我就可以传入 abyte[]并提取注释。

谢谢您的帮助。

于 2012-07-03T22:58:22.063 回答
0

Microsoft Reader 还将它们存储在自己的隔离存储中。具体来说,这些注释位于 Microsoft Reader 隔离存储中的 LocalState\PLM\Document 文件夹中。您可以在用户配置文件的 AppData\Local\Packages 中找到每个应用程序的隔离存储。

于 2012-06-27T05:22:36.253 回答