示例#1
0
        public void PrintPreview(IDocument document)
        {
            DocumentPaginator documentPaginator = new XpsPrintingDocumentPaginator(document);
            using (var xpsWrapper = new InProcXpsDocumentWrapper())
            {
                XpsDocumentWriter xpsWriter = XpsDocument.CreateXpsDocumentWriter(xpsWrapper.Document);
                xpsWriter.Write(documentPaginator);

                ShowXpsPreview(xpsWrapper.Document);
            }
        }
示例#2
0
        public void PrintPreview(IDocument document)
        {
            DocumentPaginator documentPaginator = new XpsPrintingDocumentPaginator(document);

            using (var xpsWrapper = new InProcXpsDocumentWrapper())
            {
                XpsDocumentWriter xpsWriter = XpsDocument.CreateXpsDocumentWriter(xpsWrapper.Document);
                xpsWriter.Write(documentPaginator);

                ShowXpsPreview(xpsWrapper.Document);
            }
        }