|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
re: rtflib, table of contents, page citationsI am using the BasicLink.java example. I am trying to create a simple 1 item TOC that points to a bookmark. I want the area between the link text and the page number to be "dotted". I would like to use the property: text-align-left, which would fill in the space in between the link text and the page number (citation?) to be dotted, but can't seem to find a reference to it in the rtfLib (fop 95). I don't understand RtfTextrun's and would really appreciate an example of their use. any help would be greatly appreciated. James Here is my code: // testing ONLLY!!!! public static void generateDocument() throws IOException { RtfFile rtfFile = new RtfFile(new FileWriter("C:\\temp\\link.rtf")); rtfDocumentArea = rtfFile.startDocumentArea(); RtfSection sect = rtfDocumentArea.newSection(); RtfParagraph p = sect.newParagraph(); RtfHyperLink link = p.newHyperLink("Risk Factors", new RtfAttributes()); link.setInternalURL("LINK_TEXT"); RtfTextrun run = link.getTextrun(); run.addLeader(new RtfAttributes() .set(RtfLeader.LEADER_WIDTH,RtfLeader.LEADER_STANDARD_WIDTH)); run.addPageNumberCitation("1"); run.close(); p.close(); RtfAttributes c = new RtfAttributes(); c.set(RtfText.ALIGN_CENTER); p = sect.newParagraph(c); p.newPageBreak(); RtfBookmark bm = p.newBookmark("LINK_TEXT"); RtfAttributes attrs = new RtfAttributes(); attrs.set(RtfText.ATTR_BOLD); attrs.set(RtfText.ATTR_UNDERLINE); attrs.set(RtfText.ATTR_FONT_FAMILY, RtfFontManager.getInstance().getFontNumber("Times New Roman")); attrs.set(RtfText.ATTR_FONT_SIZE, new RTFWriter().getFontSize(14)); p.newText("Risk Factors", attrs); rtfFile.flush(); System.exit(-1); } |
|
|
RE: rtflib, table of contents, page citationsJames I am wondering if anyone can shoot me an example of using RtfLeader (with dots) to create a page citation. I am using the BasicLink.java example. I am trying to create a simple 1 item TOC that points to a bookmark. I want the area between the link text and the page number to be "dotted". I would like to use the property: text-align-left, which would fill in the space in between the link text and the page number (citation?) to be dotted, but can't seem to find a reference to it in the rtfLib (fop 95). I don't understand RtfTextrun's and would really appreciate an example of their use. any help would be greatly appreciated. James Here is my code: // testing ONLLY!!!! public static void generateDocument() throws IOException { RtfFile rtfFile = new RtfFile(new FileWriter("C:\\temp\\link.rtf")); rtfDocumentArea = rtfFile.startDocumentArea(); RtfSection sect = rtfDocumentArea.newSection(); RtfParagraph p = sect.newParagraph(); RtfHyperLink link = p.newHyperLink("Risk Factors", new RtfAttributes()); link.setInternalURL("LINK_TEXT"); RtfTextrun run = link.getTextrun(); run.addLeader(new RtfAttributes() .set(RtfLeader.LEADER_WIDTH,RtfLeader.LEADER_STANDARD_WIDTH)); run.addPageNumberCitation("1"); run.close(); p.close(); RtfAttributes c = new RtfAttributes(); c.set(RtfText.ALIGN_CENTER); p = sect.newParagraph(c); p.newPageBreak(); RtfBookmark bm = p.newBookmark("LINK_TEXT"); RtfAttributes attrs = new RtfAttributes(); attrs.set(RtfText.ATTR_BOLD); attrs.set(RtfText.ATTR_UNDERLINE); attrs.set(RtfText.ATTR_FONT_FAMILY, RtfFontManager.getInstance().getFontNumber("Times New Roman")); attrs.set(RtfText.ATTR_FONT_SIZE, new RTFWriter().getFontSize(14)); p.newText("Risk Factors", attrs); rtfFile.flush(); System.exit(-1); } |
| Free embeddable forum powered by Nabble | Forum Help |