I am trying to add Headers / footers to a WPF FlowDocument
. I Found a solution on the Internet here that is using a custom Paginator Class to do this. Unfortunately this only works when printing out the Document, which is not what I intend to do. My Idea was to use a FlowDocumentPageReader or something similar with a custom paginator, but somehow I can't figure out how I would do that, maybe anyone can give me a hint in the right Direction.
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
- How to properly change a resource dictionary
If you are just displaying the FlowDocument and not printing it, you can implement headers and footers by creating a control template for the FlowDocumentPageViewer.
In the template, place textblocks above and below the DocumentPageView, and bind them to the appropriate values.
For example, if you want a page number:
and so on for title, etc.
You can wrap the textblocks and DocumentPageView with a border so the whole thing appears as one page.