public PdfPrintDocument(PdfDocument document, PdfPrintMode printMode) { if (document == null) throw new ArgumentNullException("document"); _document = document; _printMode = printMode; }
public PdfPrintDocument(PdfDocument document, PdfPrintMode printMode) { if (document == null) { throw new ArgumentNullException("document"); } _document = document; _printMode = printMode; }
public bool PrintDocument() { bool Printed = false; if (DocFile != string.Empty) { PdfPrintMode DefaultPrintMode = PdfPrintMode.CutMargin; using (var form = new PrintDialog()) { using (var document = pdfViewer.Document.CreatePrintDocument(DefaultPrintMode)) { form.AllowSomePages = true; form.Document = document; form.UseEXDialog = true; form.Document.PrinterSettings.FromPage = 1; form.Document.PrinterSettings.ToPage = pdfViewer.Document.PageCount; if (form.ShowDialog(FindForm()) == DialogResult.OK) { try { if (form.Document.PrinterSettings.FromPage <= pdfViewer.Document.PageCount) { form.Document.Print(); Printed = true; } } catch { // Ignore exceptions; the printer dialog should take care of this. } } } } } return(Printed); }
/// <summary> /// Creates a <see cref="PrintDocument"/> for the PDF document. /// </summary> /// <param name="printMode">Specifies the mode for printing. The default /// value for this parameter is CutMargin.</param> /// <returns></returns> public PrintDocument CreatePrintDocument(PdfPrintMode printMode) { return(new PdfPrintDocument(this, printMode)); }
/// <summary> /// Creates a new instance of the PdfPrintSettings class. /// </summary> /// <param name="mode">The mode used to print margins.</param> /// <param name="multiplePages">Configuration for printing multiple PDF /// pages on a single page.</param> public PdfPrintSettings(PdfPrintMode mode, PdfPrintMultiplePages multiplePages) { Mode = mode; MultiplePages = multiplePages; }
/// <summary> /// Creates a <see cref="PrintDocument"/> for the PDF document. /// </summary> /// <param name="printMode">Specifies the mode for printing. The default /// value for this parameter is CutMargin.</param> /// <returns></returns> public PrintDocument CreatePrintDocument(PdfPrintMode printMode) { return(CreatePrintDocument(new PdfPrintSettings(printMode))); }
/// <summary> /// Creates a new instance of the PdfPrintSettings class. /// </summary> /// <param name="mode">The mode used to print margins.</param> /// <param name="scaleFactor">The scale factor.</param> /// <param name="multiplePages">Configuration for printing multiple PDF /// pages on a single page.</param> public PdfPrintSettings(PdfPrintMode mode, double scaleFactor, PdfPrintMultiplePages multiplePages) : this(mode, scaleFactor) { MultiplePages = multiplePages; }
/// <summary> /// Creates a new instance of the PdfPrintSettings class. /// </summary> /// <param name="mode">The mode used to print margins.</param> /// <param name="multiplePages">Configuration for printing multiple PDF /// pages on a single page.</param> public PdfPrintSettings(PdfPrintMode mode, PdfPrintMultiplePages multiplePages) : this(mode, 1.0, multiplePages) { }
/// <summary> /// Creates a new instance of the PdfPrintSettings class. /// </summary> /// <param name="mode">The mode used to print margins.</param> /// <param name="scaleFactor">The scale factor.</param> public PdfPrintSettings(PdfPrintMode mode, double scaleFactor) { Mode = mode; ScaleFactor = scaleFactor; }
/// <summary> /// Creates a new instance of the PdfPrintSettings class. /// </summary> /// <param name="mode">The mode used to print margins.</param> public PdfPrintSettings(PdfPrintMode mode) : this(mode, 1.0) { }
public PrintDocument CreatePrintDocument(PdfPrintMode printMode) { return(_document.CreatePrintDocument(printMode)); }
/// <summary> /// Creates a <see cref="PrintDocument"/> for the PDF document. /// </summary> /// <param name="printMode">Specifies the mode for printing. The default /// value for this parameter is CutMargin.</param> /// <returns></returns> public PrintDocument CreatePrintDocument(PdfPrintMode printMode) { return new PdfPrintDocument(this, printMode); }
/// <summary>Change the printmode for the rendering on an gdi+ device context.</summary> /// <param name="mode">Print mode.</param> public static void SetPrintMode(PdfPrintMode mode) { lock (FPDF_LibraryLock) FPDF_SetPrintMode((int)mode); } // proc SetPrintMode
public PrintDocument CreatePrintDocument(PdfPrintMode printMode) { throw new NotImplementedException(); }
/// <summary> /// Creates a new instance of the PdfPrintSettings class. /// </summary> /// <param name="mode">The mode used to print margins.</param> /// <param name="multiplePages">Configuration for printing multiple PDF /// pages on a single page.</param> public PdfPrintSettings(PdfPrintMode mode, PdfPrintMultiplePages multiplePages, bool autoOrientation = true) { Mode = mode; MultiplePages = multiplePages; AutoOrientation = autoOrientation; }