Example #1
0
        /**
         * Set the font and the size for the subsequent text writing.
         *
         * @param bf the font
         * @param size the font size in points
         */

        public override void setFontAndSize(BaseFont bf, float size)
        {
            state.size        = size;
            state.fontDetails = writer.addSimple(bf);
            PdfName name = state.fontDetails.FontName;

            content.Append(name.toPdf(null)).Append(' ').Append(size).Append(" Tf").Append_i(separator);
            fontDictionary.put(name, state.fontDetails.IndirectReference);
        }
Example #2
0
        public override void setPatternStroke(PdfPatternPainter p, Color color, float tint)
        {
            checkWriter();
            if (!p.isStencil())
            {
                throw new RuntimeException("An uncolored pattern was expected.");
            }
            PdfName name = writer.addSimplePattern(p);

            patternDictionary.put(name, p.IndirectReference);
            ColorDetails csDetail = writer.addSimplePatternColorspace(color);

            colorDictionary.put(csDetail.ColorName, csDetail.IndirectReference);
            content.Append(csDetail.ColorName.toPdf(null)).Append(" CS").Append_i(separator);
            outputColorNumbers(color, tint);
            content.Append(' ').Append(name.toPdf(null)).Append(" SCN").Append_i(separator);
        }