示例#1
0
        private void btnAplicar_Click(object sender, EventArgs e)
        {
            if (cbHoja.ValueInt == 0)
            {
                System.Drawing.Printing.PaperSize paperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);
                documento1.DefaultPageSettings.PaperSize = paperSize;
            }
            else
            {
                System.Drawing.Printing.PaperSize paperSize = new System.Drawing.Printing.PaperSize("Ticket", (int)(this.txtWidth.ValueInt / 0.254), (int)(this.txtHeight.ValueInt / 0.254) * EntradaCantidad.ValueInt);

                documento1.DefaultPageSettings.PaperSize = paperSize;
            }
            VistaPrevia.Document = documento1;
            VistaPrevia.Refresh();
            UpdateData();
        }