protected PrintProcessor()
        {
            _printDialog = new PrintDialogWrapper();
            _globalConfigurePrintDialog?.Invoke(PrintDialog);

            PageOrientation = PageOrientation.Portrait;
        }
Ejemplo n.º 2
0
        public static bool PrintDocument(IPrintDialog printDialog, PrintProcessorCollection pp)
        {
            var pageSize = new Size(printDialog.PrintableAreaWidth, printDialog.PrintableAreaHeight);

            var fixedDocument = CreateDocument(pageSize, pp);

            printDialog.PrintDocument(fixedDocument.DocumentPaginator, pp.FileName);

            return(true);
        }
        /// <summary>
        ///     Prints the document to the given <see cref="PrintServer" /> and the given <see cref="PrintQueue.Name" />
        /// </summary>
        /// <param name="printQueueName"> The name of the print queue. </param>
        /// <param name="printServer"> The print server to host the print queue. </param>
        /// ///
        /// <returns> True if succeeds, false otherwise, or if the use cancels the print process. </returns>
        public bool PrintDocument(string printQueueName, PrintServer printServer)
        {
            if (Count == 0)
            {
                return(false);
            }

            var          p  = this.First();
            IPrintDialog pd = p.PrintDialog;

            pd.PrintQueue = new PrintQueue(printServer, printQueueName);

            return(PrintProcessor.PrintDocument(pd, this));
        }
        /// <summary>
        ///     Prints the document.
        /// </summary>
        /// <returns> True if succeeds, false otherwise, or if the use cancels the print process. </returns>
        public bool PrintDocument()
        {
            if (Count == 0)
            {
                return(false);
            }

            var          p  = this.First();
            IPrintDialog pd = p.PrintDialog;

            if (pd.ShowDialog().Equals(false))
            {
                return(false);
            }

            return(PrintProcessor.PrintDocument(pd, this));
        }
Ejemplo n.º 5
0
 public static void PrintDialog(FlowDocument doc)
 {
     IPrintDialog.PreviewDocument(doc, "Odot", true, Application.Current.MainWindow);
 }
Ejemplo n.º 6
0
 protected PrintProcessor()
 {
     _printDialog    = new PrintDialogWrapper();
     PageOrientation = PageOrientation.Portrait;
 }
Ejemplo n.º 7
0
 protected virtual bool PrintDocument(IPrintDialog printDialog)
 {
     return(PrintDocument(printDialog, new PrintProcessorCollection(this)));
 }