Package com.lowagie.text

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


           
            // step 2: creation of the writer
            PdfWriter writer = PdfWriter.getInstance(document, new GfrFileOutputStream("com.lowagie.examples.objects.columns.ColumnIrregular.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();
           
View Full Code Here


          | PdfWriter.PageModeFullScreen
          | PdfWriter.NonFullScreenPageModeUseThumbs);
      writer4.setViewerPreferences(PdfWriter.DisplayDocTitle);
      writer5.setViewerPreferences(PdfWriter.PrintScalingNone);
      document.addTitle("Julius Caesar");
      document.open();
      // step 4: we grab the ContentByte and do some stuff with it
      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)));
View Full Code Here

            // Change the default font name. This will propagate to the paragraph stylesheet
            // that inherits, but not the other one.
            RtfParagraphStyle.STYLE_NORMAL.setFontName("Times New Roman");
           
            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

          // step 1
          LwgDocument document = new LwgDocument();
          // step 2
            PdfWriter.getInstance(document, new FileOutputStream("fontselection.pdf"));
            // step 3
            document.open();
            // step 4
            String text = "This text is the first verse of \u275dThe Iliad\u275e. It's not polytonic as it should be "
            + "with \u2798 and \u279a entoation variants but that's all we have for now.\n\n"
            + "\u2766\u00a0\u00a0\u039c\u03b7\u03bd\u03b9\u03bd \u03b1\u03b5\u03b9\u03b4\u03b5, \u03b8\u03b5\u03b1, \u03a0\u03b7\u03bb\u03b7\u03b9\u03b1\u03b4\u03b5\u03c9 \u0391\u03c7\u03b9\u03bb\u03b7\u03bf\u03c2";
            FontSelector sel = new FontSelector();
View Full Code Here

        System.out.println("Demonstrates creating Paragraphs with tab stops");
        try {
            LwgDocument document = new LwgDocument();
            RtfWriter2.getInstance(document, new FileOutputStream("BasicTabs.rtf"));

            document.open();
           
            // Define the Paragraph to add tab stops to
            Paragraph par = new Paragraph();
           
            // Add the tab stops to the paragraph
View Full Code Here

           
            // Register the paragraph stylesheets with the RtfWriter2
            rtfWriter2.getDocumentSettings().registerParagraphStyle(tocLevel1Style);
            rtfWriter2.getDocumentSettings().registerParagraphStyle(tocLevel2Style);
           
            document.open();

            // Create a Paragraph and add the table of contents to it
            Paragraph par = new Paragraph();
            par.add(new RtfTableOfContents("Right-click here and select \"Update\" " +
                    "to see the table of contents."));
View Full Code Here

            // If the footer (or header) is to be the same for all Chapters
            // then it has to be set before the document is opened and is
            // then automatically set for all Chapters.
            document.setFooter(new HeaderFooter(new LwgPhrase("This is page "), new LwgPhrase(".")));
           
            document.open();
           
            Chapter chapter1 = new Chapter("Chapter 1", 1);
            chapter1.add(new Paragraph("This document has different headers and footers " +
                    " for each chapter."));
            document.add(chapter1);
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

    try {
      // step2
      PdfWriter.getInstance(document,
          new GfrFileOutputStream("com.lowagie.examples.objects.tables.CellAlignment.pdf"));
      // step3
      document.open();
      // step4
      LwgPdfPTable table = new LwgPdfPTable(2);
      LwgPdfPCell cell;
      Paragraph p = new Paragraph("Quick brown fox jumps over the lazy dog. Quick brown fox jumps over the lazy dog.");
      table.add("default alignment");
View Full Code Here

        try {
            // step 2: creation of the writer-object
            PdfWriter.getInstance(document,
                    new GfrFileOutputStream("com.lowagie.examples.objects.tables.alternatives.PaddingBorders.pdf"));
            // step 3: we open the document
            document.open();
            // step 4: we create a table and add it to the document
            Table table = new Table(3);
            table.setBorderWidth(1);
            table.setBorderColor(new Color(0, 0, 255));
            table.setPadding(10);
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.