Exemple #1
0
        public static void DrawCrossTopLeft(PdfSharp.Drawing.XGraphics gfx, double width, double height, PdfMargin margin, double halfPenWidth, PdfSharp.Drawing.XPen[] pens)
        {
            double x1 = 0;
            double y1 = margin.Top - halfPenWidth;
            double x2 = margin.Left;
            double y2 = margin.Top - halfPenWidth;

            gfx.DrawLine(pens[0], x1, y1, x2, y2); // Horizontal - Yellow

            x1 = margin.Left - halfPenWidth;
            y1 = 0;
            x2 = margin.Left - halfPenWidth;
            y2 = margin.Top;
            gfx.DrawLine(pens[1], x1, y1, x2, y2); // Vertical - Red
        }
Exemple #2
0
        public static void DrawCrossBottomRight(PdfSharp.Drawing.XGraphics gfx, double width, double height, PdfMargin margin, double halfPenWidth, PdfSharp.Drawing.XPen[] pens)
        {
            double x1 = width - margin.Right;
            double y1 = height - margin.Bottom + halfPenWidth;
            double x2 = width;
            double y2 = height - margin.Bottom + halfPenWidth;

            gfx.DrawLine(pens[0], x1, y1, x2, y2); // Horizontal - Yellow

            x1 = width - margin.Right + halfPenWidth;
            y1 = height - margin.Bottom;
            x2 = width - margin.Right + halfPenWidth;
            y2 = height;
            gfx.DrawLine(pens[1], x1, y1, x2, y2); // Vertical - red
        }
Exemple #3
0
        public static void DrawBorder(PdfSharp.Drawing.XGraphics gfx, double width, double height, PdfMargin margin)
        {
            PdfSharp.Drawing.XPen[] pens = new PdfSharp.Drawing.XPen[] { PdfSharp.Drawing.XPens.Black, PdfSharp.Drawing.XPens.Black, PdfSharp.Drawing.XPens.Black, PdfSharp.Drawing.XPens.Black };
            // pens = new PdfSharp.Drawing.XPen[] { PdfSharp.Drawing.XPens.Yellow, PdfSharp.Drawing.XPens.HotPink, PdfSharp.Drawing.XPens.Blue, PdfSharp.Drawing.XPens.Green };

            double halfPenWidth = pens[0].Width / 2.0;

            double x1 = 0;
            double y1 = margin.Top - halfPenWidth;
            double x2 = width;
            double y2 = margin.Top - halfPenWidth;

            gfx.DrawLine(pens[0], x1, y1, x2, y2); // Horizontal Top - Yellow

            // y1 = height-pageMargin;
            x1 = 0;
            y1 = height - margin.Bottom + halfPenWidth;
            x2 = width;                            // 1/4 + 1/8 ()*0.5= 3/16
            y2 = height - margin.Bottom + halfPenWidth;
            gfx.DrawLine(pens[1], x1, y1, x2, y2); // Horizontal Bottom  - Hotpink



            x1 = margin.Left - halfPenWidth;
            y1 = 0;
            x2 = margin.Left - halfPenWidth;
            y2 = height;
            gfx.DrawLine(pens[2], x1, y1, x2, y2); // Vertical Left - Blue


            x1 = width - margin.Right + halfPenWidth;
            y1 = 0;
            x2 = width - margin.Right + halfPenWidth;
            y2 = height;
            gfx.DrawLine(pens[3], x1, y1, x2, y2); // Vertical Right - Green
        }