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
Key | Summary | Category |
---|---|---|
ASSEMBLYNET-37 | Add ability to define and use variables in template documents | Feature |
ASSEMBLYNET-38 | Add ability to set text background color dynamically | Feature |
ASSEMBLYNET-39 | Add ability not to grow the size of an image container while fitting it for the size of an image | Feature |
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:<<[color]>>">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>
<<foreach [color in colors]>>
<tr style="background-color:<<[color]>>">
<td>
Item
</td>
<td>
Some text
</td>
</tr>
<</foreach>>
</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>