开发者

Retrieving a list of hyperlinks/bookmarks from an XPS Document?

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 number开发者_如何学JAVAs or Uris?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜