documentpaginator

Blank pages when implementing DocumentPaginator

不想你离开。 提交于 2019-12-31 05:42:43
问题 I'm trying to implement a Paginator like this: public class MyPaginator : DocumentPaginator{ // ommitting details... public override DocumentPage GetPage(int pageNumber) { DocumentPage page = new DocumentPage(canvas); return page; } } It compiles, it runs, but the page is blank (white). the 'canvas' is an instance of System.Windows.Controls.Canvas. When I put it in a on-screen container like ScrollViewer it renders perfectly. XpsDocument _xpsDocument = CreateXpsDoc(myPaginatorInstance); The

Blank pages when implementing DocumentPaginator

依然范特西╮ 提交于 2019-12-31 05:42:05
问题 I'm trying to implement a Paginator like this: public class MyPaginator : DocumentPaginator{ // ommitting details... public override DocumentPage GetPage(int pageNumber) { DocumentPage page = new DocumentPage(canvas); return page; } } It compiles, it runs, but the page is blank (white). the 'canvas' is an instance of System.Windows.Controls.Canvas. When I put it in a on-screen container like ScrollViewer it renders perfectly. XpsDocument _xpsDocument = CreateXpsDoc(myPaginatorInstance); The

Is it possible in WPF to get content of each DocumentPage by page number?

自作多情 提交于 2019-12-11 02:54:50
问题 I use DocumentPaginator to divide FlowDocument's text into pages. Is it possible to get content of each pages by page number after ComputePageCount()? If not, how can I do it in other way? Code: var flowDocument = this.Document; flowDocument.MaxPageHeight = this.MaxContentHeight; DocumentPaginator paginator = ((IDocumentPaginatorSource)flowDocument).DocumentPaginator; paginator.ComputePageCount(); 回答1: Yes, it is possible. Here is an example: MainWindow.xaml <Window x:Class="WpfApplication

DocumentPaginator that works with any Visual? [closed]

☆樱花仙子☆ 提交于 2019-12-10 15:58:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Printing any visual is easy. Printing one that is larger than a single page is hard. I'm stuck. The docs are scarce and I've gotten as far as I can. I'm wondering if anybody has a class which extends DocumentPaginator that can take any visual (or even a UIElement) and split it across multiple pages. I attempted

Blank pages when implementing DocumentPaginator

那年仲夏 提交于 2019-12-02 09:49:45
I'm trying to implement a Paginator like this: public class MyPaginator : DocumentPaginator{ // ommitting details... public override DocumentPage GetPage(int pageNumber) { DocumentPage page = new DocumentPage(canvas); return page; } } It compiles, it runs, but the page is blank (white). the 'canvas' is an instance of System.Windows.Controls.Canvas. When I put it in a on-screen container like ScrollViewer it renders perfectly. XpsDocument _xpsDocument = CreateXpsDoc(myPaginatorInstance); The only thing that is working is that the page's size is set to the size of the canvas. What am I missing?