Examples of RtfParagraph


Examples of org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph

class Whitespace extends TestDocument {
    /** generate the body of the test document */
    protected void generateDocument(RtfDocumentArea rda, RtfSection sect)
    throws IOException {
        final RtfParagraph p1 = sect.newParagraph();
        p1.newText("\t  Each word  of this paragraph must   be "
                   + "separated\tfrom\t\n\tthe next word with exactly\t \tone");
        p1.newText("   space.");

        final RtfParagraph p2 = sect.newParagraph();
        p2.newText("");
        p2.newText("In this");
        p2.newText(" paragraph ");
        p2.newText("as well,");
        p2.newText("   there must\tbe    \t");
        p2.newText("exactly");
        p2.newText(" one space   ");
        p2.newText("between  each\tword and the  next, and no spaces at the "
                   + "beginning or end of the paragraph.");

        final RtfParagraph p3 = sect.newParagraph();
        p3.newText("The word 'boomerang' must be written after this with no funny spacing: ");
        p3.newText("boo");
        p3.newText("me");
        p3.newText("r");
        p3.newText("a");
        p3.newText("ng.");
    }
View Full Code Here

Examples of org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph

    public ExternalGraphic () {

    }
    /** generate the body of the test document */
    protected void generateDocument (RtfDocumentArea rda, RtfSection sect) throws IOException {
        RtfParagraph p = sect.newParagraph ();
        p.newLineBreak();
        p.newLineBreak();
        p.newLineBreak();
        p.newText ("EMF image with 150 % height");
        p.newLineBreak();
        RtfExternalGraphic imageA = p.newImage ();
        imageA.setURL (file + "emf");
        imageA.setHeight ("150%");
        p.newLineBreak();
        p.close();

        p = sect.newParagraph();
        p.newLineBreak();
        p.newText ("PNG image with 150 % width");
        p.newLineBreak();
        RtfExternalGraphic imageB = sect.newImage ();
        imageB.setURL (file + "png");
        imageB.setWidth ("150%");
        p.newLineBreak();
        p.close();

        p = sect.newParagraph();
        p.newLineBreak();
        p.newLineBreak();
        p.newText ("JPG image with width = 200px and height = 20 px");
        p.newLineBreak();
        RtfExternalGraphic imageC = sect.newImage ();
        imageC.setURL (file + "jpg");
        imageC.setWidth ("200");
        imageC.setHeight ("20");
        p.newLineBreak();
        p.close();

        p = sect.newParagraph();
        p.newLineBreak();
        p.newLineBreak();
        p.newText ("GIF image with width = 200px and scaling = 'uniform', that means the image "
                + "size will adjusted automatically");
        p.newLineBreak();
        RtfExternalGraphic imageD = sect.newImage ();
        imageD.setURL (file + "gif");
        imageD.setWidth ("200");
        imageD.setScaling ("uniform");
        p.newLineBreak();
        p.close();

        p = sect.newParagraph();
        p.newLineBreak();
        p.newLineBreak();
        p.newText ("GIF image");
        p.newLineBreak();
        RtfExternalGraphic imageE = sect.newImage ();
        imageE.setURL (file + "gif");
        p.newLineBreak();
        p.close();

    }
View Full Code Here

Examples of org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph

            list.setRtfListStyle(ls);
        }
        for (int i = 0; i < nItems; i++) {
            final RtfListItem item = list.newListItem();
            for (int j = 0; j <= i; j++) {
                final RtfParagraph para = item.newParagraph();
                para.newText("List " + listIndex + ", item " + i + ", paragraph " + j);
                if (i == 0 && j == 0) {
                    final String txt = "This item takes more than one line to check word-wrapping.";
                    para.newText(". " + "This list should have " + nItems
                            + " items. " + txt + " " + txt + " " + txt);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph

     */
    protected void generateDocument(RtfDocumentArea rda, RtfSection sect) throws java.io.IOException
    {
        RtfAttributes attr = new RtfAttributes ();
        attr.set(RtfText.ALIGN_CENTER);
        RtfParagraph p = sect.newParagraph (attr);
        p.newLineBreak();
        p.newLineBreak();
        p.newText ("Centered title");
        p.newLineBreak();
        p.close();

        attr = new RtfAttributes ();
        attr.set(RtfText.ALIGN_LEFT);
        p = sect.newParagraph (attr);
        p.newLineBreak();
        p.newText ("This is the left aligned text.");
        p.newLineBreak();
        p.close();

        attr = new RtfAttributes ();
        attr.set(RtfText.ALIGN_RIGHT);
        p = sect.newParagraph (attr);
        p.newLineBreak();
        p.newText ("This is the right aligned text.");
        p.newLineBreak();
        p.close();
    }
View Full Code Here

Examples of org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph

    /** generate the body of the test document */
    protected void generateDocument(RtfDocumentArea rda, RtfSection sect)
    throws IOException {
        sect.newParagraph().newText("First paragraph of the simple RTF test document.");

        final RtfParagraph para = sect.newParagraph();
        para.newText("Second paragraph of simple RTF test document.\n");
        for (int i = 0; i < 242; i++) {
            para.newText("This is string " + i);
            para.newLineBreak();
        }
    }
View Full Code Here

Examples of org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph

        RtfDocumentArea doc = f.startDocumentArea();

        RtfSection section = doc.newSection();

        RtfParagraph paragraph = section.newParagraph();
        paragraph.newText("Testing fop - rtf module - class RtfTableRow");
        paragraph.close();

        RtfTable table = section.newTable(null);
        RtfTableRow row = table.newTableRow();
        row.newTableCell(2000).newParagraph().newText("blah");
        row.newTableCell(5000).newParagraph().newText("doubleBlah");
View Full Code Here

Examples of org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph

class Whitespace extends TestDocument {
    /** generate the body of the test document */
    protected void generateDocument(RtfDocumentArea rda, RtfSection sect)
    throws IOException {
        final RtfParagraph p1 = sect.newParagraph();
        p1.newText("\t  Each word  of this paragraph must   be "
                   + "separated\tfrom\t\n\tthe next word with exactly\t \tone");
        p1.newText("   space.");

        final RtfParagraph p2 = sect.newParagraph();
        p2.newText("");
        p2.newText("In this");
        p2.newText(" paragraph ");
        p2.newText("as well,");
        p2.newText("   there must\tbe    \t");
        p2.newText("exactly");
        p2.newText(" one space   ");
        p2.newText("between  each\tword and the  next, and no spaces at the "
                   + "beginning or end of the paragraph.");

        final RtfParagraph p3 = sect.newParagraph();
        p3.newText("The word 'boomerang' must be written after this with no funny spacing: ");
        p3.newText("boo");
        p3.newText("me");
        p3.newText("r");
        p3.newText("a");
        p3.newText("ng.");
    }
View Full Code Here

Examples of org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph

    public ExternalGraphic () {

    }
    /** generate the body of the test document */
    protected void generateDocument (RtfDocumentArea rda, RtfSection sect) throws IOException {
        RtfParagraph p = sect.newParagraph ();
        p.newLineBreak();
        p.newLineBreak();
        p.newLineBreak();
        p.newText ("EMF image with 150 % height");
        p.newLineBreak();
        RtfExternalGraphic imageA = p.newImage ();
        imageA.setURL (file + "emf");
        imageA.setHeight ("150%");
        p.newLineBreak();
        p.close();

        p = sect.newParagraph();
        p.newLineBreak();
        p.newText ("PNG image with 150 % width");
        p.newLineBreak();
        RtfExternalGraphic imageB = sect.newImage ();
        imageB.setURL (file + "png");
        imageB.setWidth ("150%");
        p.newLineBreak();
        p.close();

        p = sect.newParagraph();
        p.newLineBreak();
        p.newLineBreak();
        p.newText ("JPG image with width = 200px and height = 20 px");
        p.newLineBreak();
        RtfExternalGraphic imageC = sect.newImage ();
        imageC.setURL (file + "jpg");
        imageC.setWidth ("200");
        imageC.setHeight ("20");
        p.newLineBreak();
        p.close();

        p = sect.newParagraph();
        p.newLineBreak();
        p.newLineBreak();
        p.newText ("GIF image with width = 200px and scaling = 'uniform', that means the image "
                + "size will adjusted automatically");
        p.newLineBreak();
        RtfExternalGraphic imageD = sect.newImage ();
        imageD.setURL (file + "gif");
        imageD.setWidth ("200");
        imageD.setScaling ("uniform");
        p.newLineBreak();
        p.close();

        p = sect.newParagraph();
        p.newLineBreak();
        p.newLineBreak();
        p.newText ("GIF image");
        p.newLineBreak();
        RtfExternalGraphic imageE = sect.newImage ();
        imageE.setURL (file + "gif");
        p.newLineBreak();
        p.close();

    }
View Full Code Here

Examples of org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph

            list.setRtfListStyle(ls);
        }
        for (int i = 0; i < nItems; i++) {
            final RtfListItem item = list.newListItem();
            for (int j = 0; j <= i; j++) {
                final RtfParagraph para = item.newParagraph();
                para.newText("List " + listIndex + ", item " + i + ", paragraph " + j);
                if (i == 0 && j == 0) {
                    final String txt = "This item takes more than one line to check word-wrapping.";
                    para.newText(". " + "This list should have " + nItems
                            + " items. " + txt + " " + txt + " " + txt);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph

     */
    protected void generateDocument(RtfDocumentArea rda, RtfSection sect) throws java.io.IOException
    {
        RtfAttributes attr = new RtfAttributes ();
        attr.set(RtfText.ALIGN_CENTER);
        RtfParagraph p = sect.newParagraph (attr);
        p.newLineBreak();
        p.newLineBreak();
        p.newText ("Centered title");
        p.newLineBreak();
        p.close();

        attr = new RtfAttributes ();
        attr.set(RtfText.ALIGN_LEFT);
        p = sect.newParagraph (attr);
        p.newLineBreak();
        p.newText ("This is the left aligned text.");
        p.newLineBreak();
        p.close();

        attr = new RtfAttributes ();
        attr.set(RtfText.ALIGN_RIGHT);
        p = sect.newParagraph (attr);
        p.newLineBreak();
        p.newText ("This is the right aligned text.");
        p.newLineBreak();
        p.close();
    }
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.