Error message:
System.InvalidCastException: 'Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Forms.FormFieldsTree' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfArray'.'Error message:
System.InvalidCastException: 'Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfArray' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Functions.FunctionObject'.'Import a document that contains a picture content control and the following error occurs:
Telerik.Windows.Documents.Flow.Model.Annotations.StructuredDocumentTags.Builders.SdtBuilderFailureException: 'Picture control cannot be used in selection that contains any non-image content, or more than a single image.'
PdfFormatProvider provider =
new
PdfFormatProvider();
Multiple CSS classes on an element are not correctly resolved when converted to inline styles.
Before:
.TelerikNormal {font-family: Calibri;font-size: 14.6666666666667px;margin-top: 0px;margin-bottom: 0px;line-height: 100%;color: #000000;}
.TelerikHeading3 {font-family: Calibri Light;font-size: 22.6666666666667px;}
<p class="TelerikNormal TelerikHeading3"><span>Test</span></p>
Due to order priority, the TelerikHeading3 values override the TelerikNormal values. The font-size becomes 22.6666666666667px.
Convert:
provider.ExportSettings.StylesExportMode = StylesExportMode.Inline;
<p style="font-family: Calibri;font-size: 14.6666666666667px;margin-top: 0px;margin-bottom: 0px;line-height: 100%;color: #000000;"><span>Test</span></p>
When the worksheet contains fraction numbers with fractional parts > 0.5 and < 0.5 and both these numbers have fraction format applied, the number with fractional part < 0.5 will have incorrect whole part.
When a document has a deleted text as part of track changes and there is a comment on the deletion, the document throws InvalidOperationException upon import.
Incorrect timestamp of a DateTime with custom number format.
Expected:
Actual:
string inputFileName = "input.xlsx";
if (!File.Exists(inputFileName))
{
throw new FileNotFoundException(String.Format("File {0} was not found!", inputFileName));
}
Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook;
IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
using (Stream input = new FileStream(inputFileName, FileMode.Open))
{
workbook = formatProvider.Import(input, TimeSpan.MaxValue);
}
string outputFilePath = "output.xlsx";
using (Stream output = new FileStream(outputFilePath, FileMode.Create))
{
formatProvider.Export(workbook, output, TimeSpan.MaxValue);
}
Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });