Hi unfortunately the drawing functionality is very new so there is very little documentation.
The basic interaction is that the RtfShape acts as a container to the RtfShapePosition and a list of RtfShapeProperties. The RtfShapePosition is used to define where on the page the shape will be positioned. Some basic properties are provided via constants in the RtfShapeProperty, but for more complex stuff, you will have to look at the rtf documentation http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec.asp Here's the only example I could whip up quickly RtfShape shape = new RtfShape(RtfShape.SHAPE_FREEFORM, new RtfShapePosition(2000, 2000, 4000, 4000)); shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_GEO_RIGHT, 2000)); shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_GEO_BOTTOM, 2000)); shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_VERTICIES, new Point[]{new Point(100, 100), new Point(1000, 100), new Point(1000, 1000), new Point(100, 1000)})); doc.add(shape); It should be possible to create the document you require, but I haven't tried putting shapes in table cells and on the other hand positioning the shape exactly is also not so easy, but should be possible. Greetings, Mark On Tuesday 28 November 2006 06:35, ken cochrane wrote: > Hello, > > I am trying to create an RTF document with a table that looks like the > following. http://kencochrane.net/itext/RTFTableExample.gif . > Basically it is a Table with a Line that goes across multiple cells, and a > Circle in one of the cells. This document is currently created > by hand using MS Word's Drawing tools, and I can also do it using > OpenOffice's Drawing tools. Is it possible to recreate this table > with the lines and dot using the RTFShape class? If so, could you send me > an example on how to use RTFShape, I have been trying to figure out how to > use it, with no luck. If I see an example, I am sure I can figure it out > from there. > > I have bought the iText in action pdf book, and it showed me how to create > this table in PDF, but it doesn't go into details for RTF, and > Unfortunately I need to create this in both RTF and PDF formats. > > Any help that you could give, would be great, thank you > > Ken Cochrane -- Don't get to bragging. My GPG public key is available at: http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc
pgphoawXZ6hOa.pgp
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
