List of usage examples for com.lowagie.text.rtf.style RtfParagraphStyle RtfParagraphStyle
public RtfParagraphStyle(String styleName, String fontName, int fontSize, int fontStyle, Color fontColor)
From source file:ca.nines.ise.writer.RTFWriter.java
License:Open Source License
public RTFWriter(PrintStream out) throws ParserConfigurationException, UnsupportedEncodingException { super(out);/*from w w w. j a v a 2 s .c o m*/ doc = new Document(); writer = RtfWriter2.getInstance(doc, out); writer.getDocumentSettings().setOutputDebugLineBreaks(true); normal = new RtfParagraphStyle("ISE Normal", "Times New Roman", 12, Font.NORMAL, Color.BLACK); normal.setAlignment(Element.ALIGN_UNDEFINED); writer.getDocumentSettings().registerParagraphStyle(normal); ld = new RtfParagraphStyle("ISE h2", "ISE Normal"); ld.setFontName("Helvetica"); ld.setSize(16); ld.setStyle(Font.BOLD); writer.getDocumentSettings().registerParagraphStyle(ld); exit = new RtfParagraphStyle("ISE exit", "ISE Normal"); exit.setAlignment(Element.ALIGN_RIGHT); exit.setStyle(Font.ITALIC); writer.getDocumentSettings().registerParagraphStyle(exit); p1 = new RtfParagraphStyle("ISE p1", "ISE Normal"); p1.setFirstLineIndent(-19); p1.setIndentLeft(19); p1.setIndentRight(49); writer.getDocumentSettings().registerParagraphStyle(p1); prose = new RtfParagraphStyle("ISE Prose", "ISE Normal"); prose.setFirstLineIndent(-19); prose.setIndentLeft(19); prose.setIndentRight(49); writer.getDocumentSettings().registerParagraphStyle(prose); p2 = new RtfParagraphStyle("ISE p2", "ISE Normal"); p2.setFirstLineIndent(-19); p2.setIndentLeft(38); p2.setIndentRight(49); writer.getDocumentSettings().registerParagraphStyle(p2); fnStyle = new RtfParagraphStyle("ISE Footnote", "ISE Normal"); fnStyle.setFontName("Times New Roman"); fnStyle.setFirstLineIndent(-19); fnStyle.setIndentLeft(19); fnStyle.setIndentRight(0); fnStyle.setSize(10); writer.getDocumentSettings().registerParagraphStyle(fnStyle); }