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

Completed
Last Updated: 14 Mar 2024 09:00 by ADMIN
Release 2024.1.305 (2024 Q1)
This exception was originally thrown at this call stack:
    Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.DocumentCatalog.CopyEmbeddedFilesTo(Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.Parser.PostScriptReader, Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.IRadFixedDocumentImportContext) in DocumentCatalog.cs
Completed
Last Updated: 14 Mar 2024 09:00 by ADMIN
Release 2024.1.305 (2024 Q1)

A strange symbol is added as a name when embedding a file with an empty string as its name argument.

Image

Completed
Last Updated: 14 Mar 2024 09:00 by ADMIN
Release 2024.1.305 (2024 Q1)

Some fonts don't include bold and italic font styles. These fonts can be exported with the default typeface, and additional transformation could be applied to the letters itself - e.g. skew transform for the italic.

Note: Make sure that this will also work when exporting to PDF in WordsProcessing.
Completed
Last Updated: 14 Mar 2024 09:00 by ADMIN
Release 2024.1.305 (2024 Q1)
For example exporting the text "\uD83D\uDE0A" with "Segoe UI Symbol" font family should export a single smiling face. Instead the characters are skipped during the export as PdfProcessing is trying to export them as separate char values ("\uD83D" and "\uDE0A") and the font does not contain glyphs corresponding to these char codes.
Completed
Last Updated: 14 Mar 2024 09:00 by ADMIN
Release 2024.1.305 (2024 Q1)
Wrong glyph measurement results in overlapping text.
Completed
Last Updated: 14 Mar 2024 08:59 by ADMIN
Release 2024.1.305 (2024 Q1)
HtmlFormatProvider: Paragraph property AutomaticSpacingBefore is set to true instead of false.
Completed
Last Updated: 14 Mar 2024 08:59 by ADMIN
Release 2024.1.305 (2024 Q1)

StackOverflowException when importing a document with style based on itself.

Use the following code to strip the faulty "based on" definition from the RTF:

RtfFormatProvider provider = new RtfFormatProvider();
var rtf = File.ReadAllText(ofd.FileName);
rtf = this.ReplaceSelfBasedOnStyle(rtf);
this.flowDocument = provider.Import(rtf);

...

private string ReplaceSelfBasedOnStyle(string rtf)
{
    string pattern = @"{[\n]*\\s[0-9]+[^;]* \\\w* (Normal);}";

    var matches = Regex.Matches(rtf, pattern);
    foreach (Match match in matches)
    {
        string oldValue = match.Value;
        string newValue = oldValue.Replace(@"\sbasedon0 ", string.Empty);

        rtf = rtf.Replace(oldValue, newValue);
    }

    return rtf;
}

Completed
Last Updated: 14 Mar 2024 08:59 by ADMIN
Release 2024.1.305 (2024 Q1)
ADMIN
Created by: Deyan
Comments: 2
Category: ZipLibrary
Type: Feature Request
15

Add support for the creation of AES-encrypted archives.

There is a related feature request for the extraction of such archives: ZipLibrary: Add support for extraction of AES-encrypted archives.

Completed
Last Updated: 14 Mar 2024 08:59 by ADMIN
Release 2024.1.305 (2024 Q1)

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

The settings used for decrypting the file don't seem to be used encrypting again after the update operation. Here is a sample code snippet for reproducing the error message:

    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

Completed
Last Updated: 14 Mar 2024 08:59 by ADMIN
Release 2024.1.305 (2024 Q1)

The stream that is internally created by the CreateFromDirectory method remains opened and the user can't close it:

This is error message observed when using the below code snippet:

The process cannot access the file 'C:\Users\dyordano\OneDrive - Progress Software Corporation\MyProjects\1640071ZipFileCreateFromDirectory\myzip.zip' because it is being used by another process.

        static void Main(string[] args)
        {
            string archiveFileName = @"..\..\myzip.zip";
            string sourceDirectoryName = @"..\..\Folder";
            File.Delete(archiveFileName);
            Telerik.Windows.Zip.Extensions.ZipFile.CreateFromDirectory(sourceDirectoryName, archiveFileName, Telerik.Windows.Zip.CompressionLevel.Optimal, true);

            using (Stream stream = File.Open(archiveFileName, FileMode.Open))
            {

            }
        }

Workaround: 

        static void Main(string[] args)
        {
            string archiveFileName = @"..\..\myzip.zip";
            string sourceDirectoryName = @"..\..\Folder";
            File.Delete(archiveFileName);

          //  Telerik.Windows.Zip.Extensions.ZipFile.CreateFromDirectory(sourceDirectoryName, archiveFileName, Telerik.Windows.Zip.CompressionLevel.Optimal, true);
            CreateFromDirectory(sourceDirectoryName, archiveFileName, Telerik.Windows.Zip.CompressionLevel.Optimal, true);

            using (Stream stream = File.Open(archiveFileName, FileMode.Open))
            {

            }
        }

        private static void CreateFromDirectory(string sourceDirectoryName, string destinationArchiveFileName, Telerik.Windows.Zip.CompressionLevel compressionLevel, bool includeBaseDirectory)
        {
            Encoding entryNameEncoding = null;
            DeflateSettings compressionSettings = new DeflateSettings()
            {
                CompressionLevel = compressionLevel,
                HeaderType = CompressedStreamHeader.None
            };
            char[] directorySeparatorChar = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };

            sourceDirectoryName = Path.GetFullPath(sourceDirectoryName);
            destinationArchiveFileName = Path.GetFullPath(destinationArchiveFileName);
            FileStream fileStream = File.Open(destinationArchiveFileName, FileMode.CreateNew, FileAccess.Write, FileShare.None); ;
            using (ZipArchive zipArchive = new ZipArchive(fileStream, ZipArchiveMode.Create,false,  entryNameEncoding))
            {
                bool empty = true;

                DirectoryInfo directoryInfo = new DirectoryInfo(sourceDirectoryName);
                string fullName = directoryInfo.FullName;
                if (includeBaseDirectory && directoryInfo.Parent != null)
                {
                    fullName = directoryInfo.Parent.FullName;
                }

                foreach (FileSystemInfo fileSystemInfo in directoryInfo.EnumerateFileSystemInfos("*", SearchOption.AllDirectories))
                {
                    empty = false;

                    int length = fileSystemInfo.FullName.Length - fullName.Length;
                    string entryName = fileSystemInfo.FullName.Substring(fullName.Length, length);
                    entryName = entryName.TrimStart(directorySeparatorChar);

                    DirectoryInfo subfolder = fileSystemInfo as DirectoryInfo;
                    if (subfolder != null)
                    {
                        if (IsDirectoryEmpty(subfolder))
                        {
                            zipArchive.CreateEntry(string.Concat(entryName, Path.DirectorySeparatorChar));
                        }
                    }
                    else
                    {
                        ZipFile.CreateEntryFromFile(zipArchive, fileSystemInfo.FullName, entryName, compressionSettings);
                    }
                }

                if (includeBaseDirectory && empty)
                {
                    zipArchive.CreateEntry(string.Concat(directoryInfo.Name, Path.DirectorySeparatorChar));
                }
            }
        }
        private static bool IsDirectoryEmpty(DirectoryInfo directoryInfo)
        {
            bool empty = true;

            using (IEnumerator<FileSystemInfo> enumerator = directoryInfo.EnumerateFileSystemInfos("*", SearchOption.AllDirectories).GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    empty = false;
                }
            }

            return empty;
        }

Note: We should ensure that all of the obsolete API that used to use the "leave open" flag don't keep the stream locked.

 

1 2 3 4 5 6