通常web技术无法设置本地计算机的默认打印机,包括用代码设置纸张大小,如果业务系统中真遇到这种需求,只能通过其它辅助手段(比如ActiveX)实现.下面这段代码,出自网上被广泛使用的"泥人张打印API"(抱歉未找到原始出处),已经用C#封装了很多关于底层打印的API方法 using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; usin
其他条码知识 请访问:http://www.ybtiaoma.com ,本文仅供参考,请勿转载,谢谢 using System; using System.Drawing; using System.Drawing.Printing; using System.Runtime.InteropServices; using System.Windows.Forms; /*2014-3-1 * 测试打印机 新北洋BTP-2100E Plus 西铁城CLP-S631 * 测试结果:页面大小,上间距,左
using System.Drawing.Printing.PrintDocument using System.Drawing.Printing.PrinterSettings.PaperSizeCollection using System.Drawing.Printing.PaperSize using System.Drawing.Printing.PageSettings /////////需要以上引用 PrintDocument pd = new PrintDocument(); P
Imports System.Drawing.PrintingImports System.Runtime.InteropServices Public Class Page <Runtime.InteropServices.DllImport("winspool.Drv", EntryPoint:="OpenPrinterW", _ SetLastError:=True, CharSet:=CharSet.Unicode, _ Ex
BOOL CPrintView::GetPageSize(CSize &nRetVal) // CPrintView 是自己创建的类 { PRINTDLG FAR * pPrintDlg = new PRINTDLG; BOOL bRet = FALSE; // Get the current printer's settings. if(AfxGetApp()->GetPrinterDeviceDefa
这段时间学习spread控件,用到打印设置上边,其他的设置都还好说,但是打印纸张的大小,纸张类型等把我折腾的够呛,找了半天才找到,记录下来备查. 1.打印纸张类型: System.Drawing.Printing.PaperSize pkSize; System.Drawing.Printing.PrintDocument printDoc = new System.Drawing.Printing.PrintDocument(); for (int i = 0; i < printDoc.Pr