GroupDocs.Assembly for .NET 17.5.0 Release Notes

Major Features

Support of variables, dynamic text background setting, and a new image size fit mode are added.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
ASSEMBLYNET-37Add ability to define and use variables in template documentsFeature
ASSEMBLYNET-38Add ability to set text background color dynamicallyFeature
ASSEMBLYNET-39Add ability not to grow the size of an image container while fitting it for the size of an imageFeature

Public API and Backward Incompatible Changes

Setting Background Color Dynamically for HTML Documents

For HTML documents, a background color can not be set dynamically using the backColor tag. However, you can use the HTML style attribute to achieve this as shown in the following examples.

Example 1. Setting a background color for a text fragment dynamically

Given that color is the string “orange”, you can use the following template to highlight a text fragment dynamically by applying the corresponding background color to it.

<html>
<body>
Regular text. <span style="background-color:&lt;&lt;[color]&gt;&gt;">Highlighted text.</span>
</body>
</html>

In this case, GroupDocs.Assembly produces the following result document.

<html>
<body>
Regular text. <span style="background-color:orange">Highlighted text.</span>
</body>
</html>

Example 2. Setting background colors for table rows dynamically

Given that colors is an enumeration of the strings “red”, “orange”, and “yellow”, you can use the following template to apply corresponding background colors to rows of a table.

<html>
<body>
<table>
&lt;&lt;foreach [color in colors]&gt;&gt;
<tr style="background-color:&lt;&lt;[color]&gt;&gt;">
<td>
Item
</td>
<td>
Some text
</td>
</tr>
&lt;&lt;/foreach&gt;&gt;
</table>
</body>
</html>

In this case, GroupDocs.Assembly produces the following result document.

<html>
<body>
<table>

<tr style="background-color:red">
<td>
Item
</td>
<td>
Some text
</td>
</tr>

<tr style="background-color:orange">
<td>
Item
</td>
<td>
Some text
</td>
</tr>

<tr style="background-color:yellow">
<td>
Item
</td>
<td>
Some text
</td>
</tr>

</table>
</body>
</html>