I have a windows form which prints to a label printer. I need to be able to set the label size in the software I'm writing and overwrite the defaults of the printer.
eg, if the label was 3" x 5" I may want to force the size of 2" x 2".
My code so far (BUT I DON'T HAVE TO USE THIS. I'm happy to approach this and re-start as it is a vital part of my software).
# PrintDocument pd = new PrintDocument();
# PaperSize ps = new PaperSize("Custom", 100, 100);
# pd.PrintPage += new PrintPageEventHandler(printInfo);
# pd.PrinterSettings.PrinterName = selectedPrinter;
# pd.PrinterSettings.DefaultPageSettings.PaperSize = ps;
# //pd.PrinterSettings.DefaultPageSettings.PaperSize.Height = 100;
# // pd.PrinterSettings.DefaultPageSettings.PaperSize.Width = 100;
# lb.Text = pd.PrinterSettings.DefaultPageSettings.PaperSize.ToString();
This doesn't work. It prints to the default label size.
View Complete Post