コード例 #1
0
        // constructors

        /**
         * Constructs a <CODE>PdfBorderDictionary</CODE>.
         */

        public PdfBorderDictionary(float borderWidth, int borderStyle, PdfDashPattern dashes)
        {
            Put(PdfName.W, new PdfNumber(borderWidth));
            switch (borderStyle)
            {
            case STYLE_SOLID:
                Put(PdfName.S, PdfName.S);
                break;

            case STYLE_DASHED:
                if (dashes != null)
                {
                    Put(PdfName.D, dashes);
                }
                Put(PdfName.S, PdfName.D);
                break;

            case STYLE_BEVELED:
                Put(PdfName.S, PdfName.B);
                break;

            case STYLE_INSET:
                Put(PdfName.S, PdfName.I);
                break;

            case STYLE_UNDERLINE:
                Put(PdfName.S, PdfName.U);
                break;

            default:
                throw new ArgumentException("Invalid border style.");
            }
        }
コード例 #2
0
        /**
         * Constructs a new <CODE>PdfBorderArray</CODE>.
         */

        public PdfBorderArray(float hRadius, float vRadius, float width, PdfDashPattern dash) : base(new PdfNumber(hRadius))
        {
            Add(new PdfNumber(vRadius));
            Add(new PdfNumber(width));
            if (dash != null)
            {
                Add(dash);
            }
        }