Add support for all number switches. More info is available here: Formatting fields with switches
Here are the switches that should be supported:
Amount \# $,0.00: {MERGEFIELD FirstAmount \# $,0.00}Add support for Upper and Lower field switches More info is available here: Formatting fields with switches
Here are the switches that should be supported:
When the data is set as double or float the Numeric formatting of the MergeField is not respected.
When the following merge field:
MERGEFIELD BAL \# ###,0.00
is populated with 5.70F or 5.70D the result is 5.7 instead of 5.70.
The tab stop line wrongly inherits its thickness from the previous table cell`s border.
The table is cut off when its width is larger than the default page width.
Workaround:
var htmlProvider = new HtmlFormatProvider();
var document = htmlProvider.Import(File.ReadAllText(@"..\..\HTMLPage1.html"));
var tables = document.EnumerateChildrenOfType<Table>();
double maxWidth = document.Sections.FirstOrDefault().PageSize.Width;
foreach (var item in tables)
{
if (item.PreferredWidth.Type == Telerik.Windows.Documents.Flow.Model.Styles.TableWidthUnitType.Fixed)
{
maxWidth = Math.Max(maxWidth, (item.PreferredWidth.Value + 100));
}
}
foreach (var item in document.Sections)
{
item.PageSize = new System.Windows.Size(maxWidth, item.PageSize.Height);
}
var pdfProvider = new PdfFormatProvider();
File.WriteAllBytes(@"..\..\result.pdf", pdfProvider.Export(document));
When a field is formatted using the numberInDash format through the section's PageNumberingSettings, the format is not parsed and the field result is not included in the PDF document.
Workaround: Remove the formatting from the section settings:
foreach (var section in this.document.Sections)
{
section.PageNumberingSettings.PageNumberFormat = null;
}