Example #1
0
        public void                Print(PdfPoint upperLeftCorner, PdfContent content)
        {
            if (content is null)
            {
                throw new ArgumentNullException(nameof(content));
            }

            Format();

            {
                PrintBackground background = new PrintBackground();

                boxPrintBackground(upperLeftCorner, background);

                background.Print(content);
            }

            boxPrintForground(upperLeftCorner, content);
        }
        internal override void                boxPrintBackground(PdfPoint upperLeftCorner, PrintBackground background)
        {
            upperLeftCorner += new PdfPoint(Left, Top);

            if (_border != null)
            {
                PdfPoint point = upperLeftCorner;
                PdfSize  size  = new PdfSize(Width, Height);

                if (_margin != null)
                {
                    point.y     -= _margin.Top;
                    point.x     += _margin.Left;
                    size.width  -= _margin.Left + _margin.Right;
                    size.height += _margin.Top + _margin.Bottom;
                }

                _border.boxPrint(point, size, background);
            }

            for (int i = 0; i < _children.Count; ++i)
            {
                _children[i].boxPrintBackground(upperLeftCorner, background);
            }
        }
Example #3
0
        internal override void                boxPrintBackground(PdfPoint upperLeftCorner, PrintBackground background)
        {
            upperLeftCorner += new PdfPoint(Left, Top);

            for (int rowIndex = 0; rowIndex < _rows.Count; ++rowIndex)
            {
                TableRow Row = _rows[rowIndex];

                for (int ColIndex = 0; ColIndex < Row.Cells.Count;)
                {
                    Row.Cells[ColIndex].boxPrintBackground(upperLeftCorner, background);
                    ColIndex += Row.Cells[ColIndex].ColSpan;
                }
            }
        }
        internal void                boxPrint(PdfPoint upperLeftCorner, PdfSize size, PrintBackground background)
        {
            if (_top != null)
            {
                background.DrawLineHorizontal(_top, upperLeftCorner + new PdfSize(0, -_top.LineWidth.pnts / 2), size.width);
            }

            if (_left != null)
            {
                background.DrawLineVertical(_left, upperLeftCorner + new PdfSize(_left.LineWidth.pnts / 2, 0), size.height);
            }

            if (_right != null)
            {
                background.DrawLineVertical(_right, upperLeftCorner + new PdfSize(size.width.pnts - _right.LineWidth.pnts / 2, 0), size.height);
            }

            if (_bottom != null)
            {
                background.DrawLineHorizontal(_bottom, upperLeftCorner + new PdfSize(0, size.height.pnts + _bottom.LineWidth.pnts / 2), size.width);
            }
        }
Example #5
0
 internal virtual void                boxPrintBackground(PdfPoint upperLeftCorner, PrintBackground background)
 {
 }