public void Paginate( Action<DocumentPaginator> act )
Parameters
- act
- an
Action<DocumentPaginator>
that is called with a DocumentPaginator with initialization work beforehand and cleanup work afterwards.
Action<DocumentPaginator>
that is called with a DocumentPaginator with initialization work beforehand and cleanup work afterwards.
DocumentPaginator
in a safe manner.public void Paginate( Action<DocumentPaginator> act )
Action<DocumentPaginator>
that is called with a DocumentPaginator with initialization work beforehand and cleanup work afterwards.docViewer
is a DocumentViewer
control and tempfilename
is a temporary disk file path: var xpsDocument = new XpsDocument(tempfilename, FileAccess.ReadWrite); myDiagram.PrintManager.Paginate(pager => { var dlg = new PrintDialog(); pager.PageSize = new Size(dlg.PrintableAreaWidth, dlg.PrintableAreaHeight); var writer = XpsDocument.CreateXpsDocumentWriter(xpsDocument); writer.Write(pager); docViewer.Document = xpsDocument.GetFixedDocumentSequence(); });