Package com.lowagie.text

Examples of com.lowagie.text.Document.open()


      // and directs a PDF-stream to a file
      PdfWriter writer = PdfWriter.getInstance(document,
          new FileOutputStream(pdfPath));

      // step 3: we open the document
      document.open();

      // step 4: we create a template and a Graphics2D object that
      // corresponds with it
      int w = printPageSize.width;
      int h = printPageSize.height;
View Full Code Here


            //   to pass along to uDig's standard "printing" code.
            String outputFile = page1.getDestinationDir()+
                System.getProperty("file.separator")+ //$NON-NLS-1$
                page1.getOutputFile();
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(outputFile));
            document.open();           
            Graphics2D graphics = null;
            Template template = getTemplate();
           
            int i = 0;
            int numPages = 1;
View Full Code Here

            Document document = new Document();
            document.setPageSize(PageSize.LETTER);
            //Rectangle rect = document.getPageSize();
            //PdfWriter writer = PdfWriter.getInstance(document, baos);
            PdfCopy writer = new PdfCopy(document, baos);
            document.open();
            Iterator iter = compDocParts.iterator();
            int pgCnt =0;
            while (iter.hasNext()) {
                GenericValue contentAssocRevisionItemView = (GenericValue)iter.next();
                //String thisContentId = contentAssocRevisionItemView.getString("contentId");
View Full Code Here

            //ByteArrayOutputStream baos = new ByteArrayOutputStream();
            Document document = new Document();
            document.setPageSize(PageSize.LETTER);
            //Rectangle rect = document.getPageSize();
            //PdfCopy writer = new PdfCopy(document, baos);
            document.open();

            GenericValue dataResource = null;
            if (UtilValidate.isEmpty(contentRevisionSeqId)) {
                GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId));
                dataResourceId = content.getString("dataResourceId");
View Full Code Here

            // step 2: creation of the writer
            PdfWriter writer = PdfWriter.getInstance(document, out);

            // step 3: we open the document
            document.open();

            // step 4: we grab the ContentByte and do some stuff with it

            // we create a fontMapper and read all the fonts in the font
            // directory
View Full Code Here

      int w = image.getWidth(null);
      int h = image.getHeight(null);
      file = new File(fileName);
      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);
View Full Code Here

        Document document = new Document(pagesize, 50, 50, 50, 50);
        try {
            PdfWriter writer = PdfWriter.getInstance(document, out);
            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();
View Full Code Here

        Document document = new Document(pagesize, 50, 50, 50, 50);
        try {
            PdfWriter writer = PdfWriter.getInstance(document, out);
            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);
View Full Code Here

        float height = psize.getWidth();

        Document document = new Document(new Rectangle(height, width));
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream( output ));

        document.open();

        PdfContentByte cb = writer.getDirectContent();

        int i = 0;
        while (i < n) {
View Full Code Here

        Document document = new Document();
    
        try {
            writer = PdfWriter.getInstance(document, new FileOutputStream(
                    fileName));
            document.open();
            PdfContentByte contentByte = writer.getDirectContent();
            PdfTemplate template = contentByte.createTemplate(width, height);
            Graphics2D graphics2d = template.createGraphics(width, height,
                    new DefaultFontMapper());
            Rectangle2D rectangle2d = new Rectangle2D.Double(0, 0, width,
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.