@@ -355,6 +355,81 @@ public virtual void ListItemTest02() {
355
355
, "diff" ) ) ;
356
356
}
357
357
358
+ [ NUnit . Framework . Test ]
359
+ public virtual void ListItemWithoutMarginsTest ( ) {
360
+ String outFileName = destinationFolder + "listItemWithoutMarginsTest.pdf" ;
361
+ String cmpFileName = sourceFolder + "cmp_listItemWithoutMarginsTest.pdf" ;
362
+ PdfDocument pdf = new PdfDocument ( new PdfWriter ( outFileName ) ) ;
363
+ Document document = new Document ( pdf ) ;
364
+ document . SetMargins ( 0 , 0 , 0 , 0 ) ;
365
+ List list = new List ( ) ;
366
+ list . SetListSymbol ( ListNumberingType . DECIMAL ) ;
367
+ list . Add ( new ListItem ( "list item 1" ) ) ;
368
+ list . Add ( new ListItem ( "list item 2" ) ) ;
369
+ document . Add ( list ) ;
370
+ document . Close ( ) ;
371
+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , destinationFolder
372
+ , "diff" ) ) ;
373
+ }
374
+
375
+ [ NUnit . Framework . Test ]
376
+ public virtual void ListItemBigMarginsTest ( ) {
377
+ String outFileName = destinationFolder + "listItemBigMarginsTest.pdf" ;
378
+ String cmpFileName = sourceFolder + "cmp_listItemBigMarginsTest.pdf" ;
379
+ PdfDocument pdf = new PdfDocument ( new PdfWriter ( outFileName ) ) ;
380
+ Document document = new Document ( pdf ) ;
381
+ int margin = 100 ;
382
+ document . SetMargins ( margin , margin , margin , margin ) ;
383
+ List list = new List ( ) ;
384
+ list . SetListSymbol ( ListNumberingType . DECIMAL ) ;
385
+ list . Add ( new ListItem ( "list item 1" ) ) ;
386
+ list . Add ( new ListItem ( "list item 2" ) ) ;
387
+ document . Add ( list ) ;
388
+ document . Close ( ) ;
389
+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , destinationFolder
390
+ , "diff" ) ) ;
391
+ }
392
+
393
+ [ NUnit . Framework . Test ]
394
+ public virtual void MaxMarginWidthWhereTheBulletIsNotDrawnTest ( ) {
395
+ String outFileName = destinationFolder + "maxMarginWidthWhereTheBulletIsNotDrawn.pdf" ;
396
+ String cmpFileName = sourceFolder + "cmp_maxMarginWidthWhereTheBulletIsNotDrawn.pdf" ;
397
+ PdfDocument pdf = new PdfDocument ( new PdfWriter ( outFileName ) ) ;
398
+ Document document = new Document ( pdf ) ;
399
+ int margin = 50 ;
400
+ document . SetMargins ( margin , margin , margin , margin ) ;
401
+ List list = new List ( ) ;
402
+ list . SetListSymbol ( ListNumberingType . DECIMAL ) ;
403
+ list . Add ( new ListItem ( "list item 1" ) ) ;
404
+ list . Add ( new ListItem ( "list item 2" ) ) ;
405
+ float ? marginLeft = document . GetDefaultProperty < float > ( Property . MARGIN_LEFT ) ;
406
+ list . SetFixedPosition ( ( float ) marginLeft , 780 , 200 ) ;
407
+ document . Add ( list ) ;
408
+ document . Close ( ) ;
409
+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , destinationFolder
410
+ , "diff" ) ) ;
411
+ }
412
+
413
+ [ NUnit . Framework . Test ]
414
+ public virtual void InitialMarginWidthWhereTheBulletIsDrawnTest ( ) {
415
+ String outFileName = destinationFolder + "initialMarginWidthWhereTheBulletIsDrawn.pdf" ;
416
+ String cmpFileName = sourceFolder + "cmp_initialMarginWidthWhereTheBulletIsDrawn.pdf" ;
417
+ PdfDocument pdf = new PdfDocument ( new PdfWriter ( outFileName ) ) ;
418
+ Document document = new Document ( pdf ) ;
419
+ int margin = 49 ;
420
+ document . SetMargins ( margin , margin , margin , margin ) ;
421
+ List list = new List ( ) ;
422
+ list . SetListSymbol ( ListNumberingType . DECIMAL ) ;
423
+ list . Add ( new ListItem ( "list item 1" ) ) ;
424
+ list . Add ( new ListItem ( "list item 2" ) ) ;
425
+ float ? marginLeft = document . GetDefaultProperty < float > ( Property . MARGIN_LEFT ) ;
426
+ list . SetFixedPosition ( ( float ) marginLeft , 780 , 200 ) ;
427
+ document . Add ( list ) ;
428
+ document . Close ( ) ;
429
+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , destinationFolder
430
+ , "diff" ) ) ;
431
+ }
432
+
358
433
[ LogMessage ( iText . IO . Logs . IoLogMessageConstant . CLIP_ELEMENT , Count = 4 ) ]
359
434
[ NUnit . Framework . Test ]
360
435
public virtual void ListWithSetHeightProperties01 ( ) {
0 commit comments