Package com.lowagie.text

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


           
            // step 2: creation of the writer
            PdfWriter.getInstance(document, new GfrFileOutputStream("com.lowagie.examples.fonts.FontEncoding.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4: we add content to the document
            BaseFont helvetica = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.EMBEDDED);
            LwgFont font = new LwgFont(helvetica, 12, LwgFont.NORMAL);
            Chunk chunk = new Chunk("Sponsor this example and send me 1\u20ac. These are some special characters: \u0152\u0153\u0160\u0161\u0178\u017D\u0192\u02DC\u2020\u2021\u2030", font);
View Full Code Here


           
            // step 2: creation of the writer
            PdfWriter writer = PdfWriter.getInstance(document, new GfrFileOutputStream("com.lowagie.examples.objects.columns.Column.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4:
           
            // we create some content
            BaseFont bf = BaseFont.createFont(BaseFont.COURIER, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
View Full Code Here

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

      // step 3: we open the document
      document.open();
      // step 4:
      Paragraph[] p = new Paragraph[5];
            p[0] = 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.");
            p[1] = 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.]");
            p[2] = new Paragraph("Apud Helvetios longe nobilissimus fuit et ditissimus Orgetorix.  Is M. Messala, [et P.] M.  Pisone consulibus regni cupiditate inductus coniurationem nobilitatis fecit et civitati persuasit ut de finibus suis cum omnibus copiis exirent:  perfacile esse, cum virtute omnibus praestarent, totius Galliae imperio potiri.  Id hoc facilius iis persuasit, quod undique loci natura Helvetii continentur:  una ex parte flumine Rheno latissimo atque altissimo, qui agrum Helvetium a Germanis dividit; altera ex parte monte Iura altissimo, qui est inter Sequanos et Helvetios; tertia lacu Lemanno et flumine Rhodano, qui provinciam nostram ab Helvetiis dividit.  His rebus fiebat ut et minus late vagarentur et minus facile finitimis bellum inferre possent; qua ex parte homines bellandi cupidi magno dolore adficiebantur.  Pro multitudine autem hominum et pro gloria belli atque fortitudinis angustos se fines habere arbitrabantur, qui in longitudinem milia passuum CCXL, in latitudinem CLXXX patebant.");
View Full Code Here

    try {
            // step 2:
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("PageLabels.pdf"));
            // step 3:
            writer.setViewerPreferences(PdfWriter.PageModeUseThumbs);
            document.open();
            // step 4:
            // we add some content
            for (int k = 1; k <= 10; ++k) {
                document.add(new Paragraph("This document has the logical page numbers: i,ii,iii,iv,1,2,3,A-8,A-9,A-10\nReal page " + k));
                document.newPage();
View Full Code Here

            // Step 2: Create a new instance of the RtfWriter2 with the document
            //         and target output stream.
            RtfWriter2.getInstance(document, new FileOutputStream("HelloWorld.rtf"));
           
            // Step 3: Open the document.
            document.open();
           
            // Step 4: Add content to the document.
            document.add(new Paragraph("Hello World!"));
           
            // Step 5: Close the document. It will be written to the target output stream.
View Full Code Here

        System.out.println("Demonstrates using the paragraph stylesheets");
        try {
            LwgDocument document = new LwgDocument();
            RtfWriter2.getInstance(document, new FileOutputStream("BasicStylesheets.rtf"));

            document.open();
           
            // Simply set the stylesheet you wish to use as the Font
            // of the Paragraph
            document.add(new Paragraph("This is a heading",
                    RtfParagraphStyle.STYLE_HEADING_1));
View Full Code Here

        System.out.println("Demonstrates how to use the RtfTabGroup to repeatedly add a set of tab stops");
        try {
            LwgDocument document = new LwgDocument();
            RtfWriter2.getInstance(document, new FileOutputStream("TabGroups.rtf"));

            document.open();
           
            // Construct the RtfTabGroup object
            RtfTabGroup tabGroup = new RtfTabGroup();
            // Add RtfTab tab stops at the desired positions
            tabGroup.add(new RtfTab(400, RtfTab.TAB_RIGHT_ALIGN));
View Full Code Here

            RtfParagraphStyle.STYLE_HEADING_2.setSize(12);

            // Change the style properties to the desired values
            // before document.open()

            document.open();
           
            // Simply set the stylesheet you wish to use as the Font
            // of the Paragraph
            document.add(new Paragraph("This is a heading level 1",
                    RtfParagraphStyle.STYLE_HEADING_1));
View Full Code Here

            footer.addCell(new LwgCell(pageNumber));
           
            // Create the RtfHeaderFooter and set it as the footer to use
            document.setFooter(new RtfHeaderFooter(footer));
           
            document.open();
           
            document.add(new Paragraph("This document has headers and footers created" +
                    " using the RtfHeaderFooter class."));

            document.close();
View Full Code Here

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

      // step 3: we open the document
      document.open();
      // step 4:
            document.add(LwgPhrase.getInstance("What is the " + (char) 945 + "-coefficient of the "
                    + (char) 946 + "-factor in the " + (char) 947 + "-equation?\n"));
                    for (int i = 913; i < 970; i++) {
                        document.add(LwgPhrase.getInstance(" " + i + ": " + (char) i));
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.