@@ -23,8 +23,8 @@ public void Compose(IContainer container)
2323 . PaddingVertical ( 50 )
2424 . Page ( page =>
2525 {
26- page . Header ( ComposeHeader ) ;
27- page . Content ( ComposeContent ) ;
26+ page . Header ( ) . Element ( ComposeHeader ) ;
27+ page . Content ( ) . Element ( ComposeContent ) ;
2828 page . Footer ( ) . AlignCenter ( ) . PageNumber ( "Page {number}" ) ;
2929 } ) ;
3030 }
@@ -33,11 +33,11 @@ void ComposeHeader(IContainer container)
3333 {
3434 container . Row ( row =>
3535 {
36- row . RelativeColumn ( ) . Stack ( column =>
36+ row . RelativeColumn ( ) . Stack ( stack =>
3737 {
38- column . Element ( ) . Text ( $ "Invoice #{ Model . InvoiceNumber } ", TextStyle . Default . Size ( 20 ) . Bold ( ) ) ;
39- column . Element ( ) . Text ( $ "Issue date: { Model . IssueDate : d} ") ;
40- column . Element ( ) . Text ( $ "Due date: { Model . DueDate : d} ") ;
38+ stack . Item ( ) . Text ( $ "Invoice #{ Model . InvoiceNumber } ", TextStyle . Default . Size ( 20 ) . Bold ( ) ) ;
39+ stack . Item ( ) . Text ( $ "Issue date: { Model . IssueDate : d} ") ;
40+ stack . Item ( ) . Text ( $ "Due date: { Model . DueDate : d} ") ;
4141 } ) ;
4242
4343 row . ConstantColumn ( 100 ) . Height ( 50 ) . Placeholder ( ) ;
@@ -46,35 +46,35 @@ void ComposeHeader(IContainer container)
4646
4747 void ComposeContent ( IContainer container )
4848 {
49- container . PaddingVertical ( 40 ) . PageableStack ( column =>
49+ container . PaddingVertical ( 40 ) . Stack ( column =>
5050 {
5151 column . Spacing ( 5 ) ;
5252
53- column . Element ( ) . Row ( row =>
53+ column . Item ( ) . Row ( row =>
5454 {
5555 row . RelativeColumn ( ) . Component ( new AddressComponent ( "From" , Model . SellerAddress ) ) ;
5656 row . ConstantColumn ( 50 ) ;
5757 row . RelativeColumn ( ) . Component ( new AddressComponent ( "For" , Model . CustomerAddress ) ) ;
5858 } ) ;
5959
60- column . Element ( ComposeTable ) ;
60+ column . Item ( ) . Element ( ComposeTable ) ;
6161
6262 var totalPrice = Model . Items . Sum ( x => x . Price * x . Quantity ) ;
63- column . Element ( ) . PaddingRight ( 5 ) . AlignRight ( ) . Text ( $ "Grand total: { totalPrice } $", TextStyle . Default . SemiBold ( ) ) ;
63+ column . Item ( ) . PaddingRight ( 5 ) . AlignRight ( ) . Text ( $ "Grand total: { totalPrice } $", TextStyle . Default . SemiBold ( ) ) ;
6464
6565 if ( ! string . IsNullOrWhiteSpace ( Model . Comments ) )
66- column . Element ( ) . PaddingTop ( 25 ) . Element ( ComposeComments ) ;
66+ column . Item ( ) . PaddingTop ( 25 ) . Element ( ComposeComments ) ;
6767 } ) ;
6868 }
6969
7070 void ComposeTable ( IContainer container )
7171 {
7272 var headerStyle = TextStyle . Default . SemiBold ( ) ;
7373
74- container . PaddingTop ( 10 ) . Section ( section =>
74+ container . PaddingTop ( 10 ) . Decoration ( decoration =>
7575 {
7676 // header
77- section . Header ( ) . BorderBottom ( 1 ) . Padding ( 5 ) . Row ( row =>
77+ decoration . Header ( ) . BorderBottom ( 1 ) . Padding ( 5 ) . Row ( row =>
7878 {
7979 row . ConstantColumn ( 25 ) . Text ( "#" , headerStyle ) ;
8080 row . RelativeColumn ( 3 ) . Text ( "Product" , headerStyle ) ;
@@ -84,13 +84,13 @@ void ComposeTable(IContainer container)
8484 } ) ;
8585
8686 // content
87- section
87+ decoration
8888 . Content ( )
89- . PageableStack ( column =>
89+ . Stack ( column =>
9090 {
9191 foreach ( var item in Model . Items )
9292 {
93- column . Element ( ) . BorderBottom ( 1 ) . BorderColor ( "CCC" ) . Padding ( 5 ) . Row ( row =>
93+ column . Item ( ) . BorderBottom ( 1 ) . BorderColor ( "CCC" ) . Padding ( 5 ) . Row ( row =>
9494 {
9595 row . ConstantColumn ( 25 ) . Text ( Model . Items . IndexOf ( item ) + 1 ) ;
9696 row . RelativeColumn ( 3 ) . Text ( item . Name ) ;
@@ -105,11 +105,11 @@ void ComposeTable(IContainer container)
105105
106106 void ComposeComments ( IContainer container )
107107 {
108- container . Background ( "#EEE" ) . Padding ( 10 ) . Stack ( message =>
108+ container . ShowEntire ( ) . Background ( "#EEE" ) . Padding ( 10 ) . Stack ( message =>
109109 {
110110 message . Spacing ( 5 ) ;
111- message . Element ( ) . Text ( "Comments" , TextStyle . Default . Size ( 14 ) . SemiBold ( ) ) ;
112- message . Element ( ) . Text ( Model . Comments ) ;
111+ message . Item ( ) . Text ( "Comments" , TextStyle . Default . Size ( 14 ) . SemiBold ( ) ) ;
112+ message . Item ( ) . Text ( Model . Comments ) ;
113113 } ) ;
114114 }
115115 }
@@ -127,17 +127,17 @@ public AddressComponent(string title, Address address)
127127
128128 public void Compose ( IContainer container )
129129 {
130- container . Stack ( column =>
130+ container . ShowEntire ( ) . Stack ( column =>
131131 {
132132 column . Spacing ( 5 ) ;
133133
134- column . Element ( ) . BorderBottom ( 1 ) . PaddingBottom ( 5 ) . Text ( Title , TextStyle . Default . SemiBold ( ) ) ;
134+ column . Item ( ) . BorderBottom ( 1 ) . PaddingBottom ( 5 ) . Text ( Title , TextStyle . Default . SemiBold ( ) ) ;
135135
136- column . Element ( ) . Text ( Address . CompanyName ) ;
137- column . Element ( ) . Text ( Address . Street ) ;
138- column . Element ( ) . Text ( $ "{ Address . City } , { Address . State } ") ;
139- column . Element ( ) . Text ( Address . Email ) ;
140- column . Element ( ) . Text ( Address . Phone ) ;
136+ column . Item ( ) . Text ( Address . CompanyName ) ;
137+ column . Item ( ) . Text ( Address . Street ) ;
138+ column . Item ( ) . Text ( $ "{ Address . City } , { Address . State } ") ;
139+ column . Item ( ) . Text ( Address . Email ) ;
140+ column . Item ( ) . Text ( Address . Phone ) ;
141141 } ) ;
142142 }
143143 }
0 commit comments