Importing HTML tables with mixed inline width styles and auto-width cells, then exporting to PDF, can produce missing/narrow columns or wrapped labels.
For example, a 4-cell row with td style="width: 60%" and td style="width: 40%" causes the unlabeled cells to collapse in PDF output, even though the HTML renders correctly in browser.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table>
<tr>
<td align="right">Customer:</td>
<td style="width: 60%;">Angel Popov</td>
<td align="right">Date:</td>
<td style="width: 40%;">4/4/2004</td>
</tr>
</table>
</body>
</html>Expected: all cells keep visible widths and text stays on one line.
Actual: auto columns shrink too much or disappear during PDF export after HTML import.
NotImplementedException is thrown for GetCapHeight method of CFFFontSource.
System.NotImplementedException: The method or operation is not implemented.HtmlFormatProvider: Styles are not correctly preserved when a <b> tag is applied to the same styled element.
Workaround: Apply bold through CSS instead of using <b>.
NetStandard: Missing content due to empty glyph outlines in embedded TrueType font subsets.
Fully embed the fonts in the result PDF document:
PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
pdfFormatProvider.ExportSettings.FontEmbeddingType = FontEmbeddingType.Full;Workaround 2
Switch to a .NET Framework project environment and use the .NET Framework PdfProcessing packages.
Corrupted document when exporting "Courier New" subset.
Workaround - fully embed the font:
var pdfFormatProvider = new PdfFormatProvider();
pdfFormatProvider.ExportSettings.FontEmbeddingType = FontEmbeddingType.Full;NOTE: There are reports for other fonts' subset, e.g. "ZapfDingbats" font.
Workbook wb = new Workbook();
Worksheet worksheet = wb.Worksheets.Add();
PatternFill fill = new PatternFill(PatternType.DiagonalStripe, Colors.Red, Colors.Transparent);
worksheet.Cells[0, 0].SetFill(fill);
string outputFilePath = "Sample.pdf";
File.Delete(outputFilePath);
Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider pdfFormatProvider =
new Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider();
//export to file
using (Stream output = File.OpenWrite(outputFilePath))
{
pdfFormatProvider.Export(wb, output, TimeSpan.FromSeconds(10));
}
Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });When there is an abstractNum defined with the same abstractNumId in word\glossary\numbering.xml and in the word\numbering.xml, a "System.ArgumentException: An item with the same key has already been added." exception is thrown.
In other cases, the import overwrites the styles from the main document part with the ones defined in the glossary or fails to import different parts of the content.
Workaround: Delete the glossary files:
string path = "File.docx";
using (Stream str = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
using (ZipArchive archive = ZipArchive.Update(str, null))
{
foreach (ZipArchiveEntry entry in archive.Entries.ToList())
{
if (entry.FullName.Contains("glossary/"))
{
entry.Delete();
}
}
}
DocxFormatProvider provider = new DocxFormatProvider();
RadFlowDocument flowDocument = provider.Import(str, null);
}
LineInfo objects are not cleared when there are tables in the document being exported to PDF which leads to OutOfMemoryException.
Add support for array formulas (CellFormulaType "array"). These formulas can accept as parameters and return results containing whole arrays (one- or two- dimensional) of data. In MS Excel, such formulas are inserted with CTRL + SHIFT + Enter, and visualized enclosed with curly brackets ('{' and '}').
Importing an XLSX workbook can crash with System.ArgumentNullException: Value cannot be null. Parameter name: key during Workbook.ResumeCalculationMapRegistration().
Root cause:CellSelection.SetValue method causes memory leak of CellReferenceRangeExpression objects in some cases when cell value is referenced by formulas. The memory leak is small, but the remaining CellReferenceRangeExpression continue to listen to some events, causing performance issues when their number become large - the time to set the value increases with each set.
When opening an Xlsx file with conditional formatting I get an Exception:
"System.ArgumentNullException: 'Value cannot be null. (Parameter 'formatting')'
at Telerik.Windows.Documents.Spreadsheet.Model.ConditionalFormattings.ConditionalFormattingDxfRule..ctor(DifferentialFormatting formatting)
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Model.Elements.Worksheets.ConditionalFormattingRuleElement.GetRule(DifferentialFormatting formatting)
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Model.Elements.Worksheets.ConditionalFormattingRuleElement.OnAfterRead(IXlsxWorksheetImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.ImportPartFromArchive(ZipArchiveEntry zipEntry, PartBase part, IOpenXmlImportContext context)
at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.Import(Stream input, IOpenXmlImportContext context)
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider.ImportOverride(Stream input)
at WpfApp1.MainWindow.StartExcel() in C:\Users\larse\source\repos\WpfApp1\MainWindow.xaml.cs:line 49"
To quote my colleage: "After dissecting the Excel template file, I have isolated what is causing the issue. If conditional formatting is used to disable cell boarders it results in the error, if the conditional formatting is updated to turn the necessary borders white, instead of disabling the report exports correctly, the following screenshot also explains."
Reading a password protected archive by passing a wrong password doesn't notify the user that the password is wrong. Accessing one of the entries in the archive throws a generic "Invalid data" exception. Steps to reproduce: 1. Create a zip file with password. 2. Open the same archive with the API passing wrong password and then try to one of the entries. Observed: InvalidDataException is thrown when trying to read one of the entries in the archive. Expected: The exception should be more meaningful and if possible occur when reading the archive. There should be API allowing to check if the password is correct.