internal static cPrinter getcPrint( PrintDialog printDialog, string deviceName, string driverName, string port, int orientation, int paperSize, int width, int height) { cPrinter o = new cPrinter(printDialog); o.setDeviceName(deviceName); o.setDriverName(driverName); o.setPort(port); cReportPaperInfo paperInfo = o.getPaperInfo(); paperInfo.setOrientation(orientation); paperInfo.setPaperSize((csReportPaperType)paperSize); if (width == 0 || height == 0) { getSizeFromPaperSize((csReportPaperType)paperSize, orientation, out width, out height); } paperInfo.setWidth(width); paperInfo.setHeight(height); return(o); }
public bool showDialog(int pages) { csReportPaperType paperSize = 0; int orientation = 0; int fromPage = 0; int toPage = 0; int paperBin = 0; paperSize = m_paperInfo.getPaperSize(); orientation = m_paperInfo.getOrientation(); fromPage = 1; toPage = pages; if (cPrintAPI.showPrintDialog( m_printDialog, ref m_deviceName, ref m_driverName, ref m_port, ref paperSize, ref orientation, ref fromPage, ref toPage, ref m_copies, ref paperBin)) { m_paperInfo.setPaperSize(paperSize); m_paperInfo.setOrientation(orientation); m_paperInfo.setPagesToPrint(fromPage.ToString() + "-" + toPage.ToString()); m_paperInfo.setPaperBin(paperBin); return(true); } else { return(false); } }