private void BeginPageLayout(object sender, BeginPageLayoutEventArgs e)
        {
            int           index  = e.Page.Section.Pages.IndexOf(e.Page);
            float         offset = 50;
            PdfSolidBrush brush  = new PdfSolidBrush(Color.LightBlue);

            if (index % 2 == 0)
            {
                RectangleF bounds = e.Bounds;
                e.Page.Graphics.DrawEllipse(brush, bounds.Width / 2 - offset, bounds.Height / 2 - offset, 2 * offset, 2 * offset);
            }
            else
            {
                RectangleF bounds = e.Bounds;
                e.Page.Graphics.DrawRectangle(brush, bounds.Width / 2 - offset, bounds.Height / 2 - offset, 2 * offset, 2 * offset);
            }
        }
예제 #2
0
        private void BeginPageLayout2(object sender, BeginPageLayoutEventArgs e)
        {
            RectangleF bounds = e.Bounds;

            // First column.
            if (!m_paginateStart)
            {
                bounds.X = bounds.Width + 20f;
                bounds.Y = 10f;
            }
            else
            {
                // Second column.
                bounds.X        = 0f;
                m_paginateStart = false;
            }

            e.Bounds       = bounds;
            m_columnBounds = bounds;
        }
예제 #3
0
        /// <summary>
        /// Draw graphic elements in the page.
        /// </summary>
        private void BeginPageLayout(object sender, BeginPageLayoutEventArgs e)
        {
            int   index  = e.Page.Section.Pages.IndexOf(e.Page);
            float offset = 50;

            PdfSolidBrush brush = new PdfSolidBrush(new PdfColor(System.Drawing.Color.FromArgb(255, 173, 216, 230)));

            // Ellipse for odd numbered pages.
            if (index % 2 == 0)
            {
                RectangleF bounds = e.Bounds;
                e.Page.Graphics.DrawEllipse(brush, bounds.Width / 2 - offset, bounds.Height / 2 - offset, 2 * offset, 2 * offset);
            }
            // Rectangle for even numbered pages.
            else
            {
                RectangleF bounds = e.Bounds;
                e.Page.Graphics.DrawRectangle(brush, bounds.Width / 2 - offset, bounds.Height / 2 - offset, 2 * offset, 2 * offset);
            }
        }