private System.Drawing.Printing.PrintDocument pd;
private void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs ev)
{
int[] i;
Rectangle rect = new Rectangle(0, 0, 1000, 500);
int cnt = fpSpread1.GetOwnerPrintPageCount(ev.Graphics, rect, 0);
fpSpread1.OwnerPrintDraw(ev.Graphics, rect, 0, 1);
i = fpSpread1.GetOwnerPrintRowPageBreaks(ev.Graphics, rect, 0, true);
foreach (object o in i)
{
listBox1.Items.Add(o);
}
}
private void Form1_Load(object sender, System.EventArgs e)
{
pd = new System.Drawing.Printing.PrintDocument();
pd.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.pd_PrintPage);
}
private void button1_Click(object sender, System.EventArgs e)
{
pd.Print();
}