• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Printing.PageSettings类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Drawing.Printing.PageSettings的典型用法代码示例。如果您正苦于以下问题:C# PageSettings类的具体用法?C# PageSettings怎么用?C# PageSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PageSettings类属于System.Drawing.Printing命名空间,在下文中一共展示了PageSettings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CloneTest

		public void CloneTest ()
		{
			// Check for installed printers, because we need
			// to have at least one to test
			if (PrinterSettings.InstalledPrinters.Count == 0)
				Assert.Ignore ("No printers found.");

			PageSettings ps = new PageSettings ();
			ps.Color = false;
			ps.Landscape = true;
			ps.Margins = new Margins (120, 130, 140, 150);
			ps.PaperSize = new PaperSize ("My Custom Size", 222, 333);
			PageSettings clone = (PageSettings) ps.Clone ();

			Assert.AreEqual (ps.Color, clone.Color, "#1");
			Assert.AreEqual (ps.Landscape, clone.Landscape, "#2");
			Assert.AreEqual (ps.Margins, clone.Margins, "#3");
			Assert.AreSame (ps.PrinterSettings, clone.PrinterSettings, "#4");

			// PaperSize
			Assert.AreEqual (ps.PaperSize.PaperName, clone.PaperSize.PaperName, "#5");
			Assert.AreEqual (ps.PaperSize.Width, clone.PaperSize.Width, "#6");
			Assert.AreEqual (ps.PaperSize.Height, clone.PaperSize.Height, "#7");
			Assert.AreEqual (ps.PaperSize.Kind, clone.PaperSize.Kind, "#8");

			// PrinterResolution
			Assert.AreEqual (ps.PrinterResolution.X, clone.PrinterResolution.X, "#9");
			Assert.AreEqual (ps.PrinterResolution.Y, clone.PrinterResolution.Y, "#10");
			Assert.AreEqual (ps.PrinterResolution.Kind, clone.PrinterResolution.Kind, "#11");

			// PaperSource
			Assert.AreEqual (ps.PaperSource.Kind, clone.PaperSource.Kind, "#12");
			Assert.AreEqual (ps.PaperSource.SourceName, clone.PaperSource.SourceName, "#13");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:34,代码来源:PageSettingsTest.cs


示例2: ItopVectorControl

 public ItopVectorControl()
 {
     //int num1;
     this.components = null;
     this.pageSetting=new PageSettings();
     this.svgDocument = new SvgDocument();
     this.mainIcon = null;
     this.roots = new Hashtable(0x10);
     this.unnamed = string.Empty;
     this.InitializeComponent();
     this.mainIcon = this.GetIconFromResource(base.GetType(), "ItopVector.ItopVectorControl.Resource.main.ico");
     this.CreateMenu();
     this.drawArea1.OperationChanged += new EventHandler(this.ChangeOperation);
     this.drawArea1.ScaleChanged += new EventHandler(this.ChangeScale);
     this.drawArea1.OnTrackPopup += new TrackPopupEventHandler(this.TrackPopup);
     this.drawArea1.OnTipEvent += new OnTipEventHandler(this.ToolTip);
     this.drawArea1.PostBrushEvent += new PostBrushEventHandler(this.PostBrush);
     this.drawArea1.LeftClick +=new SvgElementEventHandler(drawArea1_LeftClick);
     this.drawArea1.DoubleLeftClick+=new SvgElementEventHandler(drawArea1_DoubleLeftClick);
     this.drawArea1.RightClick+=new SvgElementEventHandler(drawArea1_RightClick);
     this.drawArea1.MoveOver+=new SvgElementEventHandler(drawArea1_MoveOver);
     this.drawArea1.MoveIn+=new SvgElementEventHandler(drawArea1_MoveIn);
     this.drawArea1.MoveOut+=new SvgElementEventHandler(drawArea1_MoveOut);
     this.drawArea1.DragAndDrop+=new DragEventHandler(drawArea1_DragDrop);
     this.drawArea1.PaintMap+=new PaintMapEventHandler(drawArea1_PaintMap);
     this.drawArea1.AfterPaintPage+=new PaintMapEventHandler(drawArea1_AfterPaintPage);
     this.Disposed+=new EventHandler(DocumentControl_Disposed);
     this.UpdateProperty();
     this.unnamed = ItopVector.Resource.LayoutManager.GetLabelForName("unnamedelement").Trim();
     this.drawArea1.OnMouseUp += new MouseEventHandler(drawArea1_OnMouseUp);
 }
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:31,代码来源:TLVectorControl.cs


示例3: PrintPageEventArgs

		public PrintPageEventArgs(Graphics graphics, Rectangle marginBounds,
			Rectangle pageBounds, PageSettings pageSettings) {
			this.graphics = graphics;
			this.marginBounds = marginBounds;
			this.pageBounds = pageBounds;
			this.pageSettings = pageSettings;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:PrintPageEventArgs.cs


示例4: StartPrint

        //Stream streamToPrint, string streamType
        //2�����Print��ӡ����
        public void StartPrint()
        {
            //����ֵ��PageSettings A4\A5
            PageSettings ps = new PageSettings();
            //��ʾ���ô�ӡҳ�Ի���
            PageSetupDialog Psdl = new PageSetupDialog();
            //��ӡ������ã�ע�⣬�÷��������printpage�������档
            PrintDialog pt = new PrintDialog();
            pt.AllowCurrentPage = true;
            pt.AllowSomePages = true;
            pt.AllowPrintToFile = true;
            //       StreamToPrint = streamToPrint;//��ӡ���ֽ���
            //       StreamType = streamType; //��ӡ������
            //       printDocument1.DocumentName = Filename; //��ӡ���ļ���
            Psdl.Document = printDocument1;
            //       PrintPreview.Document = printDocument1;
            pt.Document = printDocument1;
            Psdl.PageSettings = printDocument1.DefaultPageSettings;
            try
            {
                //ҳ�����öԻ���
                if (Psdl.ShowDialog() == DialogResult.OK)
                {
                    ps = Psdl.PageSettings;
                    printDocument1.DefaultPageSettings = Psdl.PageSettings;
                }
                //ѡ���ӡ���Ի���
                if (pt.ShowDialog() == DialogResult.OK)
                {
                    printDocument1.PrinterSettings.Copies = pt.PrinterSettings.Copies;
                    //printDocument1.Print();
                    if (!checkBoxAll.Checked)
                    {
                        printDocument1.Print();
                    }
                    else
                    {
                        for (int i = 0; i < dataGridView1.RowCount; i++)
                        {
                            ShowTag(i);
                            printDocument1.Print();
                        }
                    }

                }
                ////��ӡԤ���Ի���
                //if (PrintPreview.ShowDialog() == DialogResult.OK)
                //{
                //    //���ô�ӡ
                //    printDocument1.Print();
                //}

                //PrintDocument�����Print()������PrintController����ִ��PrintPage�¼���
            }
            catch (InvalidPrinterException ex)
            {
                MessageBox.Show(ex.Message, "Simple Editor", MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw;
            }
        }
开发者ID:chutinhha,项目名称:asset-management-system,代码行数:62,代码来源:PrintDlg.cs


示例5: 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


示例6: GdiPrinterPrintAction

        private bool GdiPrinterPrintAction(int pageIndex, Graphics graphics, Rectangle marginBounds, Rectangle pageBounds, PageSettings pageSettings, ref object state)
        {
            pageSettings.Landscape = false;

            Image renderedImage = state as Image;
            if (renderedImage == null)
            {
                // Store the whole rendered image and share it across multiple pages.
                Size renderBounds = new Size(pageBounds.Width, 0);

                string templateFile = GetTemplateFile();
                if (templateFile == null)
                {
                    return false;
                }

                renderedImage = TemplateRenderer.RenderOperation(GetSourceLocation(), _operation, templateFile, renderBounds);
                state = renderedImage;
            }

            // Calculate the source rectangle (the portion of the rendered image) depending on which page we are in.
            int pagesNeeded = (int)Math.Ceiling((double)renderedImage.Height / (double)pageBounds.Size.Height);
            Rectangle destRect = pageBounds;
            Rectangle srcRect = new Rectangle(0, pageBounds.Height * (pageIndex - 1), pageBounds.Width, pageBounds.Height);

            graphics.DrawImage(renderedImage, destRect, srcRect, GraphicsUnit.Pixel);

            return pageIndex < pagesNeeded;
        }
开发者ID:huoxudong125,项目名称:AlarmWorkflow,代码行数:29,代码来源:OperationPrinterJob.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: PrintForm

 public PrintForm(PageSettings e)
 {
     InitializeComponent();
     this.IsAccessible = false;
     InitPrintForm();
     _settings = e;
 }
开发者ID:JosonYang,项目名称:aojreporter,代码行数:7,代码来源:PrintForm.cs


示例9: PrintDocument

	// Constructor.
	public PrintDocument()
			{
				this.documentName = "document";
				this.originAtMargins = false;
				this.printController = null;
				this.printerSettings = new PrinterSettings();
				this.defaultPageSettings = new PageSettings(printerSettings);
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:9,代码来源:PrintDocument.cs


示例10: FromPrinter

		public static Graphics FromPrinter (PageSettings page)
		{
			if (page == null) {
				throw new ArgumentNullException("page");
			}
			Graphics test = page.PrinterSettings.CreateMeasurementGraphics();
			return test;
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:8,代码来源:CreateGraphicObject.cs


示例11: GetPrintableArea

 RectangleF GetPrintableArea(PageSettings pageSettings)
 {
     // Get the available page size on the page. Note the PrintableArea member of PageSettings does not automatically does the
     // landscape into account.
     RectangleF printableArea = pageSettings.PrintableArea;
     if (pageSettings.Landscape)
         printableArea = new RectangleF(printableArea.Top, printableArea.Left, printableArea.Height, printableArea.Width);  // reverse rectangle for landscape
     return printableArea;
 }
开发者ID:petergolde,项目名称:PurplePen,代码行数:9,代码来源:CoursePrinting.cs


示例12: PrintEngine

 public PrintEngine()
 {
     _pageSettings = new PageSettings();
     _pageSettings.Landscape = true;
     _pageSettings.Margins.Top = 50;
     _pageSettings.Margins.Bottom = 50;
     _pageSettings.Margins.Left = 50;
     _pageSettings.Margins.Right = 50;
     _printerSettings = new PrinterSettings();
 }
开发者ID:KindDragon,项目名称:ICSharpCode.TextEditor.V4,代码行数:10,代码来源:PrintEngine.cs


示例13: PageSetupButton_Click

        private void PageSetupButton_Click(object sender, EventArgs e)
        {
            PageSetupDialog pageSetupDialog = new PageSetupDialog();

            pageSetupDialog.PageSettings = m_DocumentPageSettings;

            if (pageSetupDialog.ShowDialog() == DialogResult.OK)
            {
                m_DocumentPageSettings = pageSetupDialog.PageSettings;
            }
        }
开发者ID:Digresiv,项目名称:garminworkouts,代码行数:11,代码来源:PrintOptionsDialog.cs


示例14: ReportPrintDocument

        private ReportPrintDocument(Microsoft.Reporting.WinForms.Report report)
        {
            // Set the page settings to the default defined in the report
            ReportPageSettings reportPageSettings = report.GetDefaultPageSettings();

            // The page settings object will use the default printer unless
            // PageSettings.PrinterSettings is changed.  This assumes there
            // is a default printer.
            m_pageSettings = new PageSettings();
            m_pageSettings.PaperSize = reportPageSettings.PaperSize;
            m_pageSettings.Margins = reportPageSettings.Margins;
        }
开发者ID:Leonoo,项目名称:CleanEstimate,代码行数:12,代码来源:ReportPrintDocument.cs


示例15: AutoPrintCls

        //public AutoPrintCls(ServerReport serverReport)
        //    : this((Report)serverReport)
        //{
        //    RenderAllServerReportPages(serverReport);
        //}
        //public AutoPrintCls(LocalReport localReport)
        //    : this((Report)localReport)
        //{
        //    RenderAllLocalReportPages(localReport);
        //}
        private AutoPrintCls(LocalReport report)
        {
            // Set the page settings to the default defined in the report
            ReportPageSettings reportPageSettings = report.GetDefaultPageSettings();

            // The page settings object will use the default printer unless
            // PageSettings.PrinterSettings is changed.  This assumes there
            // is a default printer.
            m_pageSettings = new PageSettings();
            m_pageSettings.PaperSize = reportPageSettings.PaperSize;
            m_pageSettings.Margins = reportPageSettings.Margins;
        }
开发者ID:ranyaof,项目名称:ongaz,代码行数:22,代码来源:AutoPrintBase.cs


示例16: ReportPrintDocument

        private ReportPrintDocument(Report report,bool isLanscape)
        {
            // Set the page settings to the default defined in the report
            ReportPageSettings reportPageSettings = report.GetDefaultPageSettings();

            // The page settings object will use the default printer unless
            // PageSettings.PrinterSettings is changed.  This assumes there
            // is a default printer.
            m_pageSettings = new PageSettings();
            m_pageSettings.PaperSize = reportPageSettings.PaperSize;
            m_pageSettings.Margins = reportPageSettings.Margins;
            m_pageSettings.Landscape = isLanscape;
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:13,代码来源:ReportPrintDocument.cs


示例17: PrintHelper

 public PrintHelper(ItopVectorControl tc, Itop.MapView.IMapViewObj map)
 {
     //int chose = Convert.ToInt32(ConfigurationSettings.AppSettings.Get("chose"));
     //if (chose == 1)
     //{ map = new Itop.MapView.MapViewObj(); }
     //else if (chose == 2)
     //{ map = new Itop.MapView.MapViewObj2(); }
     tlVectorControl1 = tc;
     mapview = map;
     pdoc = new PrintDocument();
     pdoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage);
     pageSetting = pdoc.PrinterSettings.DefaultPageSettings;
 }
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:13,代码来源:PrintHelper.cs


示例18: SeriesDataPrinter

 public SeriesDataPrinter(SeriesData data)
 {
     this.data = data;
     this.document = new PrintDocument();
     this.document.DocumentName = data.SeriesName + "document";
     this.printFont = new Font("Arial", 10);
     this.printSettings = new PrinterSettings();
     this.pageSettings = new PageSettings();
     this.document.PrinterSettings = this.printSettings;
     this.document.DefaultPageSettings = this.pageSettings;
     this.document.PrintPage += new PrintPageEventHandler(document_PrintPage);
     this.document.BeginPrint += new PrintEventHandler(document_BeginPrint);
 }
开发者ID:ammepuspita,项目名称:zaitun-time-series,代码行数:13,代码来源:SeriesDataPrinter.cs


示例19: TestForm

        public TestForm()
        {
            InitializeComponent();

            printDoc = new PrintDocument();
            pgSettings = new PageSettings();
            prtSetting = new PrinterSettings();

            neoTabWindow1.Renderer = AddInRendererManager.LoadRenderer("MarginBlueRendererVS2");
            
            neoTabPage1.Text = "수 입";
            neoTabPage1.BackColor = Color.White;
            neoTabPage1.Controls.Add(income);
        }
开发者ID:StigmaKim,项目名称:ChurchFinance,代码行数:14,代码来源:TestForm.cs


示例20: DocumentPaginatorWrapper

        /// <summary>
        /// Class constructor
        /// </summary>
        /// <param name="paginator"></param>
        /// <param name="pageSettings"></param>
        /// <param name="printTicket"></param>
        /// <param name="headerFooterfontFamily"></param>
        public DocumentPaginatorWrapper(DocumentPaginator paginator, PageSettings pageSettings, PrintTicket printTicket, FontFamily headerFooterfontFamily)
        {
            m_Margins = ConvertMarginsToPx(pageSettings.Margins);

              if (pageSettings.Landscape)
            m_PageSize = new Size((int)printTicket.PageMediaSize.Height, (int)printTicket.PageMediaSize.Width);
              else
            m_PageSize = new Size((int)printTicket.PageMediaSize.Width, (int)printTicket.PageMediaSize.Height);

              m_Paginator = paginator;
              m_Paginator.PageSize = new Size(m_PageSize.Width - m_Margins.Left - m_Margins.Right, m_PageSize.Height - m_Margins.Top - m_Margins.Bottom);

              m_Typeface = new Typeface(headerFooterfontFamily, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);
        }
开发者ID:joazlazer,项目名称:ModdingStudio,代码行数:21,代码来源:DocumentPaginatorWrapper.cs



注:本文中的System.Drawing.Printing.PageSettings类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Printing.PaperSize类代码示例发布时间:2022-05-26
下一篇:
C# Printing.Margins类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap