using System.Drawing.Printing;
PrintDocument printDocument = new PrintDocument();
PaperSize customPaperSize = new PaperSize("Custom", Convert.ToInt32(width * 0.3937 * 100), Convert.ToInt32(height * 0.3937 * 100));
printDocument.DefaultPageSettings.PaperSize = customPaperSize;
// I'm not sure if you'll need this for a Sqaure Paper size? Try printing with and without this line.
printDocument.DefaultPageSettings.Landscape = true;
1条答案
按热度按时间q8l4jmvw1#
您还没有向我们展示所有的代码,这里有一个工作示例: