當前位置: 首頁>>代碼示例>>C#>>正文


C# Printing.PaperSize類代碼示例

本文整理匯總了C#中System.Drawing.Printing.PaperSize的典型用法代碼示例。如果您正苦於以下問題:C# PaperSize類的具體用法?C# PaperSize怎麽用?C# PaperSize使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PaperSize類屬於System.Drawing.Printing命名空間,在下文中一共展示了PaperSize類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: print

        public void print()
        {
            PrintDialog pd = new PrintDialog();
            pdoc = new PrintDocument();
            PrinterSettings ps = new PrinterSettings();
            Font font = new Font("Courier New", 15);

            PaperSize psize = new PaperSize("Custom", 300, 100);
            ps.DefaultPageSettings.PaperSize = psize;

            pd.Document = pdoc;
            pd.Document.DefaultPageSettings.PaperSize = psize;

            pdoc.DefaultPageSettings.PaperSize = psize;

            pdoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage);

            DialogResult result = pd.ShowDialog();
            if (result == DialogResult.OK)
            {
                PrintPreviewDialog pp = new PrintPreviewDialog();
                pp.Document = pdoc;

                result = pp.ShowDialog();
                if (result == DialogResult.OK)
                {
                    pdoc.Print();
                }
            }
        }
開發者ID:hydrohead,項目名稱:MWSZonBarcode,代碼行數:30,代碼來源:Printing.cs

示例2: UCCustomerManager

        public UCCustomerManager()
        {
            InitializeComponent();

            UIAssistants.SetButtonStyle4QueryAndClear(btn_query, btn_clear, true);  //設置查詢按鈕和清除按鈕樣式
            DataGridViewEx.SetDataGridViewStyle(dgv_table, create_time);   //設置數據表格樣式,並將最後一列填充其餘空白
            Load += (sender, args) => UIAssistants.SetDataGridViewCheckColumn(dgv_table, colCheck);

            Init(); //初始化方法

            SetContentMenuScrip(dgv_table);

            #region 預覽、打印設置
            string printObject = "tb_customer";
            string printTitle = "客戶檔案";
            List<string> listNotPrint = new List<string>();
            listNotPrint.Add(cust_id.Name);
            //listNotPrint.Add(v_brand.Name);
            PaperSize paperSize = new PaperSize();
            paperSize.Width = 297;
            paperSize.Height = 210;
            businessPrint = new BusinessPrint(dgv_table, printObject, printTitle, paperSize, listNotPrint);
            #endregion

        }
開發者ID:caocf,項目名稱:workspace-kepler,代碼行數:25,代碼來源:UCCustomerManager.cs

示例3: UCAccountVerificationManage

 BusinessPrint businessPrint;//業務打印功能
 #endregion
 public UCAccountVerificationManage()
 {
     InitializeComponent();
     this.AddEvent += new ClickHandler(UCAccountVerificationManage_AddEvent);
     this.EditEvent += new ClickHandler(UCAccountVerificationManage_EditEvent);
     this.CopyEvent += new ClickHandler(UCAccountVerificationManage_CopyEvent);
     this.ViewEvent += new ClickHandler(UCAccountVerificationManage_ViewEvent);
     this.DeleteEvent += new ClickHandler(UCAccountVerificationManage_DeleteEvent);
     this.VerifyEvent += new ClickHandler(UCAccountVerificationManage_VerifyEvent);
     this.SubmitEvent += new ClickHandler(UCAccountVerificationManage_SubmitEvent);
     this.PrintEvent += new ClickHandler(UCAccountVerificationManage_PrintEvent);
     this.ExportEvent += new ClickHandler(UCAccountVerificationManage_ExportEvent);
     dgvVerification.ReadOnly = false;
     dgvVerification.HeadCheckChanged += new DataGridViewEx.DelegateOnClick(dgvVerification_HeadCheckChanged);
     foreach (DataGridViewColumn dgvc in dgvVerification.Columns)
     {
         if (dgvc.Name == colChk.Name)
         {
             continue;
         }
         dgvc.ReadOnly = true;
     }
     List<string> listNotPrint = new List<string>();
     listNotPrint.Add(colOrgId.Name);
     listNotPrint.Add(colHandle.Name);
     PaperSize paperSize = new PaperSize();
     paperSize.Width = 297;
     paperSize.Height = 210;
     businessPrint = new BusinessPrint(dgvVerification, "tb_account_verification", "往來核銷", paperSize, listNotPrint);
 }
開發者ID:caocf,項目名稱:workspace-kepler,代碼行數:32,代碼來源:UCAccountVerificationManage.cs

示例4: UCDispatchManager

        BusinessPrint businessPrint;//業務打印功能
        #endregion

        #region 初始化窗體
        public UCDispatchManager()
        {
            InitializeComponent();
            CommonCtrl.BindComboBoxByDictionarr(cobPayType, "sys_repair_pay_methods", true);//綁定維修付費方式  
            BindOrderStatus();
            SetTopbuttonShow();
            UIAssistants.SetButtonStyle4QueryAndClear(btnQuery, btnClear);  //設置查詢按鈕和清除按鈕樣式
            base.ViewEvent += new ClickHandler(UCDispatchManager_ViewEvent);
            base.Delete += new ClickHandler(UCDispatchManager_Delete);
            base.QCEvent += new ClickHandler(UCDispatchManager_QCEvent);
            base.BalanceEvent += new ClickHandler(UCDispatchManager_BalanceEvent);
            base.PrintEvent += new ClickHandler(UCDispatchManager_PrintEvent);
            base.SetEvent += new ClickHandler(UCDispatchManager_SetEvent);
            SetQuick();
            #region 預覽、打印設置
            string printObject = "tb_maintain_info_dd";
            string printTitle = "維修調度單";
            List<string> listNotPrint = new List<string>();
            listNotPrint.Add(maintain_id.Name);
            //listNotPrint.Add(v_brand.Name);
            PaperSize paperSize = new PaperSize();
            paperSize.Width = 297;
            paperSize.Height = 210;
            businessPrint = new BusinessPrint(dgvRData, printObject, printTitle, paperSize, listNotPrint);
            #endregion
        }
開發者ID:caocf,項目名稱:workspace-kepler,代碼行數:30,代碼來源:UCDispatchManager.cs

示例5: GetPrinters_Click

        private void GetPrinters_Click(object sender, EventArgs e)
        {
            //PrintDocument pd = new PrintDocument();
            //pd.DefaultPageSettings.Bounds = new
            //pd.Print();

            PrintPreviewDialog ppd = new PrintPreviewDialog();
            PrintDocument pd = new PrintDocument();
            //設置邊距
            Margins margin = new Margins(200, 20, 20, 0);
            pd.DefaultPageSettings.Margins = margin;
            //紙張設置默認
            PaperSize pageSize = new PaperSize("First custom size", getYc(58), 100);
            pd.DefaultPageSettings.PaperSize = pageSize;
            //打印事件設置
            pd.PrintPage += pd_PrintPage;
            ppd.Document = pd;
            ppd.ShowDialog();
            //try
            //{
            //    pd.Print();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "打印出錯", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    pd.PrintController.OnEndPrint(pd, new PrintEventArgs());
            //}
        }
開發者ID:ysjr-2002,項目名稱:DeviceTest,代碼行數:28,代碼來源:FrmDefaultPrint.cs

示例6: btnPrint_Click

        private void btnPrint_Click(object sender, EventArgs e)
        {
            PrintDialog pd = new PrintDialog();
            pdoc = new PrintDocument();
            PrinterSettings ps = new PrinterSettings();
            Font font = new Font("Courier New", 15);

            PaperSize psize = new PaperSize("Custom", 100, 200);

            pd.Document = pdoc;
            pd.Document.DefaultPageSettings.PaperSize = psize;
            pdoc.DefaultPageSettings.PaperSize.Height = 720;

            pdoc.DefaultPageSettings.PaperSize.Width = 620;

            pdoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage);

            DialogResult result = pd.ShowDialog();
            if (result == DialogResult.OK)
            {
                PrintPreviewDialog pp = new PrintPreviewDialog();
                pp.Document = pdoc;
                result = pp.ShowDialog();
                if (result == DialogResult.OK)
                {
                    pdoc.Print();
                }
            }
        }
開發者ID:thanhhnk,項目名稱:ProP_LoopIT,代碼行數:29,代碼來源:FoodShop.cs

示例7: loadReport

        public void loadReport()
        {
            /*
            // file ini disimpan di bin/debug
            m_cryRpt.Load(Application.StartupPath + @".\REPORT\RESI.rpt");
            // cara pemanggilan menggunakan data table yang sudah di proses dan di masukan ke object dt
            m_cryRpt.Database.Tables[0].SetDataSource((DataTable)my_dt);
            // data yang di panggil di ke data source otomatis tergambar ke dataset yang di buat dan berextensi xsd
            crystalReportViewerRESI.ReportSource = m_cryRpt;
            crystalReportViewerRESI.Refresh();
             */
            reportViewerCETAKRESI.LocalReport.DataSources.Clear();
            reportViewerCETAKRESI.LocalReport.ReportEmbeddedResource = "LOGISTICMANAGAMENTSYSTEM.REPORTS.EXPRESS.cetakRESI.rdlc";
            Microsoft.Reporting.WinForms.ReportDataSource dataset = new Microsoft.Reporting.WinForms.ReportDataSource("dsRESI_V_TRANSAKSIEXPRESS", my_dt); // set the datasource
            reportViewerCETAKRESI.LocalReport.DataSources.Add(dataset);
            dataset.Value = my_dt;
            System.Drawing.Printing.PageSettings pg = new PageSettings();
            // Set margins
            // Set paper size
            pg.Margins.Top = 100;
            pg.Margins.Bottom = 100;
            pg.Margins.Left = 100;
            pg.Margins.Right = 100;
            pg.Landscape = false;
            System.Drawing.Printing.PaperSize size = new PaperSize();
            size.RawKind = (int)PaperKind.A4;
            pg.PaperSize = size;

               // reportViewerCETAKRESI.SetPageSettings(pg); ??
            reportViewerCETAKRESI.LocalReport.Refresh();
            reportViewerCETAKRESI.RefreshReport(); // refresh report
        }
開發者ID:rhizalpatrax64bit,項目名稱:logistic-management-system,代碼行數:32,代碼來源:FormRESIEXPRESS.cs

示例8: UCFMaterialReturnManager

        BusinessPrint businessPrint;//業務打印功能
        #endregion

        #region 初始化窗體
        public UCFMaterialReturnManager()
        {
            InitializeComponent(); 
            BindOrderStatus();
           // BindWarehouseWay();
            base.ViewEvent += new ClickHandler(UCFMaterialReturnManager_ViewEvent);
            base.DeleteEvent += new ClickHandler(UCFMaterialReturnManager_DeleteEvent);
            base.EditEvent += new ClickHandler(UCFMaterialReturnManager_EditEvent);
            base.VerifyEvent += new ClickHandler(UCFMaterialReturnManager_VerifyEvent);
            base.SubmitEvent += new ClickHandler(UCFMaterialReturnManager_SubmitEvent);
            base.ImportEvent += new ClickHandler(UCFMaterialReturnManager_ImportEvent);
            base.PrintEvent += new ClickHandler(UCFMaterialReturnManager_PrintEvent);
            base.ExportEvent += new ClickHandler(UCFMaterialReturnManager_ExportEvent);
            UIAssistants.SetButtonStyle4QueryAndClear(btnQuery, btnClear);  //設置查詢按鈕和清除按鈕樣式
            base.SetEvent += new ClickHandler(UCFMaterialReturnManager_SetEvent);
            SetQuick();
            base.SetContentMenuScrip(dgvRData);
            #region 預覽、打印設置
            string printObject = "tb_maintain_refund_material";
            string printTitle = "領料退貨單";
            List<string> listNotPrint = new List<string>();
            listNotPrint.Add(refund_id.Name);
            //listNotPrint.Add(v_brand.Name);
            PaperSize paperSize = new PaperSize();
            paperSize.Width = 297;
            paperSize.Height = 210;
            businessPrint = new BusinessPrint(dgvRData, printObject, printTitle, paperSize, listNotPrint);
            #endregion
        }
開發者ID:caocf,項目名稱:workspace-kepler,代碼行數:33,代碼來源:UCFMaterialReturnManager.cs

示例9: UCFeedbackManager

        public UCFeedbackManager()
        {
            InitializeComponent();

            UIAssistants.SetButtonStyle4QueryAndClear(btnQuery, btnClear, true);  //設置查詢按鈕和清除按鈕樣式
            DataGridViewEx.SetDataGridViewStyle(dgvQData, drtxt_status);   //設置數據表格樣式,並將最後一列填充其餘空白

            Init();

            Load += (sender, args) => UIAssistants.SetDataGridViewCheckColumn(dgvQData, drchk_check);

            SetContentMenuScrip(dgvQData);

            #region 預覽、打印設置
            string printObject = "tb_CustomerSer_Feedback";
            string printTitle = "信息反饋";
            List<string> listNotPrint = new List<string>();
            listNotPrint.Add(drtxt_Feedback_id.Name);
            //listNotPrint.Add(v_brand.Name);
            PaperSize paperSize = new PaperSize();
            paperSize.Width = 297;
            paperSize.Height = 210;
            businessPrint = new BusinessPrint(dgvQData, printObject, printTitle, paperSize, listNotPrint);
            #endregion
        }
開發者ID:caocf,項目名稱:workspace-kepler,代碼行數:25,代碼來源:UCFeedbackManager.cs

示例10: Payments_Full_Report_Load

        private void Payments_Full_Report_Load(object sender, EventArgs e)
        {
            ReportDataSource ds = new ReportDataSource();
            ds.Name = "DataSet1";
            ds.Value = GeneratePaymentData();

            this.reportViewer1.ProcessingMode = ProcessingMode.Local;
            this.reportViewer1.LocalReport.ReportPath = @"Report5.rdlc";
            this.reportViewer1.LocalReport.DataSources.Add(ds);

            System.Drawing.Printing.PageSettings pg = new System.Drawing.Printing.PageSettings();
            pg.Margins.Top = 0;
            pg.Landscape = true;
            pg.Margins.Bottom = 0;
            pg.Margins.Left = 50;
            pg.Margins.Right = 0;

            System.Drawing.Printing.PaperSize size = new PaperSize();
            size.RawKind = (int)PaperKind.A4;
            pg.PaperSize = size;
            pg.Landscape = true;

            this.reportViewer1.SetPageSettings(pg);
            this.reportViewer1.RefreshReport();
        }
開發者ID:CRISTELSoftware,項目名稱:CRISTEL-DHANULA,代碼行數:25,代碼來源:Payments_Full_Report.cs

示例11: UCSalePlanManager

        BusinessPrint businessPrint;//業務打印功能
        #region 初始化窗體
        public UCSalePlanManager()
        {
            InitializeComponent();

            base.AddEvent += new ClickHandler(UCSalePlanManager_AddEvent);
            base.CopyEvent += new ClickHandler(UCSalePlanManager_CopyEvent);
            base.EditEvent += new ClickHandler(UCSalePlanManager_EditEvent);
            base.DeleteEvent += new ClickHandler(UCSalePlanManager_DeleteEvent);
            base.VerifyEvent += new ClickHandler(UCSalePlanManager_VerifyEvent);
            base.SubmitEvent += new ClickHandler(UCSalePlanManager_SubmitEvent);
            base.ExportEvent += new ClickHandler(UCSalePlanManager_ExportEvent);
            base.ViewEvent += new ClickHandler(UCSalePlanManager_ViewEvent);
            base.PrintEvent += new ClickHandler(UCSalePlanManager_PrintEvent);
            base.SetEvent += new ClickHandler(UCSalePlanManager_SetEvent);
            #region 預覽、打印設置
            string printObject = "tb_parts_sale_plan";
            string printTitle = "銷售計劃單";
            List<string> listNotPrint = new List<string>();
            listNotPrint.Add(sale_plan_id.Name);
            PaperSize paperSize = new PaperSize();
            paperSize.Width = 297;
            paperSize.Height = 210;
            businessPrint = new BusinessPrint(gvSalePlanList, printObject, printTitle, paperSize, listNotPrint);
            #endregion
        }
開發者ID:caocf,項目名稱:workspace-kepler,代碼行數:27,代碼來源:UCSalePlanManager.cs

示例12: ReserveOrder

        BusinessPrint businessPrint;//業務打印功能
        #endregion

        #region 初始化
        public ReserveOrder()
        {
            InitializeComponent();
            CommonCtrl.BindComboBoxByDictionarr(cobPayType, "sys_repair_pay_methods", true);//綁定維修付費方式
            this.BindOrderStatus();          
            UIAssistants.SetButtonStyle4QueryAndClear(btnQuery, btnClear);  //設置查詢按鈕和清除按鈕樣式
            base.AddEvent += new ClickHandler(ReserveOrder_AddEvent);
            base.CopyEvent += new ClickHandler(ReserveOrder_CopyEvent);
            base.EditEvent += new ClickHandler(ReserveOrder_EditEvent);
            base.DeleteEvent += new ClickHandler(ReserveOrder_DeleteEvent);
            base.ViewEvent += new ClickHandler(ReserveOrder_ViewEvent);
            base.SubmitEvent += new ClickHandler(ReserveOrder_SubmitEvent);
            base.VerifyEvent += new ClickHandler(ReserveOrder_VerifyEvent);
            base.PrintEvent += new ClickHandler(ReserveOrder_PrintEvent);
            base.SetEvent += new ClickHandler(ReserveOrder_SetEvent);
            SetQuick();
            base.SetContentMenuScrip(dgvRData);
            #region 預覽、打印設置
            string printObject = "tb_maintain_reservation";
            string printTitle = "預約單";
            List<string> listNotPrint = new List<string>();
            listNotPrint.Add(reserv_id.Name);
            //listNotPrint.Add(v_brand.Name);
            PaperSize paperSize = new PaperSize();
            paperSize.Width = 297;
            paperSize.Height = 210;
            businessPrint = new BusinessPrint(dgvRData , printObject, printTitle, paperSize, listNotPrint);
            #endregion
        }
開發者ID:caocf,項目名稱:workspace-kepler,代碼行數:33,代碼來源:ReserveOrder.cs

示例13: UCPurchaseBillManang

        BusinessPrint businessPrint;//業務打印功能
        #region 窗體初始化
        /// <summary> 窗體初始化
        /// </summary>
        public UCPurchaseBillManang()
        {
            InitializeComponent();
            dateTimeStart.Value = DateTime.Now.AddDays(-DateTime.Now.Day + 1);
            dateTimeEnd.Value = DateTime.Now;

            base.AddEvent += new ClickHandler(UCPurchaseBillManang_AddEvent);
            base.EditEvent += new ClickHandler(UCPurchaseBillManang_EditEvent);
            base.CopyEvent += new ClickHandler(UCPurchaseBillManang_CopyEvent);
            base.DeleteEvent += new ClickHandler(UCPurchaseBillManang_DeleteEvent);
            base.VerifyEvent += new ClickHandler(UCPurchaseBillManang_VerifyEvent);
            base.SubmitEvent += new ClickHandler(UCPurchaseBillManang_SubmitEvent);
            base.ExportEvent += new ClickHandler(UCPurchaseBillManang_ExportEvent);
            base.ViewEvent += new ClickHandler(UCPurchaseBillManang_ViewEvent);
            base.PrintEvent += new ClickHandler(UCPurchaseBillManang_PrintEvent);
            base.SetEvent += new ClickHandler(UCPurchaseBillManang_SetEvent);
            #region 預覽、打印設置
            string printObject = "tb_parts_purchase_billing";
            string printTitle = "采購開單";
            List<string> listNotPrint = new List<string>();
            listNotPrint.Add(purchase_billing_id.Name);
            PaperSize paperSize = new PaperSize();
            paperSize.Width = 297;
            paperSize.Height = 210;
            businessPrint = new BusinessPrint(gvPurchaseOrderList, printObject, printTitle, paperSize, listNotPrint);
            #endregion
        }
開發者ID:caocf,項目名稱:workspace-kepler,代碼行數:31,代碼來源:UCPurchaseBillManang.cs

示例14: LocalReportPrinter

 public LocalReportPrinter(string reportFullPath, PaperSize paperSize = null)
 {
     _reportFullPath = Application.StartupPath + @"\" + reportFullPath;
     _report = new LocalReport { ReportPath = _reportFullPath };
     _paperSize = paperSize ?? _report.GetDefaultPageSettings().PaperSize;
     _streams = new List<Stream>();
 }
開發者ID:gofixiao,項目名稱:Macsauto-Backup,代碼行數:7,代碼來源:LocalReportPrinter.cs

示例15: Execute

        public override void Execute()
        {
            printDocument = new PrintDocument();

              printDocument.OriginAtMargins = true;
              printDocument.BeginPrint += new PrintEventHandler(printDocument_BeginPrint);
              printDocument.PrintPage += new PrintPageEventHandler(printDocument_PrintPage);

              Dictionary<String, Object> paperSettings = Printing.getPaperSettings(grtArguments);
              printDocument.DefaultPageSettings.Landscape = (string)paperSettings["orientation"] == "landscape";

              // Sizes must be given in inch * 100 (sigh).
              int paperWidth = (int)Math.Round((double)paperSettings["width"] / 0.254);
              int paperHeight = (int)Math.Round((double)paperSettings["height"] / 0.254);
              PaperSize paperSize = new PaperSize("Doesn't matter", paperWidth, paperHeight);
              printDocument.DefaultPageSettings.PaperSize = paperSize;

              if ((bool)paperSettings["marginsSet"])
            printDocument.DefaultPageSettings.Margins =
              new Margins((int)paperSettings["marginLeft"], (int)paperSettings["marginRight"],
            (int)paperSettings["marginTop"], (int)paperSettings["marginBottom"]);

              printDialog = new System.Windows.Forms.PrintDialog();
              printDialog.Document = printDocument;
              printDialog.AllowPrintToFile = true;

              pageNumber = 0;
              pageCount = -1;

              if (printDialog.ShowDialog() == DialogResult.OK)
              {
            printDocument.Print();
              }
        }
開發者ID:abibell,項目名稱:mysql-workbench,代碼行數:34,代碼來源:PrintDialog.cs


注:本文中的System.Drawing.Printing.PaperSize類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。