Unplanned
Last Updated: 21 Mar 2024 07:45 by Dmytro

When calling a PDF export in a high-concurrency environment the internal state can get corrupted because it uses a non-thread safe collection internally.

Sample code:

void WriteToPdf(RadFlowDocument document, Stream outputStream) {

   PdfFormatProvider pdfWriter = new() {};

   pdfWriter.Export(document, outputStream);
}

When calling it like this:

Parallel.ForEachAsync(listOfDocuments, (document, _) => {
   WriteToPdf(document, Stream.Null);
});

An exception may occur:

System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
   at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
   at Telerik.Windows.Documents.Fixed.Model.Fonts.FontsRepository.TryCreateFont(FontFamily fontFamily, FontStyle fontStyle, FontWeight fontWeight, FontBase& font)
   at Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Utils.Extensions.CopyPropertiesFrom(CharacterProperties fixedProperties, PdfExportContext context, CharacterProperties properties)
   at Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExporter.CreateListLevel(ListLevel flowLevel)
   at Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExporter.CreateList(List flowList)
   at Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExporter.ExportDocument(RadFlowDocument document, RadFixedDocumentEditor editor)
   at Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExporter.ExportInternal()
   at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Export(T document, Stream output)
   at xxxxx.Application.Common.PdfGeneration.PdfWriter.WriteToPdf(RadFlowDocument document, Stream outputStream) 

The state is then corrupted forever, until the application is restarted.

Realistic scenario where this is also reproduced: Web application that generates PDFs and is called concurrently.

 

Unplanned
Last Updated: 20 Mar 2024 12:49 by Göran

Use the below code snippet to generate XLSX document and export it. You will notice that the export operation is extremely slow:

Stopwatch sw = new Stopwatch();
sw.Start();
IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add();
Worksheet worksheet2 = workbook.Worksheets.Add();
worksheet2.Name ="Days";
List<string> weekdays = new List<string>() { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
for (int i = 0; i < 7; i++)
{
    worksheet2.Cells[0, i].SetValue(weekdays[i]);
}

for (int i = 0; i < 200; i++)
{
    for (int j = 0; j < 10; j++)
    {

        CellIndex cellIndex = new CellIndex(i, j);
        CellSelection selection = worksheet.Cells[cellIndex];
        selection.SetValue("Wednesday");

        var context = new ListDataValidationRuleContext(worksheet, cellIndex)
        {
            InputMessageTitle = "InputMessageTitle",
            InputMessageContent = "InputMessageTitle"
        };

        context.ErrorStyle = ErrorStyle.Stop;
        context.ErrorAlertTitle = "ErrorAlertTitle";
        context.ErrorAlertContent = "ErrorAlertContent";
        context.InCellDropdown = true;
        context.Argument1 = "=Days!A0:A6"; //"Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday";
        ListDataValidationRule rule = new(context);
        worksheet.Cells[cellIndex].SetDataValidationRule(rule);
    }
}

string outputFile = @"..\..\..\output.xlsx";
File.Delete(outputFile);

using (Stream output = new FileStream(outputFile, FileMode.Create))
{

    formatProvider.Export(workbook, output);
}
sw.Stop();
Debug.WriteLine("Export " + sw.ElapsedMilliseconds);

Unplanned
Last Updated: 18 Mar 2024 08:00 by ADMIN
When importing an xlsx document with a comment that does not have an author, an exception is thrown "Sequence contains no matching element" Note that this is a different bug from the very similar SpreadProcessing: Exception "Sequence contains no matching element" thrown in files containing notes or comments (telerik.com)
Unplanned
Last Updated: 15 Mar 2024 15:42 by XicoFininho
The attached gif file illustrates the inability to open the newly added file with the password: 
    Sub Main()
        Dim sZipFilePath As String = "..\..\test.zip"
        File.Delete(sZipFilePath)

        CreateArchive(sZipFilePath)
        Dim decryptionSettings As DecryptionSettings = EncryptionSettings.CreateDecryptionSettings()
        AddHandler decryptionSettings.PasswordRequired, AddressOf DecryptionSettings_PasswordRequired
        Dim compressionSettings As CompressionSettings = Nothing
        Dim encoding As Encoding = Nothing
        Using oFS As FileStream = File.Open(sZipFilePath, FileMode.OpenOrCreate)


            Using oArchive As ZipArchive = ZipArchive.Update(oFS, encoding, compressionSettings, decryptionSettings)
                Using entry As ZipArchiveEntry = oArchive.CreateEntry("newText.txt")
                    Dim writer As StreamWriter = New StreamWriter(entry.Open())
                    writer.WriteLine("Hello world!")
                    writer.Flush()
                End Using
            End Using
        End Using
    End Sub

    Private Sub CreateArchive(sZipFilePath As String)
        Using stream As Stream = File.Open(sZipFilePath, FileMode.Create)
            Dim _encryptionSettings As PasswordEncryptionSettings = EncryptionSettings.CreatePkzipPasswordEncryptionSettings()
            _encryptionSettings.Password = "telerik"
            Dim compressionSettings As CompressionSettings = Nothing
            Dim encoding As Encoding = Nothing

            Using archive As ZipArchive = ZipArchive.Create(stream, encoding, compressionSettings, _encryptionSettings)

                Using entry As ZipArchiveEntry = archive.CreateEntry("text.txt")
                    Dim writer As StreamWriter = New StreamWriter(entry.Open())
                    writer.WriteLine("Hello world!")
                    writer.Flush()
                End Using
            End Using
        End Using
    End Sub

    Private Sub DecryptionSettings_PasswordRequired(ByVal sender As Object, ByVal e As PasswordRequiredEventArgs)
        e.Password = "telerik"
    End Sub
Unplanned
Last Updated: 15 Mar 2024 11:54 by ADMIN
ADMIN
Created by: Peshito
Comments: 5
Category: WordsProcessing
Type: Bug Report
4

List indent is not correct when exported to PDF. All indents start from the same position.

Unplanned
Last Updated: 15 Mar 2024 07:50 by XicoFininho

Steps to reproduce:

1.Create a zip archive for a txt file with password protection

2. Try updating the protected file and insert a new text line for example.


As a result,  an error occurs: System.ObjectDisposedException: 'Cannot access a closed Stream.'

 
Imports System.IO
Imports System.Text
Imports Telerik.Windows.Zip

Module Module1

    Sub Main()
        Dim sZipFilePath As String = "..\..\test.zip"
        File.Delete(sZipFilePath)

        CreateArchive(sZipFilePath)

        Dim decryptionSettings As DecryptionSettings = EncryptionSettings.CreateDecryptionSettings()
        AddHandler decryptionSettings.PasswordRequired, AddressOf DecryptionSettings_PasswordRequired
        Dim compressionSettings As CompressionSettings = Nothing
        Dim encoding As Encoding = Nothing
        Using oFS As FileStream = File.Open(sZipFilePath, FileMode.OpenOrCreate)


            Using oArchive As ZipArchive = ZipArchive.Update(oFS, encoding, compressionSettings, decryptionSettings)
                For Each entry As ZipArchiveEntry In oArchive.Entries
                    Using entryStream As Stream = entry.Open()
                        Dim reader As New StreamReader(entryStream)
                        Dim content As String = reader.ReadToEnd()

                        entryStream.Seek(0, SeekOrigin.End)
                        Dim writer As New StreamWriter(entryStream)
                        writer.WriteLine("Updated line.")
                        writer.Flush()
                    End Using
                Next
            End Using
        End Using
    End Sub

    Private Sub CreateArchive(sZipFilePath As String)
        Using stream As Stream = File.Open(sZipFilePath, FileMode.Create)
            Dim encryptionSettings As PasswordEncryptionSettings = encryptionSettings.CreatePkzipPasswordEncryptionSettings()
            encryptionSettings.Password = "MyPassword"
            Dim compressionSettings As CompressionSettings = Nothing
            Dim encoding As Encoding = Nothing

            Using archive As ZipArchive = ZipArchive.Create(stream, encoding, compressionSettings, encryptionSettings)

                Using entry As ZipArchiveEntry = archive.CreateEntry("text.txt")
                    Dim writer As StreamWriter = New StreamWriter(entry.Open())
                    writer.WriteLine("Hello world!")
                    writer.Flush()
                End Using
            End Using
        End Using
    End Sub

    Private Sub DecryptionSettings_PasswordRequired(ByVal sender As Object, ByVal e As PasswordRequiredEventArgs)
        e.Password = "MyPassword"
    End Sub

End Module
Unplanned
Last Updated: 12 Mar 2024 13:50 by Stefan

Import the following HTML content:

<ol type="a">
<li>
<div><p>WordsProcessing</p>
</div></li>
<li>
<div>
<p>SpreadProcessing</p>
</div>
</li>
<li>
<div>
<p>PdfProcessing</p>
</div>
</li>
</ol>

The following error occurs:

Unplanned
Last Updated: 11 Mar 2024 16:06 by Foxy
Exporting a PDF documents with 2 pages (that are big images) is slow as hell & consuming way too much memory. (for a 2MiB file, over 2GiB!!!)
Unplanned
Last Updated: 11 Mar 2024 13:20 by ADMIN
This happens only on import, that is, if the values are created through UI or through the model, it does not happen. A sheet has a formula A which depends on a cell B and this cell also has a reference to another cell C and the formula A is so placed in the sheet so that it will be imported before cell B. When cell C is updated, the value in A will not be recalculated.
Unplanned
Last Updated: 11 Mar 2024 10:18 by Albert

Import an XLSX document and auto-fit the columns. Then, export the document to XLSX format.

Even though a SpreadFixedTextMeasurer is applied and a FontProvider is implemented, the columns are not wide enough to fit the content:

 

Unplanned
Last Updated: 08 Mar 2024 06:47 by Joe
When extracting zip archives that contain empty folders with 7zip an error message occurs: "Headers Error"

Unplanned
Last Updated: 04 Mar 2024 11:55 by Jolly
Unplanned
Last Updated: 27 Feb 2024 13:41 by Jagadish

PdfFormatProvider: Table cells are exported with the wrong width when the table is nested in another table and the cells of the nested one have a preferred width set to 100%.

Workaround: Clear the cell PreferredWidth property.

Unplanned
Last Updated: 22 Feb 2024 19:28 by Marcelo
If the conditional formatting is missing, the copy operation is executed with no errors.
Unplanned
Last Updated: 21 Feb 2024 14:19 by Fritz

Incorrect calculation of UsedCellRange when conditional formatting is applied to a large cell range.

Workaround:

var usedCellRange = workbook.ActiveWorksheet.GetUsedCellRange(
    CellPropertyDefinitions.AllPropertyDefinitions
    .Except(
        CellPropertyDefinitions.AllPropertyDefinitions.Where(p => p.Name == "DataValidationRule" || p.Name == "ConditionalFormatting")));

 

Unplanned
Last Updated: 21 Feb 2024 10:23 by n/a
PdfFormatProvider: Endless loop when exporting a document with specific floating image.
Unplanned
Last Updated: 20 Feb 2024 11:17 by ADMIN
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.
Unplanned
Last Updated: 20 Feb 2024 09:07 by Lleonard
Empty cell of an unprotected column remains protected if it has a format set to it.
Unplanned
Last Updated: 12 Feb 2024 10:56 by Uwe

PdfFormatProvider: Tab stop distance different from the default is not exported correctly.

Workaround: Use spaces instead.

1 2 3 4 5 6