File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed
Tables/Reduce-Height-of-Empty-Cells/.NET/Reduce-Height-of-Empty-Cells Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change 1- //Creates a new Word document.
2- using Syncfusion . DocIO ;
1+ using Syncfusion . DocIO ;
32using Syncfusion . DocIO . DLS ;
43
5- //Register Syncfusion license
6- Syncfusion . Licensing . SyncfusionLicenseProvider . RegisterLicense ( "Mgo+DSMBMAY9C3t2UlhhQlNHfV5DQmBWfFN0QXNYfVRwdF9GYEwgOX1dQl9nSXZTc0VlWndfcXNSQWc=" ) ;
7-
84// Open the existing Word document ("Template.docx") for reading and writing.
95using ( FileStream inputFileStream = new FileStream ( Path . GetFullPath ( "Data/Template.docx" ) , FileMode . Open , FileAccess . ReadWrite ) )
106{
139 {
1410 // Retrieve the last section of the document.
1511 IWSection section = document . LastSection ;
16-
1712 // Retrieve the first table from the section.
1813 IWTable table = section . Body . Tables [ 0 ] ;
19-
2014 // Iterate through each row in the table.
2115 foreach ( WTableRow row in table . Rows )
2216 {
2317 // Set the row height type to "AtLeast" and height to 0 to minimize height.
2418 row . HeightType = TableRowHeightType . AtLeast ;
2519 row . Height = 0 ;
26-
2720 // Iterate through each cell in the row.
2821 foreach ( WTableCell cell in row . Cells )
2922 {
3023 // Remove top and bottom margins of the cell.
3124 cell . CellFormat . Paddings . Top = 0 ;
3225 cell . CellFormat . Paddings . Bottom = 0 ;
33-
3426 // Iterate through paragraphs in each cell.
3527 foreach ( IWParagraph paragraph in cell . Paragraphs )
3628 {
You can’t perform that action at this time.
0 commit comments