从 XPS 文档中检索超链接/书签列表?

发布于 2024-09-11 03:48:01 字数 213 浏览 3 评论 0原文

我有一个 .docx 文件,其中包含一堆书签和超链接。我可以在文档查看器中很好地浏览这些内容。我想要的是是否可以生成文件中包含的所有超链接的列表。从那里,我可以在文档查看器上创建一个 TreeView 并按名称(使用列表)而不是静态页码调用链接。

这可能吗?如果是这样,怎么办?

或者是否有一个[免费]实用程序可以生成一个包含所有超链接及其引用页码或 Uris 的 XML 文件?

I have a .docx file with a bunch of bookmarks and hyperlinks. I can navigate through these in documentviewer just fine. What I would like is if it was possible to generate a list of all of the hyperlinks contained in the file. From there, I can create a TreeView on the documentviewer and call the links by name (using the list) instead of static page numbers.

Is this possible? If so, how?

Or is there a [free] utility that could generate an XML file with all of the hyperlinks and their referenced page numbers or Uris?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黑白记忆 2024-09-18 03:48:01

我在发布问题后不久就发现了这一点,但我认为我应该将其发布在这里,因为我在其他地方收到了有关此问题的消息。

XPS 文档本质上是 zip 文件。打开并解压它。找到文档结构的方法,您将看到一个易于解析的 XML 文件。从那里,您可以从目录中获取有关超链接的所有信息。然后,您只需在 WPF 中用 C# 设置请求 URI 处理程序即可。

I figured this out shortly after posting the question, but thought I should post it here because I received a message elsewhere about this.

XPS documents are essentially zip files. Open and extract it. Find your way to docstructure and you'll see an XML file which is easy to parse. From there, you can get all the information you want about the hyperlinks from the table of contents. Then you just set the request URI handlers in C# in WPF.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文