public static XpsRenderer CreateInstance (PagesCollection pages) { if (pages == null) { throw new ArgumentNullException("pages"); } XpsRenderer instance = new XpsRenderer(pages); return instance; }
/// <summary> /// PrintDocument_PrintPage: Controls page printing of the report based on the number of pages selected per sheet. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PrintDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { if (_currentPageIndex < _pageCount) { RectangleF bounds = e.PageBounds; bounds.Width = e.Graphics.VisibleClipBounds.Width; bounds.Height = e.Graphics.VisibleClipBounds.Height; if (_currentPageIndex == 0) { _pagesAcross = _numberOfPagesPerPrinterPage / 2; _pagesDown = _numberOfPagesPerPrinterPage / _pagesAcross; _pageScaledSize.Width = (bounds.Width - (SpaceBetweenPages * (_pagesAcross - 1))) / _pagesAcross; _pageScaledSize.Height = (bounds.Height - (SpaceBetweenPages * (_pagesDown - 1))) / _pagesDown; _scaleFactor = _pageScaledSize.Width / _maxPageSize.Width; if (_scaleFactor > _pageScaledSize.Height / _maxPageSize.Height) { _scaleFactor = _pageScaledSize.Height / _maxPageSize.Height; } } RectangleF printRectangle = bounds; printRectangle.Width = _pageScaledSize.Width; printRectangle.Height = _pageScaledSize.Height; RectangleF pageRectangleInches = RectangleF.Empty; RectangleF pageRectangle = RectangleF.Empty; int column = 0; int startIndex = _currentPageIndex; PagesCollection pages = arViewer.Document.Pages; for (; _currentPageIndex < _pageCount && (startIndex == _currentPageIndex || _currentPageIndex % _numberOfPagesPerPrinterPage != 0); this._currentPageIndex++) { Page page = pages[_currentPageIndex]; pageRectangleInches.X = printRectangle.X / 100; pageRectangleInches.Y = printRectangle.Y / 100; pageRectangleInches.Width = page.Width * _scaleFactor; pageRectangleInches.Height = page.Height * _scaleFactor; pageRectangle = printRectangle; pageRectangle.Width = page.Width * 100 * _scaleFactor; pageRectangle.Height = page.Height * 100 * _scaleFactor; e.Graphics.DrawRectangle(Pens.Black, Rectangle.Round(pageRectangle)); page.Draw(e.Graphics, pageRectangleInches, _scaleFactor, _scaleFactor, true); column++; if (column >= _pagesAcross) { column = 0; printRectangle.X = bounds.X; printRectangle.Y += printRectangle.Height + SpaceBetweenPages; } else { printRectangle.X += printRectangle.Width + SpaceBetweenPages; } } } _currentNumberOfPagesPrinted++; e.HasMorePages = _currentNumberOfPagesPrinted < _numberOfPagesToPrint; if (!e.HasMorePages) { _currentPageIndex = 0; } }
private PrintRenderer(PagesCollection pages):base(pages) { doc = new PrintDocument(); // doc.QueryPageSettings += new QueryPageSettingsEventHandler(OnQueryPage); doc.BeginPrint += new PrintEventHandler(OnBeginPrint); doc.EndPrint += new PrintEventHandler(OnEndPrint); doc.PrintPage += new PrintPageEventHandler(OnPrintPage); }
private PrintRenderer(PagesCollection pages) : base(pages) { doc = new PrintDocument(); // doc.QueryPageSettings += new QueryPageSettingsEventHandler(OnQueryPage); doc.BeginPrint += new PrintEventHandler(OnBeginPrint); doc.EndPrint += new PrintEventHandler(OnEndPrint); doc.PrintPage += new PrintPageEventHandler(OnPrintPage); }
public Application(ICapabilities capabilities, string baseUrl, string hubUrl) { Pages = new PagesCollection(capabilities, baseUrl, hubUrl); // 2 - привязываем действие к отсылке //Auth = new AuthorizationModul(Pages); Sous = new SourceTopathlete(Pages); }
private void AddPageToCollection() //default page { PageViewModel pvm = new PageViewModel(); PagesCollection.Add(new PageView { DataContext = pvm }); }
private PrintRenderer(PagesCollection pages):base(pages) { this.PrintDocument = new PrintDocument(); this.PrintDocument.PrinterSettings = new PrinterSettings(); this.PrintDocument.BeginPrint += new PrintEventHandler(OnBeginPrint); this.PrintDocument.EndPrint += new PrintEventHandler(OnEndPrint); this.PrintDocument.PrintPage += new PrintPageEventHandler(OnPrintPage); }
private PrintRenderer(PagesCollection pages) : base(pages) { this.PrintDocument = new PrintDocument(); this.PrintDocument.PrinterSettings = new PrinterSettings(); this.PrintDocument.BeginPrint += new PrintEventHandler(OnBeginPrint); this.PrintDocument.EndPrint += new PrintEventHandler(OnEndPrint); this.PrintDocument.PrintPage += new PrintPageEventHandler(OnPrintPage); }
public PreviewViewModel(ReportSettings reportSettings, PagesCollection pages) { this.Pages = pages; FixedDocumentRenderer renderer = FixedDocumentRenderer.CreateInstance(reportSettings,Pages); renderer.Start(); renderer.RenderOutput(); renderer.End(); this.Document = renderer.Document; }
public static PrintRenderer CreateInstance(PagesCollection pages, PrinterSettings printerSettings) { if (pages == null) { throw new ArgumentNullException("pages"); } PrintRenderer instance = new PrintRenderer(pages); instance.PrinterSettings = printerSettings; return instance; }
private void AddPageToCollection(ScorePartwiseMusicXML sp) //default page { id = sp.ID; int index = pageCollection.Count; PageViewModel pvm = new PageViewModel(sp, index); PagesCollection.Add(new PageView { DataContext = pvm }); }
public PreviewViewModel(ReportSettings reportSettings, PagesCollection pages) { this.Pages = pages; FixedDocumentRenderer renderer = FixedDocumentRenderer.CreateInstance(reportSettings, Pages); renderer.Start(); renderer.RenderOutput(); renderer.End(); this.Document = renderer.Document; }
/// <summary> /// Send's output to the StandartPrinter /// </summary> /// <param name="pages"></param> /// <returns>PrintRenderer</returns> public static PrintRenderer CreateInstance(PagesCollection pages) { if (pages == null) { throw new ArgumentNullException("pages"); } PrintRenderer instance = new PrintRenderer(pages); return(instance); }
public void AddScorePage(ScoreLayout.AbstractScorePage scorePage) { IsBlank = false; id = scorePage.Id; var number = PagesCollection.Count + 1; var pvm = new PageViewModel(scorePage) { PageNumber = number + "", PageNumberAlignment = number % 2 == 0 ? TextAlignment.Right : TextAlignment.Left }; PagesCollection.Add(new PageView { DataContext = pvm }); }
/// <summary> /// For internal use only /// </summary> /// <param name="reportSettings"></param> /// <param name="pages"></param> /// <param name="fileName"></param> /// <param name="showOutput"></param> /// <returns></returns> public static PdfRenderer CreateInstance (ReportSettings reportSettings,PagesCollection pages,string fileName,bool showOutput) { if ((pages == null) ||(pages.Count == 0)) { throw new ArgumentNullException("pages"); } if (String.IsNullOrEmpty(fileName)) { throw new ArgumentNullException("fileName"); } PdfRenderer instance = new PdfRenderer(pages); instance.fileName = fileName; instance.reportSettings = reportSettings; instance.showOutput = showOutput; return instance; }
/// <summary> /// For internal use only /// </summary> /// <param name="reportSettings"></param> /// <param name="pages"></param> /// <param name="fileName"></param> /// <param name="showOutput"></param> /// <returns></returns> public static PdfRenderer CreateInstance(ReportSettings reportSettings, PagesCollection pages, string fileName, bool showOutput) { if ((pages == null) || (pages.Count == 0)) { throw new ArgumentNullException("pages"); } if (String.IsNullOrEmpty(fileName)) { throw new ArgumentNullException("fileName"); } PdfRenderer instance = new PdfRenderer(pages); instance.fileName = fileName; instance.reportSettings = reportSettings; instance.showOutput = showOutput; return(instance); }
public PageManagerTabs() { internalImages = HeaparResource.LoadBitmapStrip(Type.GetType("heaparessential.Controls.PageManager"), "heaparessential.Resources.ImagesTabControl.bmp", new Size(imageButtonWidth, imageButtonHeight), new Point(0, 0)); InitializeComponent(); InitControlPanel(); pagesCollection = new PagesCollection(); pagesCollection.Cleared += new EventHandler(OnTabCollectionCleared); pagesCollection.Inserted += new CollectionChange(OnTabCollectionInserted); pagesCollection.Removed += new CollectionChange(OnTabCollectionRemoved); this.SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true); }
/// <summary> /// PrintMultiplePagesPerSheetForm_Load: Run the sample report and load it into the viewer control (first 20 pages - report normally runs to 100 pages). /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PrintMultiplePagesPerSheetForm_Load(object sender, EventArgs e) { //Define and run the Invoice report var rpt = new SectionReport(); rpt.LoadLayout(XmlReader.Create(Properties.Resources.Invoice)); ((Data.OleDBDataSource)rpt.DataSource).ConnectionString = Properties.Resources.ConnectionString; rpt.Run(false); //Remove all but the first 20 pages from the generated report. while (rpt.Document.Pages.Count > 20) { rpt.Document.Pages.RemoveAt(rpt.Document.Pages.Count - 1); } arViewer.Document = rpt.Document; apiViewer.Document = rpt.Document; // Find the maximum page size. PagesCollection pages = arViewer.Document.Pages; Page page; _pageCount = pages.Count; for (int pageIndex = 0; pageIndex < _pageCount; pageIndex++) { page = pages[pageIndex]; if (_maxPageSize.Width < page.Size.Width) { _maxPageSize.Width = page.Size.Width; } if (_maxPageSize.Height < page.Size.Height) { _maxPageSize.Height = page.Size.Height; } } // Convert to document units. _maxPageSize.Width *= 100; _maxPageSize.Height *= 100; cmbPageCount.SelectedIndex = cmbPageCountAPI.SelectedIndex = 0; }
public void TestMethod1() { //arrange string expected = "перехожу на с 1 на 3"; //act PagesCollection col = new PagesCollection(); col.AddPage("Первая страница"); col.AddPage("Вторая страница"); col.AddPage("Третья страница"); col.Connect(0, 2, "перехожу на с 1 на 3"); col.Connect(0, 1, "перехожу на с 1 на 2"); string[] choices = col[0]; string actual = choices[0]; //actual Assert.AreEqual(expected, actual); }
private void SetupViewer(ReportModel reportModel) { this.pages = new PagesCollection(); this.reportSettings = reportModel.ReportSettings; this.AdjustDrawArea(); }
public WPFReportPreview(ReportDesignerLoader loader, IViewContent content) : base(content) { this.designerLoader = loader; base.TabPageText = "Wpf View"; Pages = new PagesCollection(); }
public BaseExportRenderer(PagesCollection pages) { this.pages = pages; }
private HtmlRenderer(PagesCollection pages) : base(pages) { }
private FixedDocumentRenderer(ReportSettings reportSettings, PagesCollection pages) : base(pages) { this.pages = pages; this.reportSettings = reportSettings; this.docCreator = new FixedDocumentCreator(); }
public VacancyService() { UpdateSettings(string.Empty); _rootLoader = new RootLoader(); _pages = new PagesCollection <Root>(_rootLoader, _settings); }
public BaseTopathlete(PagesCollection pages) { this.pages = pages; }
public WPFReportPreview(ReportDesignerLoader loader,IViewContent content):base(content) { this.designerLoader = loader; base.TabPageText = "Wpf View"; Pages = new PagesCollection(); }
private HtmlRenderer(PagesCollection pages):base(pages) { }
public static FixedDocumentRenderer CreateInstance (ReportSettings reportSettings,PagesCollection pages) { var instance = new FixedDocumentRenderer(reportSettings,pages); return instance; }
private void SetupViewer (ReportModel reportModel) { this.pages = new PagesCollection(); this.reportSettings = reportModel.ReportSettings; this.AdjustDrawArea(); }
public ExportRunner() { Pages = new PagesCollection(); }
//немного магии public SourceTopathlete(PagesCollection pages) : base(pages) { }
public static FixedDocumentRenderer CreateInstance(ReportSettings reportSettings, PagesCollection pages) { var instance = new FixedDocumentRenderer(reportSettings, pages); return(instance); }
private PdfRenderer(PagesCollection pages) : base(pages) { }
private FixedDocumentRenderer(ReportSettings reportSettings,PagesCollection pages):base(pages) { this.pages = pages; this.reportSettings = reportSettings; this.docCreator = new FixedDocumentCreator(); }
private XpsRenderer(PagesCollection pages):base(pages) { }