1 17 18 19 20 21 27 28 package org.apache.fop.render.rtf.rtflib.testdocs; 29 30 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea; 31 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection; 32 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph; 33 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfHyperLink; 34 35 import java.io.IOException ; 36 37 42 43 public class BasicLink extends TestDocument { 44 48 51 public BasicLink() { 52 } 53 54 59 protected void generateDocument(RtfDocumentArea rda, RtfSection sect) throws IOException { 60 RtfParagraph p = sect.newParagraph (); 61 p.newLineBreak(); 62 p.newLineBreak(); 63 p.newLineBreak(); 64 p.newText ("external link: "); 65 RtfHyperLink link = p.newHyperLink ("click here to go to the hompage", null); 66 link.setExternalURL ("http://www.skynamics.com"); 67 p.close(); 68 69 p = sect.newParagraph (); 70 p.newLineBreak(); 71 p.newText ("here we will demonstrate internal link to a bookmark"); 72 p.newLineBreak(); 73 p.newText ("internal link: "); 74 link = p.newHyperLink ("click here to go to the bookmark", null); 75 link.setInternalURL ("testBookmark"); 76 p.close(); 77 78 p = sect.newParagraph(); 79 p.newLineBreak(); 80 p.newLineBreak(); 81 p.newLineBreak(); 82 p.newPageBreak(); 83 p.newBookmark("testBookmark"); 84 p.newText("testBookmark"); 85 } 86 } 87 | Popular Tags |