Package com.lowagie.text

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


            // we create a writer that listens to the document
            // and directs a PDF-stream to a file
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("literal.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4: we grab the ContentByte and do some stuff with it
            PdfContentByte cb = writer.getDirectContent();
            String star = "0.3 g\n15.000 27.000 m\n"
                + "7.947 5.292 l\n26.413 18.708 l\n"
View Full Code Here


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

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

      // step 4: we grab the ContentByte and do some stuff with it
      PdfContentByte cb = writer.getDirectContent();

            PdfGState gs = new PdfGState();
View Full Code Here

      // we create a writer that listens to the document
      PdfWriter.getInstance(document,
          new FileOutputStream("Rendering.pdf"));

      // step 3: we open the document
      document.open();
      // step 4:     
      Paragraph p = new Paragraph("Text Rendering:");
      document.add(p);
      Chunk chunk = new Chunk("rendering test");
      chunk.setTextRenderMode(PdfContentByte.TEXT_RENDER_MODE_FILL, 100f, new Color(0xFF, 0x00, 0x00));
View Full Code Here

        System.out.println("Demonstrates adding a soft linebreak to a Paragraph");
        try {
            LwgDocument document = new LwgDocument();
            RtfWriter2.getInstance(document, new FileOutputStream("SoftLineBreak.rtf"));

            document.open();

            document.add(new Paragraph("This is just a paragraph."));
           
            Paragraph par = new Paragraph();
View Full Code Here

            // step 2
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("contentgroups.pdf"));
            writer.setPdfVersion(PdfWriter.VERSION_1_5);
            writer.setViewerPreferences(PdfWriter.PageModeUseOC);
            // step 3
            document.open();
            // step 4
            PdfContentByte cb = writer.getDirectContent();
            LwgPhrase explanation = new LwgPhrase("Layer grouping", new LwgFont(LwgFont.HELVETICA, 20, LwgFont.BOLD, Color.red));
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50, 650, 0);
            PdfLayer l1 = new PdfLayer("Layer 1", writer);
View Full Code Here

        try {
            // step 2: creation of the writer
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("affinetransformation.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4:
            PdfContentByte cb = writer.getDirectContent();
            cb.transform(AffineTransform.getScaleInstance(1.2, 0.75));
           
View Full Code Here

           
            // step 2: creation of the writer
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("circles.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4: we grab the ContentByte and do some stuff with it
            PdfContentByte cb = writer.getDirectContent();

            cb.circle(250.0f, 500.0f, 200.0f);
View Full Code Here

      PdfWriter writer = PdfWriter.getInstance(document,
          new FileOutputStream("Generic.pdf"));
      writer.setPageEvent(new Generic());
     
      // step 3: we open the document
      document.open();
      // step 4:
      Paragraph p = new Paragraph("Generic page event");
      document.add(p);
      Chunk box = new Chunk("box");
      box.setGenericTag("box");
View Full Code Here

        LwgDocument document = new LwgDocument(LwgPageSize.A4, 50, 50, 50, 50);
        try {
            // step 2: creation of a writer
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("softmask.pdf"));
            // step 3: we open the document
            document.open();
            // step 4: content
            PdfContentByte cb = writer.getDirectContent();
            String text = "text ";
            text += text;
            text += text;
View Full Code Here

      // step 2:
      PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("bookmarks.pdf"));
      // step 3:
            writer.setViewerPreferences(PdfWriter.PageModeUseOutlines);
      document.open();
            // step 4: we grab the ContentByte and do some stuff with it
            writer.setPageEvent(new Bookmarks());
           
            document.add(new Paragraph("GALLIA est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur.  Hi omnes lingua, institutis, legibus inter se differunt. Gallos ab Aquitanis Garumna flumen, a Belgis Matrona et Sequana dividit. Horum omnium fortissimi sunt Belgae, propterea quod a cultu atque humanitate provinciae longissime absunt, minimeque ad eos mercatores saepe commeant atque ea quae ad effeminandos animos pertinent important, proximique sunt Germanis, qui trans Rhenum incolunt, quibuscum continenter bellum gerunt.  Qua de causa Helvetii quoque reliquos Gallos virtute praecedunt, quod fere cotidianis proeliis cum Germanis contendunt, cum aut suis finibus eos prohibent aut ipsi in eorum finibus bellum gerunt.", new LwgFont(LwgFont.HELVETICA, 12)));
            document.add(new Paragraph("[Eorum una, pars, quam Gallos obtinere dictum est, initium capit a flumine Rhodano, continetur Garumna flumine, Oceano, finibus Belgarum, attingit etiam ab Sequanis et Helvetiis flumen Rhenum, vergit ad septentriones. Belgae ab extremis Galliae finibus oriuntur, pertinent ad inferiorem partem fluminis Rheni, spectant in septentrionem et orientem solem. Aquitania a Garumna flumine ad Pyrenaeos montes et eam partem Oceani quae est ad Hispaniam pertinet; spectat inter occasum solis et septentriones.]", new LwgFont(LwgFont.HELVETICA, 12)));
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.