Free Support Forum - aspose.com

Preferred Width set in 9.5 but not 4.0.2?

Hi,

I am trying out Aspose,Words for .NET 9.5. All my tables created using StartTable() are having their Cell’s “Preferred Width” set to 1". In 4.0.2 this is not the case.

How do I prevent the “Preferred Width” form being set? I have tried setting CellFormat.FitText and RowFormat.AllowAutoFit to all combination of true and false.

Thank you.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Unfortunately, there is no way to specify “Auto-fit to content” option of table cell using Aspose.Words. I linked your request to the appropriate issue; you will be notified as soon as this feature is supported.

Best regards,

AndreyN:

Hi

Thanks for your inquiry. Unfortunately, there is no way to specify “Auto-fit to content” option of table cell using Aspose.Words. I linked your request to the appropriate issue; you will be notified as soon as this feature is supported.

Best regards,



What changed between version 4.0.2 and 9.5, so that the auto-fit to content is lost? Using 4.0.2, no parameters are set, just a basic table is set up and it works fine. Aka: the "Preferred width" is not set to true (ie 1"). Are there any settings that can be set to mimic the behavior seen in 4.0.2?

Thanks.

Is there a to set “Preferred Width” to be false in Aspose.Words for .NET 9.5? In 4.0.2 it was set to false by default. (Meaning that when the generated document is opened in Word 2007, the table in question does not have “Preferred width” checked in the table’s property window column tab, or cell tab.) I thought that by setting RowFormat.AllowAutoFit = true, this would be the same thing, right?

Thanks.

Hi Robert,

Thanks for your inquiry.

The functionality of this has changed somewhere in later versions, most likely due to reworkings of how tables are calculated for rendering. We will support auto fitting cell to contents again and will keep you informed of any developments.

In the mean time, you can turn off the preferred width for the cell and column by specifying builder.CellFormat.Width = 0; This will work but the "auto fitting" will be a bit off as it will start a new line whenever a space is encounted. You could work around this if you want by replacing spaces with a different symbol which is blank but not the actual space character (0x20).

Another method involves storing a premade template in word which contains a simple one cell table with the preferred width turned off. Instead of inserting a new cell into your document you could import this in the same place and then work off it.

Each method has it's advantages as I think the first method would work for rendering while the second would not.

If you have any further queries, please feel free to ask.

Thanks,

The issues you have found earlier (filed as WORDSNET-2044) have been fixed in this .NET update and in this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(56)

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan