Package com.lowagie.text

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


            // step 2
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("nestedlayers.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 nesting", 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("transformimage.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4:
            PdfContentByte cb = writer.getDirectContent();
            LwgImage img = LwgImage.getInstance("hitchcock.png");
            cb.addImage(img, 271, -50, -30, 550, 100, 100);
View Full Code Here

            // and directs a PDF-stream to a file
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("spotcolor.pdf"));
            BaseFont bf = BaseFont.createFont("Helvetica", "winansi", BaseFont.NOT_EMBEDDED);
           
            // step 3: we open the document
            document.open();
           
            // step 4: we grab the ContentByte and do some stuff with it
            PdfContentByte cb = writer.getDirectContent();
           
            // step 5: we instantiate PdfSpotColor
View Full Code Here

            LwgDocument doc = new LwgDocument(LwgPageSize.A4, 50, 50, 100, 72);
            // step 2: creating the writer
            PdfWriter writer = PdfWriter.getInstance(doc, new FileOutputStream("pageNumbersWatermark.pdf"));
            // step 3: initialisations + opening the document
            writer.setPageEvent(new PageNumbersWatermark());
            doc.open();
            // step 4: adding content
            String text = "some padding text ";
            for (int k = 0; k < 10; ++k)
                text += text;
            Paragraph p = new Paragraph(text);
View Full Code Here

            // we create a writer that listens to the document
            // and directs a PDF-stream to a file
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("pdfversion.pdf"));
            writer.setPdfVersion(PdfWriter.VERSION_1_2);
            // step 3: we open the document
            document.open();
           
            // step 4:
            document.add(new Paragraph("This is a PDF-1.2 document"));
        }
        catch(DocumentException de) {
View Full Code Here

            // and directs a PDF-stream to a file
           
            PdfWriter.getInstance(document, new GfrFileOutputStream("com.lowagie.examples.general.faq.Measurements.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4:
            document.add(new Paragraph("The size of this page is 288x720 points."));
            document.add(new Paragraph("288pt / 72 points per inch = 4 inch"));
            document.add(new Paragraph("720pt / 72 points per inch = 10 inch"));
View Full Code Here

            // step 2
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("layers.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 radio group and zoom", new LwgFont(LwgFont.HELVETICA, 20, LwgFont.BOLD, Color.red));
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50, 650, 0);
            PdfLayer title = PdfLayer.createTitle("Layer radio group", writer);
View Full Code Here

        System.out.println("Demonstrates creating Table Cells with complex borders");
        try {
            LwgDocument document = new LwgDocument();
            RtfWriter2.getInstance(document, new FileOutputStream("ExtendedTableCell.rtf"));

            document.open();
           
            Table table = new Table(3);

            // Create a simple RtfCell with a dotted border.
            RtfCell cellDotted = new RtfCell("Dotted border");
View Full Code Here

          // step 1
          LwgDocument document = new LwgDocument();
          // step 2
            PdfWriter.getInstance(document, new FileOutputStream("differentfonts.pdf"));
            // step 3
            document.open();
            // step 4
            Paragraph p = new Paragraph();
            p.add(new Chunk("This text is in Times Roman. This is ZapfDingbats: ", new LwgFont(LwgFont.TIMES_ROMAN, 12)));
            p.add(new Chunk("abcdefghijklmnopqrstuvwxyz", new LwgFont(LwgFont.ZAPFDINGBATS, 12)));
            p.add(new Chunk(". This is font Symbol: ", new LwgFont(LwgFont.TIMES_ROMAN, 12)));
View Full Code Here

            footer.setHeaderFooter(new RtfHeaderFooter(rightFooter), RtfHeaderFooter.DISPLAY_RIGHT_PAGES);
           
            // Set the document footer
            document.setFooter(footer);
           
            document.open();
           
            document.add(new Paragraph("This document has headers and footers created" +
                    " using the RtfHeaderFooterGroup class.\n\n"));
           
            // Add some content, so that the different headers / footers show up.
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.