Examples of RtfAttributes


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

                = (IRtfTextrunContainer)builderContext.getContainer(
                    IRtfTextrunContainer.class, true, this);

            RtfTextrun textrun = container.getTextrun();

            RtfHyperLink link = textrun.addHyperlink(new RtfAttributes());

            if (basicLink.hasExternalDestination()) {
                link.setExternalURL(basicLink.getExternalDestination());
            } else {
                link.setInternalURL(basicLink.getInternalDestination());
View Full Code Here

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

            return;
        }

        try {
            percentManager.setDimension(l);
            RtfAttributes rtfAttr = TextAttributesConverter.convertLeaderAttributes(
                    l, percentManager);

            IRtfTextrunContainer container
                  = (IRtfTextrunContainer)builderContext.getContainer(
                      IRtfTextrunContainer.class, true, this);
View Full Code Here

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

            IRtfTextrunContainer container
                = (IRtfTextrunContainer)builderContext.getContainer(
                    IRtfTextrunContainer.class, true, this);

            RtfTextrun textrun = container.getTextrun();
            RtfAttributes rtfAttr
                = TextAttributesConverter.convertCharacterAttributes(text);

            textrun.pushInlineAttributes(rtfAttr);
            textrun.addString(new String(data, start, length - start));
            textrun.popInlineAttributes();
View Full Code Here

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

        if (bDefer) {
            return;
        }

        try {
            RtfAttributes rtfAttr
                = TextAttributesConverter.convertCharacterAttributes(
                    pagenum);

            IRtfTextrunContainer container
                = (IRtfTextrunContainer)builderContext.getContainer(
View Full Code Here

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

    /** generate the body of the test document */
    protected void generateDocument(RtfDocumentArea rda, RtfSection sect)
    throws IOException {
        final RtfParagraph para = sect.newParagraph();
        para.newText("This is normal\n");
        para.newText("This is bold\n", new RtfAttributes().set(RtfText.ATTR_BOLD));
        para.newText("This is italic\n", new RtfAttributes().set(RtfText.ATTR_ITALIC));
        para.newText("This is underline\n", new RtfAttributes().set(RtfText.ATTR_UNDERLINE));

        // RTF font sizes are in half-points
        para.newText("This is size 48\n", new RtfAttributes().set(RtfText.ATTR_FONT_SIZE, 96));

        para.newText(
            "This is bold and italic\n",
            new RtfAttributes().set(RtfText.ATTR_BOLD).set(RtfText.ATTR_ITALIC)
          );

        final RtfAttributes attr = new RtfAttributes();
        attr.set(RtfText.ATTR_BOLD).set(RtfText.ATTR_ITALIC);
        attr.set(RtfText.ATTR_UNDERLINE);
        attr.set(RtfText.ATTR_FONT_SIZE, 72);
        para.newText("This is bold, italic, underline and size 36\n", attr);

        para.newText("This is back to normal\n");
    }
View Full Code Here

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

     * @param sect RtfSection
     * @throws java.io.IOException for I/O errors
     */
    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.RtfAttributes

    throws FOPException {

        //Property p;
        //RtfColorTable colorTable = RtfColorTable.getInstance();

        RtfAttributes attrib = null;

        if (rtfatts == null) {
            attrib = new RtfAttributes();
        } else {
            attrib = rtfatts;
        }

        //String attrValue;
        //boolean isBorderPresent = false;
        //need to set a default width

        //check for keep-together row attribute

        if (fobj.getKeepTogether().getWithinPage().getEnum() == Constants.EN_ALWAYS) {
            attrib.set(ITableAttributes.ROW_KEEP_TOGETHER);
        }

        //Check for keep-with-next row attribute.
        if (fobj.getKeepWithNext().getWithinPage().getEnum() == Constants.EN_ALWAYS) {
            attrib.set(ITableAttributes.ROW_KEEP_WITH_NEXT);
        }

        //Check for keep-with-previous row attribute.
        if (fobj.getKeepWithPrevious().getWithinPage().getEnum() == Constants.EN_ALWAYS) {
            attrib.set(ITableAttributes.ROW_KEEP_WITH_PREVIOUS);
        }

        //Check for height row attribute.
        if (fobj.getHeight().getEnum() != Constants.EN_AUTO) {
            attrib.set(ITableAttributes.ROW_HEIGHT, fobj.getHeight().getValue() / (1000 / 20));
        }

        /* to write a border to a side of a cell one must write the directional
         * side (ie. left, right) and the inside value if one needs to be taken
         * out ie if the cell lies on the edge of a table or not, the offending
View Full Code Here

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

            Region regionAfter = pagemaster.getRegion(Constants.FO_REGION_AFTER);
            if (fl.getFlowName().equals(regionBody.getRegionName())) {
                // if there is no header in current page-sequence but there has been
                // a header in a previous page-sequence, insert an empty header.
                if (bPrevHeaderSpecified && !bHeaderSpecified) {
                    RtfAttributes attr = new RtfAttributes();
                    attr.set(RtfBefore.HEADER);

                    final IRtfBeforeContainer contBefore
                        = (IRtfBeforeContainer)builderContext.getContainer
                                (IRtfBeforeContainer.class, true, this);
                    contBefore.newBefore(attr);
                }

                // if there is no footer in current page-sequence but there has been
                // a footer in a previous page-sequence, insert an empty footer.
                if (bPrevFooterSpecified && !bFooterSpecified) {
                    RtfAttributes attr = new RtfAttributes();
                    attr.set(RtfAfter.FOOTER);

                    final IRtfAfterContainer contAfter
                        = (IRtfAfterContainer)builderContext.getContainer
                                (IRtfAfterContainer.class, true, this);
                    contAfter.newAfter(attr);
                }
                handled = true;
            } else if (regionBefore != null
                    && fl.getFlowName().equals(regionBefore.getRegionName())) {
                bHeaderSpecified = true;
                bPrevHeaderSpecified = true;

                final IRtfBeforeContainer c
                    = (IRtfBeforeContainer)builderContext.getContainer(
                        IRtfBeforeContainer.class,
                        true, this);

                RtfAttributes beforeAttributes = ((RtfElement)c).getRtfAttributes();
                if (beforeAttributes == null) {
                    beforeAttributes = new RtfAttributes();
                }
                beforeAttributes.set(RtfBefore.HEADER);

                RtfBefore before = c.newBefore(beforeAttributes);
                builderContext.pushContainer(before);
                handled = true;
            } else if (regionAfter != null
                    && fl.getFlowName().equals(regionAfter.getRegionName())) {
                bFooterSpecified = true;
                bPrevFooterSpecified = true;

                final IRtfAfterContainer c
                    = (IRtfAfterContainer)builderContext.getContainer(
                        IRtfAfterContainer.class,
                        true, this);

                RtfAttributes afterAttributes = ((RtfElement)c).getRtfAttributes();
                if (afterAttributes == null) {
                    afterAttributes = new RtfAttributes();
                }

                afterAttributes.set(RtfAfter.FOOTER);

                RtfAfter after = c.newAfter(afterAttributes);
                builderContext.pushContainer(after);
                handled = true;
            }
View Full Code Here

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

        if (bDefer) {
            return;
        }

        try {
            RtfAttributes rtfAttr
                = TextAttributesConverter.convertAttributes(bl);

            IRtfTextrunContainer container
                = (IRtfTextrunContainer)builderContext.getContainer(
                    IRtfTextrunContainer.class,
View Full Code Here

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

        if (bDefer) {
            return;
        }

        try {
            RtfAttributes rtfAttr
                = TextAttributesConverter.convertBlockContainerAttributes(blc);

            IRtfTextrunContainer container
                = (IRtfTextrunContainer)builderContext.getContainer(
                    IRtfTextrunContainer.class,
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.