Exemplo n.º 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)
        {
            CheckWriter();
            state.size = size;
            if (bf.FontType == BaseFont.FONT_TYPE_DOCUMENT)
            {
                state.fontDetails = new FontDetails(null, ((DocumentFont)bf).IndirectReference, bf);
            }
            else
            {
                state.fontDetails = writer.AddSimple(bf);
            }
            PdfName psn = (PdfName)stdFieldFontNames[bf.PostscriptFontName];

            if (psn == null)
            {
                if (bf.Subset && bf.FontType == BaseFont.FONT_TYPE_TTUNI)
                {
                    psn = state.fontDetails.FontName;
                }
                else
                {
                    psn = new PdfName(bf.PostscriptFontName);
                    state.fontDetails.Subset = false;
                }
            }
            PageResources prs = PageResources;

            prs.AddFont(psn, state.fontDetails.IndirectReference);
            content.Append(psn.GetBytes()).Append(' ').Append(size).Append(" Tf").Append_i(separator);
        }
Exemplo n.º 2
0
        /**
         * Creates new PdfTemplate
         *
         * @param wr the <CODE>PdfWriter</CODE>
         */

        internal PdfTemplate(PdfWriter wr) : base(wr)
        {
            type          = TYPE_TEMPLATE;
            pageResources = new PageResources();
            pageResources.AddDefaultColor(wr.DefaultColorspace);
            thisReference = writer.PdfIndirectReference;
        }
Exemplo n.º 3
0
        /**
         * Adds a blank page.
         * @param	rect The page dimension
         * @param	rotation The rotation angle in degrees
         * @since	2.1.5
         */
        public void AddPage(Rectangle rect, int rotation)
        {
            PdfRectangle  mediabox  = new PdfRectangle(rect, rotation);
            PageResources resources = new PageResources();
            PdfPage       page      = new PdfPage(mediabox, new Hashtable(), resources.Resources, 0);

            page.Put(PdfName.TABS, Tabs);
            root.AddPage(page);
            ++currentPageNumber;
        }
Exemplo n.º 4
0
 internal Type3Glyph(PdfWriter writer, PageResources pageResources, float wx, float llx, float lly, float urx, float ury, bool colorized) : base(writer)
 {
     this.pageResources = pageResources;
     this.colorized     = colorized;
     if (colorized)
     {
         content.Append(wx).Append(" 0 d0\n");
     }
     else
     {
         content.Append(wx).Append(" 0 ").Append(llx).Append(' ').Append(lly).Append(' ').Append(urx).Append(' ').Append(ury).Append(" d1\n");
     }
 }
Exemplo n.º 5
0
 public PdfContentByte GetOverContent()
 {
     if (over == null)
     {
         if (pageResources == null)
         {
             pageResources = new PageResources();
             PdfDictionary resources = pageN.GetAsDict(PdfName.RESOURCES);
             pageResources.SetOriginalResources(resources, cstp.namePtr);
         }
         over = new PdfCopy.StampContent(cstp, pageResources);
     }
     return(over);
 }
Exemplo n.º 6
0
 /** Creates a new instance of StampContent */
 internal StampContent(PdfStamperImp stamper, PdfStamperImp.PageStamp ps) : base(stamper)
 {
     this.ps       = ps;
     pageResources = ps.pageResources;
 }
Exemplo n.º 7
0
 /** Creates a new instance of StampContent */
 internal StampContent(PdfWriter writer, PageResources pageResources) : base(writer)
 {
     this.pageResources = pageResources;
 }