EvotecIT / OfficeIMO

Fast and easy to use cross-platform .NET library that creates or modifies Microsoft Word (DocX) and later also Excel (XLSX) files without installing any software. Library is based on Open XML SDK
MIT License
263 stars 47 forks source link

TextBox.WidthCentimeters only respected if RelativeWidthPercentage set to 0 #183

Open TopperDEL opened 6 months ago

TopperDEL commented 6 months ago

See this code:

var textBox = document.AddTextBox("My text");
textBox.HeightCentimeters = myHeight;
textBox.WidthCentimeters = myWidth;

The height and width are not respected until I set the Percentages to 0:

textBox.RelativeWidthPercentage = 0;
textBox.RelativeHeightPercentage = 0;

This was not expected. How about clearing the percentage values if the corresponding Centimeters-value is set (and perhaps vice versa)?

PrzemyslawKlys commented 6 months ago

Ye, probably should be done. From what I saw in openxml it was clearing it or ignoring (don't remember now), so this should be improved with added tests.