Scan table and change row height

Hi

I have a number of tables in a word document.  I delete some rows according to incoming data with DOCIO - work brilliantly. I also need to reduce row height so that the group of tables fits on one page. I have a loop doing this, generating a PDF, getting page count then if more than 1 reducing the row height of each row in the table. This works fine except that some cells have text wrapping round two lines which then are only partially visible. Autofit won't sort this.

I could easily fix this by making the row by row scan look at the number of lines in the wraparound text/paragraph in each cell and changing the row height accordingly. But I cannot see if this is available in the object  model, either at cell or row level Any ideas?

Thanks

Paul

1 Reply 1 reply marked as answer

MJ Mohanaselvam Jothi Syncfusion Team February 22, 2021 10:22 AM UTC

Hi Stephanie,

Thank you for contacting Syncfusion support.

DocIO doesn’t have APIs to get the row height dynamically as per the contents in the row .

The Word document is a flow document in which contents will not be preserved page by page; instead the contents will be preserved sequentially section by section. Word viewer/editor renders the contents of the Word document page by page dynamically when opened for viewing or editing and this page wise rendered information will not be preserved in the document level as per the Word file format specification.

Whereas Essential DocIO is a non-UI component that provides a full-fledged document object model to manipulate the Word document contents. During Word to PDF/Image conversion process only, internally we are measuring each contents and layout the elements to render in resultant PDF. This contains more combination of behaviors and vast implementation with more algorithms. So, it is not also feasible to achieve your requirement in sample level.

We are glad to know that you already implemented one logic to calculate the row height alternate way and it works for your scenarios.

Please let us know if you have any other questions

Regards,
Mohanaselvam J


Marked as answer
Loader.
Up arrow icon