Hi guys,
I need some help regarding the following problems:
1.Hyperlink/Anchor/RtfAnchor for using it into a RTF document.
The document is generating using the Document class and NOT the RtfDocument (so I'm thinking that the RtfAnchor will not solve my problem).
I'm trying to add two Anchors to my document, but I don't succeed.
the code is something like this:
Anchor anch1=new Anchor("Anchor 1");
anch1.setName("anch1");
anch1.setReference ("http://www.google.com");
Paragraph para1=new Paragraph();
para1.add(anch1);
Anchor anch2=new Anchor("Anchor 2");
anch2.setName("anch2");
anch2.setReference("#anch1");
Paragraph para2=new Paragraph();
para2.add(anch2);
that should be all what I'm doing.
Now, I want to press on the "Anchor 2" and move the cursor to the "Anchor 1", and this is not happening, in fact it's moving the cursor to the START of the document.
What I'm doing wrong ?
(If nothing is wrong, is there other solution for me for using hyperlinks into RTF documents, for moving through chapters/paragraphs ? )
2.Auto extending TableOfContents
I'm generating a TOC into a RTF document also.
I want to extend (to open it) all the elements using java code.
Is this possible ?
Beside of that, I don't succeed to change the font for the TOC (few elements from the TOC are written with 12 font, others with 14 and so on)
This is how I'm trying to do:
RtfFont font = new RtfFont( "Arial");
font.setSize(12);
font.setColor(Color.RED);
font.setStyle( RtfFont.BOLD);
RtfTableOfContents tableOfContents = new RtfTableOfContents( "RIGHT CLICK AND HERE AND SELECT \"UPDATE FIELD\" TO UPDATE.", font );
RtfFont font2 = new RtfFont( "Arial");
font2.setSize(12);
font2.setColor(Color.RED);
font2.setStyle( RtfFont.BOLD);
Paragraph paragraphTableOfContents = new Paragraph( );
paragraphTableOfContents.add( tableOfContents );
document.add( paragraphTableOfContents );
document.add( new RtfTOCEntry( "Entry One", font2) );
document.add( new RtfTOCEntry( "Entry Two", font3) );
document.add( new RtfTOCEntry( "Entry Three", font4) );
.
.
.
document.add( new RtfTOCEntry( "Entry N", fontn) );
All these entries will have from time to time diferent fonts ...
This is kind of strange.
Please, anyone can help me with these issues?
Thanks in advance.
--
Best Regards,
I need some help regarding the following problems:
1.Hyperlink/Anchor/RtfAnchor for using it into a RTF document.
The document is generating using the Document class and NOT the RtfDocument (so I'm thinking that the RtfAnchor will not solve my problem).
I'm trying to add two Anchors to my document, but I don't succeed.
the code is something like this:
Anchor anch1=new Anchor("Anchor 1");
anch1.setName("anch1");
anch1.setReference ("http://www.google.com");
Paragraph para1=new Paragraph();
para1.add(anch1);
Anchor anch2=new Anchor("Anchor 2");
anch2.setName("anch2");
anch2.setReference("#anch1");
Paragraph para2=new Paragraph();
para2.add(anch2);
that should be all what I'm doing.
Now, I want to press on the "Anchor 2" and move the cursor to the "Anchor 1", and this is not happening, in fact it's moving the cursor to the START of the document.
What I'm doing wrong ?
(If nothing is wrong, is there other solution for me for using hyperlinks into RTF documents, for moving through chapters/paragraphs ? )
2.Auto extending TableOfContents
I'm generating a TOC into a RTF document also.
I want to extend (to open it) all the elements using java code.
Is this possible ?
Beside of that, I don't succeed to change the font for the TOC (few elements from the TOC are written with 12 font, others with 14 and so on)
This is how I'm trying to do:
RtfFont font = new RtfFont( "Arial");
font.setSize(12);
font.setColor(Color.RED);
font.setStyle( RtfFont.BOLD);
RtfTableOfContents tableOfContents = new RtfTableOfContents( "RIGHT CLICK AND HERE AND SELECT \"UPDATE FIELD\" TO UPDATE.", font );
RtfFont font2 = new RtfFont( "Arial");
font2.setSize(12);
font2.setColor(Color.RED);
font2.setStyle( RtfFont.BOLD);
Paragraph paragraphTableOfContents = new Paragraph( );
paragraphTableOfContents.add( tableOfContents );
document.add( paragraphTableOfContents );
document.add( new RtfTOCEntry( "Entry One", font2) );
document.add( new RtfTOCEntry( "Entry Two", font3) );
document.add( new RtfTOCEntry( "Entry Three", font4) );
.
.
.
document.add( new RtfTOCEntry( "Entry N", fontn) );
All these entries will have from time to time diferent fonts ...
This is kind of strange.
Please, anyone can help me with these issues?
Thanks in advance.
--
Best Regards,
Alin
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
