using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Printing;
namespace PrintForms
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
// Output something in the print
SolidBrush myBrush =
new SolidBrush
(Color.
Blue);
e.Graphics.DrawString("Page size:\n" + e.PageSettings.PaperSize.ToString(), Font , myBrush, e.MarginBounds.Left, e.MarginBounds.Top);
myBrush.Dispose();
}
private void button1_Click(object sender, EventArgs e)
{
pd.PrinterSettings.PrinterName = "7-PDF Printer";
pd.DefaultPageSettings.Landscape = true;
pd.
DefaultPageSettings.
PaperSize =
new PaperSize
("My Paper",
500,
700);
pd.Print();
}
}
}