@@ -925,5 +925,105 @@ public virtual void MarginsCollapsingIssueTest() {
925925 NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( filename , cmpName , DESTINATION_FOLDER , "diff_"
926926 ) ) ;
927927 }
928+
929+ [ NUnit . Framework . Test ]
930+ public virtual void SplitPageTest ( ) {
931+ String filename = DESTINATION_FOLDER + "splitPageTest.pdf" ;
932+ String cmpName = SOURCE_FOLDER + "cmp_splitPageTest.pdf" ;
933+ IList < TemplateValue > columnsTemplate = new List < TemplateValue > ( ) ;
934+ columnsTemplate . Add ( new AutoRepeatValue ( true , JavaUtil . ArraysAsList ( ( GridValue ) new PointValue ( 200 ) ) ) ) ;
935+ using ( Document document = new Document ( new PdfDocument ( new PdfWriter ( filename ) ) ) ) {
936+ GridContainer grid = new GridContainer ( ) ;
937+ grid . SetWidth ( 420 ) ;
938+ grid . SetBorder ( new SolidBorder ( 20 ) ) ;
939+ grid . SetPadding ( 20 ) ;
940+ grid . SetMargin ( 20 ) ;
941+ grid . SetProperty ( Property . GRID_TEMPLATE_COLUMNS , columnsTemplate ) ;
942+ grid . SetProperty ( Property . COLUMN_GAP , 20.0f ) ;
943+ grid . Add ( new Paragraph ( "One" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
944+ grid . Add ( new Paragraph ( "Two" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
945+ grid . Add ( new Paragraph ( "Tree" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
946+ grid . Add ( new Paragraph ( "Four" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
947+ grid . Add ( new Paragraph ( "Five" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
948+ grid . Add ( new Paragraph ( "Six" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
949+ grid . Add ( new Paragraph ( "Seven" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
950+ grid . Add ( new Paragraph ( "Eight" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
951+ grid . Add ( new Paragraph ( "Nine" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
952+ Div emptyDiv = new Div ( ) ;
953+ emptyDiv . SetHeight ( 640 ) ;
954+ emptyDiv . SetBackgroundColor ( ColorConstants . LIGHT_GRAY ) ;
955+ document . Add ( emptyDiv ) ;
956+ document . Add ( grid ) ;
957+ }
958+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( filename , cmpName , DESTINATION_FOLDER , "diff_"
959+ ) ) ;
960+ }
961+
962+ [ NUnit . Framework . Test ]
963+ public virtual void BorderBoxSizingTest ( ) {
964+ String filename = DESTINATION_FOLDER + "borderBoxSizingTest.pdf" ;
965+ String cmpName = SOURCE_FOLDER + "cmp_borderBoxSizingTest.pdf" ;
966+ IList < TemplateValue > columnsTemplate = new List < TemplateValue > ( ) ;
967+ columnsTemplate . Add ( new AutoRepeatValue ( true , JavaUtil . ArraysAsList ( ( GridValue ) new PointValue ( 200 ) ) ) ) ;
968+ using ( Document document = new Document ( new PdfDocument ( new PdfWriter ( filename ) ) ) ) {
969+ GridContainer grid = new GridContainer ( ) ;
970+ grid . SetWidth ( 420 ) ;
971+ grid . SetBorder ( new SolidBorder ( 20 ) ) ;
972+ grid . SetPadding ( 20 ) ;
973+ grid . SetMargin ( 20 ) ;
974+ grid . SetProperty ( Property . GRID_TEMPLATE_COLUMNS , columnsTemplate ) ;
975+ grid . SetProperty ( Property . COLUMN_GAP , 20.0f ) ;
976+ grid . Add ( new Paragraph ( "One" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
977+ Paragraph two = new Paragraph ( "Two" ) . SetBackgroundColor ( ColorConstants . CYAN ) ;
978+ two . SetProperty ( Property . BOX_SIZING , BoxSizingPropertyValue . BORDER_BOX ) ;
979+ two . SetPadding ( 10 ) ;
980+ two . SetMargin ( 10 ) ;
981+ two . SetBorder ( new SolidBorder ( ColorConstants . BLUE , 10 ) ) ;
982+ grid . Add ( two ) ;
983+ grid . Add ( new Paragraph ( "Tree" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
984+ grid . Add ( new Paragraph ( "Four" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
985+ grid . Add ( new Paragraph ( "Five" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
986+ grid . Add ( new Paragraph ( "Six" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
987+ grid . Add ( new Paragraph ( "Seven" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
988+ grid . Add ( new Paragraph ( "Eight" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
989+ grid . Add ( new Paragraph ( "Nine" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
990+ document . Add ( grid ) ;
991+ }
992+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( filename , cmpName , DESTINATION_FOLDER , "diff_"
993+ ) ) ;
994+ }
995+
996+ [ NUnit . Framework . Test ]
997+ public virtual void MarginCollapsingTest ( ) {
998+ String filename = DESTINATION_FOLDER + "marginCollapsingTest.pdf" ;
999+ String cmpName = SOURCE_FOLDER + "cmp_marginCollapsingTest.pdf" ;
1000+ IList < TemplateValue > columnsTemplate = new List < TemplateValue > ( ) ;
1001+ columnsTemplate . Add ( new AutoRepeatValue ( true , JavaUtil . ArraysAsList ( ( GridValue ) new PointValue ( 200 ) ) ) ) ;
1002+ using ( Document document = new Document ( new PdfDocument ( new PdfWriter ( filename ) ) ) ) {
1003+ GridContainer grid = new GridContainer ( ) ;
1004+ grid . SetWidth ( 420 ) ;
1005+ grid . SetBorder ( new SolidBorder ( 20 ) ) ;
1006+ grid . SetPadding ( 20 ) ;
1007+ grid . SetMargin ( 20 ) ;
1008+ grid . SetProperty ( Property . GRID_TEMPLATE_COLUMNS , columnsTemplate ) ;
1009+ grid . SetProperty ( Property . COLUMN_GAP , 20.0f ) ;
1010+ grid . Add ( new Paragraph ( "One" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
1011+ Div twoParent = new Div ( ) ;
1012+ Paragraph two = new Paragraph ( "Two" ) . SetBackgroundColor ( ColorConstants . CYAN ) ;
1013+ twoParent . Add ( two ) ;
1014+ twoParent . Add ( new Div ( ) ) ;
1015+ grid . Add ( twoParent ) ;
1016+ grid . Add ( new Paragraph ( "Tree" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
1017+ grid . Add ( new Paragraph ( "Four" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
1018+ grid . Add ( new Paragraph ( "Five" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
1019+ grid . Add ( new Paragraph ( "Six" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
1020+ grid . Add ( new Paragraph ( "Seven" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
1021+ grid . Add ( new Paragraph ( "Eight" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
1022+ grid . Add ( new Paragraph ( "Nine" ) . SetBackgroundColor ( ColorConstants . CYAN ) ) ;
1023+ document . Add ( grid ) ;
1024+ }
1025+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( filename , cmpName , DESTINATION_FOLDER , "diff_"
1026+ ) ) ;
1027+ }
9281028 }
9291029}
0 commit comments