Unplanned
Last Updated: 23 Jun 2025 13:16 by ADMIN

When converting HTML to DOCX, margins set on an HTML element are ignored. These styles are exported correctly when the HTML passed to the converter is formatted with indents. The following XUnit test demonstrates this behavior with a simplified example.

using Telerik.Windows.Documents.Flow.FormatProviders.Docx;
using Telerik.Windows.Documents.Flow.FormatProviders.Html;

namespace MSPI.Tests.Unit;

public class WordExportTest
{
    [Fact]
    public async Task TextExport()
    {
        const string formattedDocumentSavePath = @"C:\Testing\export-test-formatted.docx";
        const string formattedContent = """"
            <p>Test paragraph</p>
            <ol style="margin-left: 100px;">
                <li>Item 1</li>
                <li>Item 2</li>
            </ol>
        """";

        const string minifiedDocumentSavePath = @"C:\Testing\export-test-minified.docx";
        const string minifiedContent = """"<p>Test paragraph</p><ol style="margin-left: 100px;"><li>Item 1</li><li>Item 2</li></ol>"""";

        var htmlFormatProvider = new HtmlFormatProvider();
        var docxFormatProvider = new DocxFormatProvider();

        await using var minifiedDocumentMemoryStream = new MemoryStream();
        var minifiedRadFlowDocument = htmlFormatProvider.Import(minifiedContent, TimeSpan.FromSeconds(30));
        docxFormatProvider.Export(minifiedRadFlowDocument, minifiedDocumentMemoryStream, TimeSpan.FromSeconds(30));
        var minifiedBytes = minifiedDocumentMemoryStream.ToArray();
        await File.WriteAllBytesAsync(minifiedDocumentSavePath, minifiedBytes);

        await using var formattedDocumentMemoryStream = new MemoryStream();
        var formattedRadFlowDocument = htmlFormatProvider.Import(formattedContent, TimeSpan.FromSeconds(30));
        docxFormatProvider.Export(formattedRadFlowDocument, formattedDocumentMemoryStream, TimeSpan.FromSeconds(30));
        var formattedBytes = formattedDocumentMemoryStream.ToArray();
        await File.WriteAllBytesAsync(formattedDocumentSavePath, formattedBytes);
    }
}

The minified HTML produces the following document:

The formatted HTML produces the following document:

 

Unplanned
Last Updated: 20 Jun 2025 08:33 by Michael
Created by: Michael
Comments: 0
Category: PdfProcessing
Type: Bug Report
0
Import-export changes the color of the shading object.
Completed
Last Updated: 17 Jun 2025 07:19 by ADMIN
Release 2025.2.520 (2025 Q2)
This is a sample code to replicate the error which is triggered on export: 
            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 });
Unplanned
Last Updated: 17 Jun 2025 07:09 by ADMIN

Read the documentation for CancelationTokenSource.CancelAfter:

this method will throw an ArgumentOutOfRangeException when: delay.TotalMilliseconds is less than -1 or greater than Int32.MaxValue (or UInt32.MaxValue - 1 on some versions of .NET). Note that this upper bound is more restrictive than TimeSpan.MaxValue.

----------------------------------------------------

your code in CancelationTokenSourceFactory.CreateTokenSource does this check:

if (timeSpan.HasValue && timeSpan.Value != TimeSpan.MaxValue)

this check for TimeSpan.MaxValue seems totally pointless here, if timeSpan is anything between ~2147483647 and 922337203685476 milliseconds long this will still just throw a ArgumentOutOfRangeException.

I suspect that this check was intended as a way to prevent creating a cancellation timer that never triggers in the CancellationTokenSource, which should look like this:

if (timeSpan.HasValue && timeSpan != Timeout.InfiniteTimeSpan) //Timeout.InfiniteTimeSpan is -1 milliseconds
which still seems like premature optimization with no noticeable benefit but at least it isn't completely pointless.
In Development
Last Updated: 13 Jun 2025 13:54 by ADMIN
Unplanned
Last Updated: 09 Jun 2025 10:20 by Heidi

NullReferenceException when inserting a document containing a table with a document variable having a line break (\n) in its value.

In Development
Last Updated: 06 Jun 2025 07:10 by ADMIN
Wrong clipping order when exporting a document with MarkedContent leads to a missing content.
Unplanned
Last Updated: 05 Jun 2025 11:46 by ADMIN
Add API that allows one to manipulate the macros inside a Workbook.
Unplanned
Last Updated: 04 Jun 2025 12:33 by Sailaja
Stacktrace: 
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
   at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
   at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Model.Elements.Worksheets.ConditionalFormattingRuleElementX14.OnAfterRead(IXlsxWorksheetImportContext context) in C:\Work\document-processing\Documents\Spreadsheet\FormatProviders\OpenXml\Xlsx\Model\Elements\Worksheets\ConditionalFormatting\x14\ConditionalFormattingRuleElementX14.cs:line 62
Unplanned
Last Updated: 27 May 2025 11:03 by Thomas
PdfProcessing: ArgumentException is thrown when importing a document with a duplicated filed names.
Unplanned
Last Updated: 26 May 2025 12:28 by ADMIN
Completed
Last Updated: 22 May 2025 14:26 by Diego
Release 2025.2.520 (2025 Q2)
Wrong font loading when FontFile2 is CFF (Compact Font Format).
Completed
Last Updated: 22 May 2025 13:37 by ADMIN
Release 2025.2.520 (2025 Q2)
ArgumentOutOfRangeException is thrown when creating a CapPathRound for an SVG element.
Completed
Last Updated: 22 May 2025 13:37 by ADMIN
Release 2025.2.520 (2025 Q2)
Exporting a specific PDF file generates large amounts of ExtGState entries, which results in large file sizes.
Completed
Last Updated: 22 May 2025 13:37 by ADMIN
Release 2025.2.520 (2025 Q2)
Example: 
16 0 obj
<</AP<</N<</Off null/On 188 0 R>>/D<</Off 189 0 R/On 190 0 R>>>>/AS/Off/F 4/FT/Btn/H/T/P 19 0 R/Rect[ 40.3 690.45 56.15 706.7999]/Subtype/Widget/T(Einraeumung:Grabnutzungsrechts)/Type/Annot>>
endobj

 
Completed
Last Updated: 22 May 2025 13:37 by ADMIN
Release 2025.2.520 (2025 Q2)
This is not a valid scenario, but Adobe Acrobat handles it and we should too. 
Completed
Last Updated: 22 May 2025 13:37 by ADMIN
Release 2025.2.520 (2025 Q2)
InvalidCastException is thrown when importing a document with an annotation declared in the Fields collection.
Completed
Last Updated: 22 May 2025 13:37 by ADMIN
Release 2025.2.520 (2025 Q2)
NotImplementedException is thrown for the SvgFontDefn's MeasureCharacters method.
Completed
Last Updated: 22 May 2025 13:37 by ADMIN
Release 2025.2.520 (2025 Q2)
Created by: Jan Brandenburger
Comments: 0
Category: Telerik Document Processing
Type: Bug Report
1
When the image passed to the GetAllTextFromImage() method doesn't have any text in it, a NullReferenceException is thrown. The expected behaviour should be to return a null or empty string.
Completed
Last Updated: 22 May 2025 13:37 by ADMIN
Release 2025.2.520 (2025 Q2)
The case is invalid according to the specification but all readers manage to open the document and allow editing its fields. The document can be also opened in RadPdfViewer but without the fields and the widgets.
1 2 3 4 5 6