Click here to Skip to main content
13,665,282 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am printing an image in WPF. The image prints well but the printer (a Thermal Printer) cuts the printed job after reaching an A4 length size thus leaving a whole lot of empty space below and wasting paper. I want the thermal printer to cut the print job after printing the image.

What I have tried:

//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);

void dd_PrintPage(object sed, PrintPageEventArgs e)
            var img = sed as System.Drawing.Image;
            e.Graphics.DrawImage(img, new PointF(0, 0),);
Posted 12-Oct-17 4:38am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180810.1 | Last Updated 12 Oct 2017
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100