Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfTemplate.createGraphics()


            throw new IOException("java.awt.Image fetch aborted or errored");
        }
        int w = pg.getWidth();
        int h = pg.getHeight();
        PdfTemplate tp = cb.createTemplate(w, h);
        Graphics2D g2d = tp.createGraphics(w, h, true, quality);
        g2d.drawImage(awtImage, 0, 0, null);
        g2d.dispose();
        return getInstance(tp);
    }
View Full Code Here


        PdfTemplate template = pdfContentByte.createTemplate((float)displayWidth, (float)displayHeight);

        Graphics2D g = forceSvgShapes
          ? template.createGraphicsShapes((float)displayWidth, (float)displayHeight)
          : template.createGraphics(availableImageWidth, availableImageHeight, new LocalFontMapper());

        if (clip != null)
        {
          g.setClip(clip);
        }
View Full Code Here

      // corresponds with it
      int w = printPageSize.width;
      int h = printPageSize.height;
      PdfContentByte cb = writer.getDirectContent();
      PdfTemplate tp = cb.createTemplate(w, h);
      Graphics2D g2 = tp.createGraphics(w, h);
      tp.setWidth(w);
      tp.setHeight(h);

      g2.drawImage(image, null, widthBorder, heightBorder);
View Full Code Here

            throw new IOException(MessageLocalization.getComposedMessage("java.awt.image.fetch.aborted.or.errored"));
        }
        int w = pg.getWidth();
        int h = pg.getHeight();
        PdfTemplate tp = cb.createTemplate(w, h);
        Graphics2D g2d = tp.createGraphics(w, h, true, quality);
        g2d.drawImage(awtImage, 0, 0, null);
        g2d.dispose();
        return getInstance(tp);
    }
View Full Code Here

         // step 4
         PdfContentByte cb = writer.getDirectContent();

         PdfTemplate tp = cb.createTemplate(width, height);

         Graphics2D g2d = tp.createGraphics(width, height, new DefaultFontMapper());


         Rectangle2D r2d = new Rectangle2D.Double(0, 0, width, height);

         chart.draw(g2d, r2d);
View Full Code Here

         // step 4
         PdfContentByte cb = writer.getDirectContent();

         PdfTemplate tp = cb.createTemplate(width, height);

         Graphics2D g2d = tp.createGraphics(width, height, new DefaultFontMapper());

         Rectangle2D r2d = new Rectangle2D.Double(0, 0, width, height);

         chart.draw(g2d, r2d);
         g2d.dispose();
View Full Code Here

            // 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

      PdfWriter writer = PdfWriter.getInstance(document,
          new FileOutputStream(file));
      document.open();
      PdfContentByte cb = writer.getDirectContent();
      PdfTemplate tp = cb.createTemplate(w, h);
      Graphics2D g2 = tp.createGraphics(w, h);
      g2.setStroke(new BasicStroke(0.1f));
      tp.setWidth(w);
      tp.setHeight(h);
      g2.drawImage(image, 0, 0, w, h, 0, 0, w, h, null);
      g2.dispose();
View Full Code Here

            document.addAuthor("EAS-StaticMethods");
            document.addSubject("EAS-StandardSubject");
            document.open();
            PdfContentByte cb = writer.getDirectContent();
            PdfTemplate tp = cb.createTemplate(width, height);
            Graphics2D g2 = tp.createGraphics(width, height, mapper);
            env.getOutsideView(g2);
            g2.dispose();
            cb.addTemplate(tp, 0, 0);
        } catch (DocumentException de) {
            System.err.println(de.getMessage());
View Full Code Here

            document.addAuthor("EAS-ChartPlugin");
            document.addSubject(chart.getTitle().getText());
            document.open();
            PdfContentByte cb = writer.getDirectContent();
            PdfTemplate tp = cb.createTemplate(width, height);
            Graphics2D g2 = tp.createGraphics(width, height, mapper);
            java.awt.geom.Rectangle2D r2D = new java.awt.geom.Rectangle2D.Double(0, 0, width, height);
            chart.draw(g2, r2D);
            g2.dispose();
            cb.addTemplate(tp, 0, 0);
        } catch (DocumentException de) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.