//instantiate print dd = new PrintDocument(); PaperSize ps = new PaperSize("Size", 300, 400); this is the size of paper thati want printed out. i mean once the print job completes at a height of 400, the paper should be cut by the printer var src = dd.PrinterSettings.PaperSources; dd.DefaultPageSettings.PaperSize = ps; ps.PaperName = "Roll Paper"; dd.OriginAtMargins = false; dd.PrinterSettings.DefaultPageSettings.Margins.Bottom = 0;//i thought this will do the job but unfortunately not dd.PrinterSettings.DefaultPageSettings.PaperSize = ps; dd.PrintPage += (sed, args) => dd_PrintPage(image, args); dd.Print();
void dd_PrintPage(object sed, PrintPageEventArgs e) { var img = sed as System.Drawing.Image; e.Graphics.DrawImage(img, new PointF(0, 0),); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)