Example #1
0
        /// <summary>
        /// Draw a simple outer border. Ignore any inner parts.
        /// </summary>
        private void RenderBorder(Demon.Report.Types.Rectangle rect, Border style, Page page)
        {
            if (style == null)
            {
                return;
            }

            BorderPart parts = style.Parts;

            Demon.PDF.Color color = Convert.Color(style.Color);

            if ((parts & BorderPart.Left) != 0)
            {
                List <Position> path = new List <Position>();
                path.Add(new Position(rect.Left, rect.Top));
                path.Add(new Position(rect.Left, rect.Bottom));
                page.AddPath(path, style.Thickness, color, null);
            }
            if ((parts & BorderPart.Bottom) != 0)
            {
                List <Position> path = new List <Position>();
                path.Add(new Position(rect.Left, rect.Bottom));
                path.Add(new Position(rect.Right, rect.Bottom));
                page.AddPath(path, style.Thickness, color, null);
            }
            if ((parts & BorderPart.Right) != 0)
            {
                List <Position> path = new List <Position>();
                path.Add(new Position(rect.Right, rect.Top));
                path.Add(new Position(rect.Right, rect.Bottom));
                page.AddPath(path, style.Thickness, color, null);
            }
            if ((parts & BorderPart.Top) != 0)
            {
                List <Position> path = new List <Position>();
                path.Add(new Position(rect.Left, rect.Top));
                path.Add(new Position(rect.Right, rect.Top));
                page.AddPath(path, style.Thickness, color, null);
            }
        }
Example #2
0
 public static Demon.PDF.Rectangle Rectangle(Demon.Report.Types.Rectangle rect)
 {
     return(new Demon.PDF.Rectangle(rect.Left, rect.Bottom, rect.Right, rect.Top));
 }