Package com.lowagie.text

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


        try {
            RtfWriter2 writer2 = RtfWriter2.getInstance(document, new FileOutputStream("toc.rtf"));
           
            writer2.setAutogenerateTOCEntries(true);
           
            document.open();
           
            Paragraph para = new Paragraph();
            para.add(new RtfTableOfContents("RIGHT CLICK AND HERE AND SELECT \"UPDATE FIELD\" TO UPDATE."));
            document.add(para);
View Full Code Here


            HtmlWriter.getInstance(document, new FileOutputStream("images_wrong.html"));
            HtmlWriter writer = HtmlWriter.getInstance(document, new FileOutputStream("images_right.html"));
            writer.setImagepath("./");
           
            // step 3: we open the document
            document.open();
           
            // step 4:
            document.add(new Paragraph("A picture of my dog: otsoe.jpg"));
            LwgImage jpg = LwgImage.getInstance("otsoe.jpg");
            document.add(jpg);
View Full Code Here

    try {
            // step 2:
            PdfWriter.getInstance(document, new FileOutputStream("fancylists.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4:

      // RomanList
      RomanList roman = new RomanList(35);
View Full Code Here

      // and directs a HTML-stream to a file
      HtmlWriter.getInstance(document,
          new FileOutputStream("HelloWorld.html"));

      // step 3: we open the document
      document.open();
      // step 4: we add a paragraph to the document
      document.add(new Paragraph("Hello World"));
    } catch (DocumentException de) {
      System.err.println(de.getMessage());
    } catch (IOException ioe) {
View Full Code Here

    try {
      // step2
      PdfWriter.getInstance(document,
          new GfrFileOutputStream("com.lowagie.examples.objects.tables.TableSpacing.pdf"));
      // step3
      document.open();
      // step4
      LwgPdfPTable table = new LwgPdfPTable(3);
      LwgPdfPCell cell = new LwgPdfPCell(new Paragraph("header with colspan 3"));
      cell.setColspan(3);
      table.add(cell);
View Full Code Here

    public static void main(String[] args) {
        System.out.println("Shading pattern");
        LwgDocument document = new LwgDocument(LwgPageSize.A4, 50, 50, 50, 50);
        try {
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("shading_pattern.pdf"));
            document.open();

            PdfShading shading = PdfShading.simpleAxial(writer, 100, 100, 400, 100, Color.red, Color.cyan);
            PdfShadingPattern shadingPattern = new PdfShadingPattern(shading);
            PdfContentByte cb = writer.getDirectContent();
            BaseFont bf = BaseFont.createFont(BaseFont.TIMES_BOLD, BaseFont.WINANSI, false);
View Full Code Here

        try {
            // step 2: creation of the writer
            PdfWriter.getInstance(document,
                    new GfrFileOutputStream("com.lowagie.examples.objects.tables.alternatives.SpecificCells.pdf"));
            // step 3: we open the document
            document.open();
            // step 4: we create a table and add it to the document
            Table aTable;
           
            aTable = new Table(4,4);    // 4 rows, 4 columns
            aTable.setAlignment(LwgElement.ALIGN_RIGHT);
View Full Code Here

    public static void main(String[] args) {
        System.out.println("Shading");
        LwgDocument document = new LwgDocument(LwgPageSize.A4, 50, 50, 50, 50);
        try {
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("shading.pdf"));
            document.open();

            PdfFunction function1 = PdfFunction.type2(writer, new float[]{0, 1}, null,
                new float[]{.929f, .357f, 1, .298f}, new float[]{.631f, .278f, 1, .027f}, 1.048f);
            PdfFunction function2 = PdfFunction.type2(writer, new float[]{0, 1}, null,
                new float[]{.929f, .357f, 1, .298f}, new float[]{.941f, .4f, 1, .102f}, 1.374f);
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("transparency.pdf"));
            // step 3: we open the document
            document.open();
            // step 4: content
            PdfContentByte cb = writer.getDirectContent();
            float gap = (document.getPageSize().getWidth() - 400) / 3;
           
            pictureBackdrop(gap, 500, cb);
View Full Code Here

    try {
      // step2
      PdfWriter.getInstance(document,
          new GfrFileOutputStream("com.lowagie.examples.objects.tables.TableWidthAlignment.pdf"));
      // step3
      document.open();
      // step4
      LwgPdfPTable table = new LwgPdfPTable(3);
      LwgPdfPCell cell = new LwgPdfPCell(new Paragraph("header with colspan 3"));
      cell.setColspan(3);
      table.add(cell);
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.