当前位置: 首页>>代码示例>>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;未经允许,请勿转载。