Esempio n. 1
0
        public void Print(IDocument document, string jobTitle)
        {
            var printDialog = new PrintDialog();
            if (printDialog.ShowDialog() != true)
                return;

            DocumentPaginator documentPaginator = new XpsPrintingDocumentPaginator(document);
            printDialog.PrintDocument(documentPaginator, jobTitle);
        }
Esempio n. 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);
            }
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
        public void Print(IDocument document, string jobTitle)
        {
            var printDialog = new PrintDialog();

            if (printDialog.ShowDialog() != true)
            {
                return;
            }

            DocumentPaginator documentPaginator = new XpsPrintingDocumentPaginator(document);

            printDialog.PrintDocument(documentPaginator, jobTitle);
        }