本文整理匯總了Java中com.lowagie.text.Paragraph.setSpacingAfter方法的典型用法代碼示例。如果您正苦於以下問題:Java Paragraph.setSpacingAfter方法的具體用法?Java Paragraph.setSpacingAfter怎麽用?Java Paragraph.setSpacingAfter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.lowagie.text.Paragraph
的用法示例。
在下文中一共展示了Paragraph.setSpacingAfter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import com.lowagie.text.Paragraph; //導入方法依賴的package包/類
/**
* Demonstrates adding a soft linebreak to a Paragraph
*
*
*/
@Test
public void main() throws Exception {
Document document = new Document();
RtfWriter2.getInstance(document, PdfTestBase.getOutputStream("SoftLineBreak.rtf"));
document.open();
document.add(new Paragraph("This is just a paragraph."));
Paragraph par = new Paragraph();
// Set the spacings just to demonstrate that the soft linebreak
// does not cause spacing before or after
par.setSpacingBefore(10);
par.setSpacingAfter(10);
// Add the contents before the linebreak
par.add("This paragraph contains a soft linebreak");
// Add the soft linebreak
par.add(RtfDirectContent.DIRECT_SOFT_LINEBREAK);
// Add the contents after the linebreak
par.add("just before the just.");
// Add the paragraph to the document
document.add(par);
document.add(new Paragraph("This is just a paragraph."));
document.close();
}