Examples of RtfShapePosition


Examples of com.lowagie.text.rtf.graphic.RtfShapePosition

                    "wrapping modes are possible."));
           
            // Create a new RtfShape of the type RECTANGLE.
            // The position defines the extent of the shape in the page (in Twips)
            RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE,
                    new RtfShapePosition(1000, 2000, 3000, 2000));
           
            // Set the line colour to red
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_LINE_COLOR,
                    Color.RED));
           
View Full Code Here

Examples of com.lowagie.text.rtf.graphic.RtfShapePosition

            RtfWriter2.getInstance(document, new FileOutputStream("DrawingText.rtf"));

            document.open();

            // Create a new rectangle RtfShape.
            RtfShapePosition position = new RtfShapePosition(1000, 1000, 3000, 2000);
            RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE, position);

            // Set the text to display in the drawing object
            shape.setShapeText("This text will appear in the drawing object.");
           
View Full Code Here

Examples of com.lowagie.text.rtf.graphic.RtfShapePosition

            document.open();

            document.add(new Paragraph("This text is above the horizontal rule"));
           
            // Construct a new RtfShapePosition that covers the whole page horizontally
            RtfShapePosition position = new RtfShapePosition(150, 0, 10400, 150);

            // The horizontal position is relative to the margins of the page
            position.setXRelativePos(RtfShapePosition.POSITION_X_RELATIVE_MARGIN);

            // The vertical position is relative to the paragraph
            position.setYRelativePos(RtfShapePosition.POSITION_Y_RELATIVE_PARAGRAPH);
           
            // Create a new line drawing object
            RtfShape shape = new RtfShape(RtfShape.SHAPE_LINE, position);
           
            // Add the shape to the paragraph, so that it is anchored to the
View Full Code Here

Examples of com.lowagie.text.rtf.graphic.RtfShapePosition

                par.add("bla ");
            }
            document.add(par);

            // Create a new rectangle RtfShape. By default it will be above the text
            RtfShapePosition position = new RtfShapePosition(1000, 1000, 2000, 2000);
            RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE, position);
            document.add(shape);

            // Create a rounded rectangle RtfShape and position it below the text
            position = new RtfShapePosition(4000, 1500, 4500, 5000);
            position.setShapeBelowText(true);
            shape = new RtfShape(RtfShape.SHAPE_ROUND_RECTANGLE, position);
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_ADJUST_VALUE, 4500));
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.GRAY));
            document.add(shape);

            // Create a triangle RtfShape, around which text will wrap on both sides
            position = new RtfShapePosition(1500, 3000, 4000, 2500);
            shape = new RtfShape(RtfShape.SHAPE_TRIANGLE_RIGHT, position);
            shape.setWrapping(RtfShape.SHAPE_WRAP_BOTH);
            document.add(shape);

            // Create an elliptical RtfShape, around which text will only wrap on the left side
            position = new RtfShapePosition(3000, 6000, 10500, 4500);
            shape = new RtfShape(RtfShape.SHAPE_ELLIPSE, position);
            shape.setWrapping(RtfShape.SHAPE_WRAP_LEFT);
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.BLUE));
            document.add(shape);

            // Create a circular RtfShape and set its z-order to 1
            position = new RtfShapePosition(5850, 6800, 8200, 7250);
            position.setZOrder(1);
            shape = new RtfShape(RtfShape.SHAPE_ELLIPSE, position);
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.RED));
            document.add(shape);

            // Create a star RtfShape and set its z-order to 2, above the circle
            // defined above
            position = new RtfShapePosition(6000, 7000, 8000, 7000);
            position.setZOrder(2);
            shape = new RtfShape(RtfShape.SHAPE_STAR, position);
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.YELLOW));
            document.add(shape);

            document.close();
View Full Code Here

Examples of com.lowagie.text.rtf.graphic.RtfShapePosition

            RtfWriter2.getInstance(document, new FileOutputStream("DrawingFreeform.rtf"));

            document.open();

            // Create a new rectangle RtfShape using the SHAPE_FREEFORM constant.
            RtfShapePosition position = new RtfShapePosition(1000, 1000, 4000, 4000);
            RtfShape shape = new RtfShape(RtfShape.SHAPE_FREEFORM, position);

            // Set the bottom and right extents of the drawing object.
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_GEO_RIGHT, 3000));
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_GEO_BOTTOM, 3000));
View Full Code Here

Examples of com.lowagie.text.rtf.graphic.RtfShapePosition

            RtfWriter2.getInstance(document, new FileOutputStream("DrawingText.rtf"));

            document.open();

            // Create a new rectangle RtfShape.
            RtfShapePosition position = new RtfShapePosition(1000, 1000, 3000, 2000);
            RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE, position);

            // Set the text to display in the drawing object
            shape.setShapeText("This text will appear in the drawing object.");
           
View Full Code Here

Examples of com.lowagie.text.rtf.graphic.RtfShapePosition

            document.open();

            document.add(new Paragraph("This text is above the horizontal rule"));
           
            // Construct a new RtfShapePosition that covers the whole page horizontally
            RtfShapePosition position = new RtfShapePosition(150, 0, 10400, 150);

            // The horizontal position is relative to the margins of the page
            position.setXRelativePos(RtfShapePosition.POSITION_X_RELATIVE_MARGIN);

            // The vertical position is relative to the paragraph
            position.setYRelativePos(RtfShapePosition.POSITION_Y_RELATIVE_PARAGRAPH);
           
            // Create a new line drawing object
            RtfShape shape = new RtfShape(RtfShape.SHAPE_LINE, position);
           
            // Add the shape to the paragraph, so that it is anchored to the
View Full Code Here

Examples of com.lowagie.text.rtf.graphic.RtfShapePosition

                par.add("bla ");
            }
            document.add(par);

            // Create a new rectangle RtfShape. By default it will be above the text
            RtfShapePosition position = new RtfShapePosition(1000, 1000, 2000, 2000);
            RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE, position);
            document.add(shape);

            // Create a rounded rectangle RtfShape and position it below the text
            position = new RtfShapePosition(4000, 1500, 4500, 5000);
            position.setShapeBelowText(true);
            shape = new RtfShape(RtfShape.SHAPE_ROUND_RECTANGLE, position);
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_ADJUST_VALUE, 4500));
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.GRAY));
            document.add(shape);

            // Create a triangle RtfShape, around which text will wrap on both sides
            position = new RtfShapePosition(1500, 3000, 4000, 2500);
            shape = new RtfShape(RtfShape.SHAPE_TRIANGLE_RIGHT, position);
            shape.setWrapping(RtfShape.SHAPE_WRAP_BOTH);
            document.add(shape);

            // Create an elliptical RtfShape, around which text will only wrap on the left side
            position = new RtfShapePosition(3000, 6000, 10500, 4500);
            shape = new RtfShape(RtfShape.SHAPE_ELLIPSE, position);
            shape.setWrapping(RtfShape.SHAPE_WRAP_LEFT);
            shape.setProperty(
                    new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.BLUE));
            document.add(shape);

            // Create a circular RtfShape and set its z-order to 1
            position = new RtfShapePosition(5850, 6800, 8200, 7250);
            position.setZOrder(1);
            shape = new RtfShape(RtfShape.SHAPE_ELLIPSE, position);
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.RED));
            document.add(shape);

            // Create a star RtfShape and set its z-order to 2, above the circle
            // defined above
            position = new RtfShapePosition(6000, 7000, 8000, 7000);
            position.setZOrder(2);
            shape = new RtfShape(RtfShape.SHAPE_STAR, position);
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_FILL_COLOR, Color.YELLOW));
            document.add(shape);

            document.close();
View Full Code Here

Examples of com.lowagie.text.rtf.graphic.RtfShapePosition

            RtfWriter2.getInstance(document, new FileOutputStream("DrawingFreeform.rtf"));

            document.open();

            // Create a new rectangle RtfShape using the SHAPE_FREEFORM constant.
            RtfShapePosition position = new RtfShapePosition(1000, 1000, 4000, 4000);
            RtfShape shape = new RtfShape(RtfShape.SHAPE_FREEFORM, position);

            // Set the bottom and right extents of the drawing object.
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_GEO_RIGHT, 3000));
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_GEO_BOTTOM, 3000));
View Full Code Here

Examples of com.lowagie.text.rtf.graphic.RtfShapePosition

                    "wrapping modes are possible."));
           
            // Create a new RtfShape of the type RECTANGLE.
            // The position defines the extent of the shape in the page (in Twips)
            RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE,
                    new RtfShapePosition(1000, 2000, 3000, 2000));
           
            // Set the line colour to red
            shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_LINE_COLOR,
                    Color.RED));
           
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.