Пример #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);
            }
        }