Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Hyperlinks from DocumentPaginator.GetPage() override in WPF not working

$
0
0

I'm wondering whether the issue related to hyperlinks not working in XPS documents created from flow documents (raised in the WPF Forum in 2009) has ever been solved. Almost 10 years later I still can't get active hyperlinks from a paginator designed to add headers. The problem appears to be that the override toGetPage(pageNumber) is required to return a DocumentPage, whereas the type of page that supports hyperlinks is a non-accessible type,MS.Internal.PtsHost.FlowDocumentPage. When I use my own paginator to add page headers, I have no choice but to return aDocumentPage from GetPage, and the hyperlinks are then stripped away. The XPS printer does the same thing, even though it's written by Microsoft and therefore should be able to access internal types. If I print a headeredFlowDocument using the PDF printer, links appear where I've defined them in the document and they work fine. If I print the same page to XPS, the style is correct for a hyperlink but it's just an inert piece of text. MyDocumentViewer has active hyperlinks if I paginate using the FlowDocument's own paginator, but if I want to add headers and footers, the hyperlinks are stripped away.

This has gradually become a major issue because it would be easier for me to support XPS files than PDF files in software documentation and in aDocumentViewer that consumes the documentation, but unless the hyperlinks can be kept active that's a no-go. And I definitely need headers and footers when I paginate the documents.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>