Define Print Settings : Print « GUI Windows Form « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » GUI Windows Form » PrintScreenshots 
Define Print Settings
Define Print Settings

/*
GDI+ Programming in C# and VB .NET
by Nick Symmonds

Publisher: Apress
ISBN: 159059035X
*/

using System;
using System.Drawing.Printing;

namespace DefPrintSettings_c
{
    public class DefPrintSettings
    {
        [STAThread]
        static void Main(string[] args)
        {
      PrintDocument pd = new PrintDocument();
      PageSettings pg = pd.DefaultPageSettings;
      PrinterSettings ps = pg.PrinterSettings;

      Console.WriteLine("Printer Settings");
      Console.WriteLine("PrinterName = " + pd.PrinterSettings.PrinterName);
      Console.WriteLine("Is default Printer = " +
                         ps.IsDefaultPrinter.ToString());
      Console.WriteLine("Is plotter = " + ps.IsPlotter.ToString());
      Console.WriteLine("Is printer valid = " + ps.IsValid.ToString());
      Console.WriteLine("Can Duplex = " + ps.IsValid.ToString());
      Console.WriteLine("Num copies = " + ps.Copies.ToString());
      Console.WriteLine("Max Copies = " + ps.MaximumCopies.ToString());
      Console.WriteLine("Max Page = " + ps.MaximumPage.ToString());
      Console.WriteLine("Min Page = " + ps.MinimumPage.ToString());
      Console.WriteLine("Supports Color = " + ps.SupportsColor.ToString());
      foreach (PaperSize p in ps.PaperSizes)
        Console.WriteLine("Supports Paper Size: " + p.PaperName);
      foreach (PaperSource p in ps.PaperSources)
        Console.WriteLine("Supports Paper Source: " + p.SourceName);

      Console.WriteLine("\nPage Settings");
      Console.WriteLine("Is Color = " + pg.Color.ToString());
      Console.WriteLine("Top Bound = " + pg.Bounds.Top.ToString());
      Console.WriteLine("Bottom Bound = " + pg.Bounds.Bottom.ToString());
      Console.WriteLine("Left Bound = " + pg.Bounds.Left.ToString());
      Console.WriteLine("Right Bound = " + pg.Bounds.Right.ToString());
      Console.WriteLine("Top Margin = " + pg.Margins.Top.ToString());
      Console.WriteLine("Bottom Margin = " + pg.Margins.Bottom.ToString());
      Console.WriteLine("Left Margin = " + pg.Margins.Left.ToString());
      Console.WriteLine("Right Margin = " + pg.Margins.Right.ToString());
      Console.WriteLine("Landscape = " + pg.Landscape.ToString());
      Console.WriteLine("PaperSize = " + pg.PaperSize.PaperName);
      Console.WriteLine("PaperSource = " + pg.PaperSource.SourceName);
      Console.WriteLine("PrinterResolution = " 
                        pg.PrinterResolution.Kind.ToString());
      Console.WriteLine("PrinterResolution X = " 
                        pg.PrinterResolution.X.ToString());
      Console.WriteLine("PrinterResolution Y = " 
                        pg.PrinterResolution.Y.ToString());

      Console.ReadLine();

    }
    }
}


           
       
Related examples in the same category
1.Control PrintControl Print
2.Simple Report PrinterSimple Report Printer
3.Begin Print
4.Print Dialogs
5.Print EventsPrint Events
6.UI PrintUI Print
7.Basic Printing
8.Grid PrintingGrid Printing
9.Printer Caps 1
10.Printer Caps 2Printer Caps 2
11.Printer Caps 3Printer Caps 3
12.Printer Caps 4Printer Caps 4
13.Printer Caps 5Printer Caps 5
14.Printer Caps 6Printer Caps 6
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.