Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfTemplate


   public void createITextObject(FacesContext context)
   {
      UIDocument doc = (UIDocument) findITextParent(getParent(), UIDocument.class);
      if (doc != null)
      {
         PdfTemplate tp = doc.createPdfTemplate(getWidth(), getHeight());
         Graphics2D g2 = tp.createGraphics(getWidth(), getHeight());

         render(g2);
         g2.dispose();

         try
View Full Code Here


            UIDocument doc = (UIDocument) findITextParent(getParent(),
                    UIDocument.class);
            if (doc != null) {
                PdfWriter writer = (PdfWriter) doc.getWriter();
                PdfContentByte cb = writer.getDirectContent();
                PdfTemplate tp = cb.createTemplate(getWidth(), getHeight());

                UIFont font = (UIFont) findITextParent(this, UIFont.class);

                DefaultFontMapper fontMapper;
                if (font == null) {
                    fontMapper = new DefaultFontMapper();
                } else {
                    fontMapper = new AsianFontMapper(font.getName(), font.getEncoding());
                }

                Graphics2D g2 = tp.createGraphics(getWidth(), getHeight(), fontMapper);
                chart.draw(g2, new Rectangle2D.Double(0, 0, getWidth(), getHeight()));
                g2.dispose();

                image = new ImgTemplate(tp);
            } else {
View Full Code Here

         UIDocument doc = (UIDocument) findITextParent(getParent(), UIDocument.class);
         if (doc != null)
         {
            PdfWriter writer = (PdfWriter) doc.getWriter();
            PdfContentByte cb = writer.getDirectContent();
            PdfTemplate tp = cb.createTemplate(getWidth(), getHeight());
            Graphics2D g2 = tp.createGraphics(getWidth(), getHeight(), new DefaultFontMapper());
            chart.draw(g2, new Rectangle2D.Double(0, 0, getWidth(), getHeight()));
            g2.dispose();

            image = new ImgTemplate(tp);
         }
View Full Code Here

            FontFactory.registerDirectories();

            // we create a template and a Graphics2D object that corresponds
            // with it
            PdfContentByte cb = writer.getDirectContent();
            PdfTemplate tp = cb.createTemplate(width, height);
            PdfGraphics2D graphic = (PdfGraphics2D) tp.createGraphics(width, height, mapper);

            // we set graphics options
            if (!mapContent.isTransparent()) {
                graphic.setColor(mapContent.getBgColor());
                graphic.fillRect(0, 0, width, height);
View Full Code Here

            FontFactory.registerDirectories();

            // we create a template and a Graphics2D object that corresponds
            // with it
            PdfContentByte cb = writer.getDirectContent();
            PdfTemplate tp = cb.createTemplate(width, height);
            PdfGraphics2D graphic = (PdfGraphics2D) tp.createGraphics(width, height, mapper);

            // we set graphics options
            if (!mapContext.isTransparent()) {
                graphic.setColor(mapContext.getBgColor());
                graphic.fillRect(0, 0, width, height);
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.PdfTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.