Ejemplo n.º 1
0
        /// <summary>
        /// Exports the empty page.
        /// </summary>
        /// <param name="state">The state.</param>
        /// <param name="doc">The document.</param>
        void ExportEmptyPage(ExporterState state, PdfDocument doc)
        {
            PdfPage page = doc.Pages.AddNewPage(this.context.GetDot((float)this.context.PageRects.PageRectangle.Width), this.context.GetDot((float)this.context.PageRects.PageRectangle.Height));

            state.CurrentPage = page;
            PdfContent content = page.AddNewContent();

            content.Filters.Enqueue(PdfFilter.FlateFilter);
            PdfGraphics pdfGraphics = content.Graphics;
            Graphics    g           = new Graphics(this.context, this, pdfGraphics);

            g.SaveState();
            g.Scale((double)this.context.GetForce(), (double)-this.context.GetForce());
            g.Translate(0.0, -this.context.PageRects.PageRectangle.Height);
            GcLabel label = new GcLabel((int)((this.context.PageRects.PageRectangle.Width / 2.0) - 220.0), (int)(this.context.PageRects.PageRectangle.Height / 3.0), 440, 100)
            {
                Text = "No Page can be print, please check the settings.",
                Font = new Font(this.context.DefaultFont.FontFamily.ToString(), 20.0)
            };

            label.Alignment.VerticalAlignment   = TextVerticalAlignment.Center;
            label.Alignment.HorizontalAlignment = TextHorizontalAlignment.Center;
            label.Alignment.WordWrap            = true;
            label.Foreground = FillEffects.Red;
            label.Background = new SolidColorBrush(Colors.Red);
            GcPaintHelper.PaintLabel(label.GetBlock(this.context), g, state);
            g.RestoreState();
        }