In Development
Last Updated: 28 Mar 2024 12:22 by ADMIN

A page with a negative value rotation is exported as a blank image.

Workaround: Use only the Enum Rotation values (Rotate0, Rotate90, Rotate180, Rotate270).

In Development
Last Updated: 27 Mar 2024 17:41 by ADMIN
When parsing a CFF Type1 font a NullReferenceException is thrown.
Unplanned
Last Updated: 22 Mar 2024 05:43 by ADMIN
ADMIN
Created by: Tanya
Comments: 2
Category: PdfProcessing
Type: Feature Request
13
RadPdfProcessing currently supports interactive forms whose data is defined directly in the document. Add support for interactive forms based on the Adobe XML Forms Architecture (XFA). The entry is defined inside the interactive forms dictionary and refers to an XML stream containing the information of the form. More information is available on page 722 from Pdf Reference, version 1.7.
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.

 

Completed
Last Updated: 21 Mar 2024 05:53 by ADMIN
Release 2024.1.305 (2024 Q1)

Handle import of documents with self-referring styles.

As a workaround, you can go through the RTF document structure of a single file and utilize Regex to resolve the self-referring styles like this:

string rtf = File.ReadAllText("inputFile.rtf");
rtf = FixSelfReferringStyles(rtf);

Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider provider = new Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider(); 

 var document = provider.Import(rtf);

...

private static string FixSelfReferringStyles(string rtf)
{
    string regexString = @"{\\s([0-9]+)[^}]*\\slink([0-9]+)";

    var matches = Regex.Matches(rtf, regexString);
    foreach (Match match in matches)
    {
        if (match.Groups[1].Value == match.Groups[2].Value)
        {
            var oldValue = match.Groups[0].Value;
            var newValue = oldValue.Replace(@" \slink" + match.Groups[1].Value, string.Empty);
            rtf = rtf.Replace(oldValue, newValue);
        }
    }

    return rtf;
}

 

Completed
Last Updated: 21 Mar 2024 05:53 by ADMIN
Release 2024.1.305 (2024 Q1)

Styles with names only different in spaces are treated as one.

Workaround:

var rtf = File.ReadAllText(fileName);
rtf = this.RenameStyleDifferentInOnlySpaces(rtf);
var document = provider.Import(rtf);

...

private string RenameStyleDifferentInOnlySpaces(string rtf)
{
    HashSet<string> styles = new HashSet<string>();

    string pattern = @"{\\(?:\*\\c)?s([0-9]+)[^}]*\n?[^}]*\\[^' ]* ?'?([^;]*)";

    var matches = Regex.Matches(rtf, pattern);
    foreach (Match match in matches)
    {
        string styleName = match.Groups[2].Value.Replace(" ", string.Empty);
        if (styles.Contains(styleName))
        {
            styleName = this.ReplaceOldStyleName(ref rtf, styles, match).Replace(" ", string.Empty);
        }

        styles.Add(styleName);
    }

    return rtf;
}

private string ReplaceOldStyleName(ref string rtf, HashSet<string> styles, Match match)
{
    string oldStyleName = match.Groups[2].Value;
    StringBuilder styleNameBuilder = new StringBuilder(oldStyleName + "0");
    while (styles.Contains(styleNameBuilder.ToString().Replace(" ", string.Empty)))
    {
        styleNameBuilder.Append("0");
    }

    string oldMatch = match.Groups[0].Value;
    string newMatch = oldMatch.Replace(oldStyleName, styleNameBuilder.ToString());
    rtf = rtf.Replace(oldMatch, newMatch);
    return styleNameBuilder.ToString();
}

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);

In Development
Last Updated: 20 Mar 2024 08:55 by ADMIN
Wrong sheet name in exception message when adding sheet with already existing name
Unplanned
Last Updated: 19 Mar 2024 12:12 by ADMIN
ADMIN
Created by: Tanya
Comments: 2
Category: WordsProcessing
Type: Feature Request
10
There are 27 types of border styles in the Open XML specification and they are implemented in RadFlowDocument. Only borders None and Single are supported when exporting to PDF, all others are treated as None and stripped.
In Development
Last Updated: 19 Mar 2024 09:08 by ADMIN
In scenarios with negative font and/or negative horizontal scaling the text is not rendered correctly.
In Development
Last Updated: 18 Mar 2024 17:16 by ADMIN

If  row has a property set on it (for example "hidden" or a style), but it does not otherwise have any cells in it, the application might run into an infinite loop. The xml will look like this:

	<sheetData>
		<row r="1" spans="1:2" x14ac:dyDescent="0.35">
			<c r="A1"><v>1</v></c>
			<c r="B1"><v>2</v></c>
		</row>
		<row r="2" spans="1:2" s="1" customFormat="1" x14ac:dyDescent="0.35"/>
	</sheetData>

The last row has formatting applied, so it is present as an element, but has no cells. This file (when the xml is not formatted) will cause an infinite loop on import.

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)
In Development
Last Updated: 15 Mar 2024 16:26 by ADMIN
The text in the footer remains under the image while drawing the PDF content.
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: 14 Mar 2024 10:40 by Ye
Created by: Ye
Comments: 0
Category: SpreadProcessing
Type: Feature Request
0
Completed
Last Updated: 14 Mar 2024 09:00 by ADMIN
Release 2024.1.305 (2024 Q1)

Merge two documents (use the attached ones) that already have embedded files with the same names.

Observed: 

Image

Completed
Last Updated: 14 Mar 2024 09:00 by ADMIN
Release 2024.1.305 (2024 Q1)
The import action is successful, but then exporting the document throws the following exception: 
   at Telerik.Windows.Documents.Core.Fonts.Type1.Type1Format.Type1FontSource.GetFontFamily()
Completed
Last Updated: 14 Mar 2024 09:00 by ADMIN
Release 2024.1.305 (2024 Q1)

Hi there I have a pdf and whenever I try to Import the PDF file into PdfFormatProvider.Import method for flattening purposes, it throws null reference exception.

I have added a sample .net project with PDF added as source. You just need to run the project on your end. I am using version 2023.3.1106 of document processing library.

I am using ASP.NET 4.8 framework.

Thanks

1 2 3 4 5 6