@@ -59,6 +59,7 @@ This file is part of the iText (R) project.
59
59
import com .itextpdf .layout .element .Paragraph ;
60
60
import com .itextpdf .layout .element .Tab ;
61
61
import com .itextpdf .layout .element .TabStop ;
62
+ import com .itextpdf .layout .element .Table ;
62
63
import com .itextpdf .layout .element .Text ;
63
64
import com .itextpdf .layout .property .Property ;
64
65
import com .itextpdf .layout .property .TabAlignment ;
@@ -273,6 +274,49 @@ public void anchorTabStopsTest02() throws IOException, InterruptedException {
273
274
Assert .assertNull (new CompareTool ().compareByContent (outFileName , cmpFileName , destinationFolder , "diff" + outFileName ));
274
275
}
275
276
277
+ @ Test
278
+ public void tablesAndTabInsideOfParagraph () throws IOException , InterruptedException {
279
+ String testName = "tablesAndTabInsideOfParagraph.pdf" ;
280
+ String outFileName = destinationFolder + testName ;
281
+ String cmpFileName = sourceFolder + "cmp_" + testName ;
282
+
283
+ Document doc = initDocument (outFileName , false );
284
+
285
+
286
+ Table leftTable = new Table (1 );
287
+ for (int x =0 ; x <3 ; x ++){
288
+ leftTable .addCell ("Table 1, Line " + (x + 1 ));
289
+ }
290
+ Table rightTable = new Table (1 );
291
+ for (int x =0 ; x <3 ; x ++){
292
+ rightTable .addCell ("Table 2, Line " + (x + 1 ));
293
+ }
294
+
295
+ Paragraph p = new Paragraph ().add (leftTable );
296
+ p .add (new Tab ());
297
+ p .addTabStops (new TabStop (300 , TabAlignment .LEFT ));
298
+ p .add (rightTable );
299
+ doc .add (new Paragraph ("TabAlignment: LEFT" ));
300
+ doc .add (p );
301
+
302
+ p = new Paragraph ().add (leftTable );
303
+ p .add (new Tab ());
304
+ p .addTabStops (new TabStop (300 , TabAlignment .CENTER ));
305
+ p .add (rightTable );
306
+ doc .add (new Paragraph ("TabAlignment: CENTER" ));
307
+ doc .add (p );
308
+
309
+ p = new Paragraph ().add (leftTable );
310
+ p .add (new Tab ());
311
+ p .addTabStops (new TabStop (300 , TabAlignment .RIGHT ));
312
+ p .add (rightTable );
313
+ doc .add (new Paragraph ("TabAlignment: RIGHT" ));
314
+ doc .add (p );
315
+
316
+ doc .close ();
317
+ Assert .assertNull (new CompareTool ().compareByContent (outFileName , cmpFileName , destinationFolder , testName + "_diff" ));
318
+ }
319
+
276
320
@ Test
277
321
public void severalTabsInRowTest () throws IOException , InterruptedException {
278
322
String fileName = "severalTabsInRowTest.pdf" ;
0 commit comments