@Test public void testBreakTimes() { BreakLine br = BreakLine.times(3).create(); int tot = TestUtils .regexCount(br.getContent(), "(<w:p wsp:rsidR=\"008979E8\" wsp:rsidRDefault=\"008979E8\"/>)"); assertEquals(3, tot); }
myDoc.addEle(BreakLine.times(1).create()); // this is one breakline .with("This doc has been generated by the unit test testJava2wordAllInOne() in the class DocumentTest2004Test.java.") .create()); myDoc.addEle(BreakLine.times(1).create()); myDoc.addEle(BreakLine.times(1).create()); ParagraphPiece myParPiece01 = ParagraphPiece .with("If you use the class 'Paragraph', you will have limited style. Maybe only paragraph Aligment or BgColor."); myDoc.addEle(BreakLine.times(2).create()); myDoc.addEle(Paragraph.withPieces( ParagraphPiece.with("This is a manual 'bold' and 'italic'") .withStyle().font(Font.COURIER_BOLD_ITALIC) .create()).create()); myDoc.addEle(BreakLine.times(1).create()); myDoc.addEle(BreakLine.times(1).create()); myDoc.addEle(Paragraph.withPieces(ParagraphPiece.with("New ParagraphPiece styles have been implemented. Here they are:").withStyle().fontSize("14").create())); myDoc.addEle(Paragraph.withPieces(ParagraphPiece.with("The Style is: ").create(), ParagraphPiece.with("Outline").withStyle().outline().create())); myDoc.addEle(Paragraph.withPieces(ParagraphPiece.with("The Style is: ").create(), ParagraphPiece.with("Shadow").withStyle().shadow().create())); myDoc.addEle(BreakLine.times(2).create()); myDoc.addEle(BreakLine.times(2).create()); myDoc.addEle(Heading2.with("===== Document Header and Footer ======") .create());