Unplanned
Last Updated: 26 Apr 2024 14:16 by Xiao

This is the code snippet that reproduces the error:

            RadFlowDocument flowDocument = new RadFlowDocument();
            RadFlowDocumentEditor editor = new RadFlowDocumentEditor(flowDocument);
            Bookmark bookmark = new Bookmark(flowDocument, "Name");
            editor.InsertInline(bookmark.BookmarkRangeStart);

            Table table = editor.InsertTable(1, 2);
            TableCell cell1 = table.Rows[0].Cells[0];
            Paragraph cell_paragraph1 = cell1.Blocks.AddParagraph();
            editor.MoveToParagraphStart(cell_paragraph1);
            editor.InsertText("cell content 01");

            TableCell cell2 = table.Rows[0].Cells[1];
            Paragraph cell_paragraph2 = cell2.Blocks.AddParagraph();
            editor.MoveToParagraphStart(cell_paragraph2);
            editor.InsertText("cell content 02");

            editor.MoveToTableEnd(table);
            editor.InsertInline(bookmark.BookmarkRangeEnd); 

            RadFlowDocument newFlowDocument = new RadFlowDocument();
            RadFlowDocumentEditor editor02 = new RadFlowDocumentEditor(newFlowDocument);
            editor.InsertDocument(flowDocument);

Workaround: Insert one bookmark before the table and another one after the table: 

            RadFlowDocument flowDocument = new RadFlowDocument();
            RadFlowDocumentEditor editor = new RadFlowDocumentEditor(flowDocument);
            //Bookmark bookmark = new Bookmark(flowDocument, "Name");
            //editor.InsertInline(bookmark.BookmarkRangeStart);

            editor.InsertBookmark("before");

            Table table = editor.InsertTable(1, 2);
            TableCell cell1 = table.Rows[0].Cells[0];
            Paragraph cell_paragraph1 = cell1.Blocks.AddParagraph();
            editor.MoveToParagraphStart(cell_paragraph1);
            editor.InsertText("cell content 01");

            TableCell cell2 = table.Rows[0].Cells[1];
            Paragraph cell_paragraph2 = cell2.Blocks.AddParagraph();
            editor.MoveToParagraphStart(cell_paragraph2);
            editor.InsertText("cell content 02");

            editor.MoveToTableEnd(table);

            editor.InsertBookmark("after");

            //editor.InsertInline(bookmark.BookmarkRangeEnd); 

            RadFlowDocument newFlowDocument = new RadFlowDocument();
            RadFlowDocumentEditor editor02 = new RadFlowDocumentEditor(newFlowDocument);
            editor.InsertDocument(flowDocument);

 

 

Unplanned
Last Updated: 26 Apr 2024 08:37 by ADMIN

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: 25 Apr 2024 03:00 by David
After successful importing of DOCX with ordered list of TOC, try exporting it to PDF format. 
Unplanned
Last Updated: 24 Apr 2024 12:37 by Jean-Pierre
PdfFormatProvider: NetStandard: Converting multiple XLSX copies to PDF with separate SpreadFixedTextMeasurers generates a different first document. 
Unplanned
Last Updated: 24 Apr 2024 08:05 by Sudhakar

Incorrectly resolved fill between local formatting and cell style.

A fill (fillId) of a cell style (cellStyleXfs) is respected instead of the fill (fillId) of the local formatting (cellXfs).

Unplanned
Last Updated: 19 Apr 2024 08:44 by Noe
Created by: Noe
Comments: 0
Category: SpreadProcessing
Type: Feature Request
1
Add support for R1C1 formula style.
Unplanned
Last Updated: 18 Apr 2024 05:36 by Sujith

This is the code snippet for reproducing the error message: 

        static void Main(string[] args)
        {
            string filePath = "Lorem ipsum dolor sit amet.pdf";
            //load a random document
            PdfFormatProvider provider = new PdfFormatProvider();
            RadFixedDocument originalDocument;
            using (Stream stream = File.OpenRead(filePath))
            {
                originalDocument = provider.Import(stream);
            }
            //draw something on the first page
            FixedContentEditor editor = new FixedContentEditor(originalDocument.Pages[0]);
            editor.GraphicProperties.IsFilled = true;
            editor.GraphicProperties.FillColor = RgbColors.Black;
            Telerik.Documents.Primitives.Rect Rect = new Telerik.Documents.Primitives.Rect(10, 10, 200, 100);
            editor.DrawRectangle(Rect);

            //export the pages as images and build a brand new document from the images
            SkiaImageFormatProvider imageProvider = new SkiaImageFormatProvider();
            imageProvider.ExportSettings.ImageFormat = SkiaImageFormat.Jpeg;
            imageProvider.ExportSettings.ScaleFactor = 0.8;
            imageProvider.ExportSettings.Quality = 80;


            RadFixedDocument doc = new RadFixedDocument();
            foreach (RadFixedPage page in originalDocument.Pages)
            {
                byte[] resultImage = imageProvider.Export(page);
                RadFixedPage pdfpage = doc.Pages.AddPage();
                editor = new FixedContentEditor(pdfpage);
                Stream imageStream = new MemoryStream(resultImage);
                editor.DrawImage(imageStream);
            }

            //export the pdf built from the images
            PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
            string outputPdf = @"output.pdf";
            File.Delete(outputPdf);
            using (Stream output = File.OpenWrite(outputPdf))
            {
                pdfFormatProvider.Export(doc, output);
            }
            Process.Start(new ProcessStartInfo() { FileName = outputPdf, UseShellExecute = true });
        }

Workaround:

        static void Main(string[] args)
        {
            string filePath = "Lorem ipsum dolor sit amet.pdf";
            //load a random document
            PdfFormatProvider provider = new PdfFormatProvider();
            RadFixedDocument originalDocument;
            using (Stream stream = File.OpenRead(filePath))
            {
                originalDocument = provider.Import(stream);
            }
            //draw something on the first page
            FixedContentEditor editor = new FixedContentEditor(originalDocument.Pages[0]);
            editor.GraphicProperties.IsFilled = true;
            editor.GraphicProperties.FillColor = RgbColors.Black;
            Telerik.Documents.Primitives.Rect Rect = new Telerik.Documents.Primitives.Rect(10, 10, 200, 100);
            editor.DrawRectangle(Rect);

            using (Stream output = File.OpenWrite(filePath))
            {
                provider.Export(originalDocument, output);
            }

            using (Stream stream = File.OpenRead(filePath))
            {
                originalDocument = provider.Import(stream);
            }
            //export the pages as images and build a brand new document from the images
            SkiaImageFormatProvider imageProvider = new SkiaImageFormatProvider();
            imageProvider.ExportSettings.ImageFormat = SkiaImageFormat.Jpeg;
            imageProvider.ExportSettings.ScaleFactor = 0.8;
            imageProvider.ExportSettings.Quality = 80;


            RadFixedDocument doc = new RadFixedDocument();
            foreach (RadFixedPage page in originalDocument.Pages)
            {
                byte[] resultImage = imageProvider.Export(page);
                RadFixedPage pdfpage = doc.Pages.AddPage();
                editor = new FixedContentEditor(pdfpage);
                Stream imageStream = new MemoryStream(resultImage);
                editor.DrawImage(imageStream);
            }

            //export the pdf built from the images
            PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
            string outputPdf = @"output.pdf";
            File.Delete(outputPdf);
            using (Stream output = File.OpenWrite(outputPdf))
            {
                pdfFormatProvider.Export(doc, output);
            }
            Process.Start(new ProcessStartInfo() { FileName = outputPdf, UseShellExecute = true });
        }

Unplanned
Last Updated: 17 Apr 2024 12:39 by Nathan
Created by: Nathan
Comments: 0
Category: WordsProcessing
Type: Bug Report
1
PdfFormatProvider: TOC entries are blue.
Unplanned
Last Updated: 17 Apr 2024 12:31 by Nathan
TOC list numbering and page numbering are missing.
Unplanned
Last Updated: 17 Apr 2024 12:18 by Nathan
PdfFormatProvider: TOC page numbering is in Roman instead of Arabic numerals.
Unplanned
Last Updated: 17 Apr 2024 11:56 by Nathan
Calculate TOC page numbering based on page number fields.
Unplanned
Last Updated: 17 Apr 2024 10:24 by Joshua
Created by: Joshua
Comments: 0
Category: SpreadProcessing
Type: Feature Request
1
Make the CsvParser public.
Unplanned
Last Updated: 17 Apr 2024 10:22 by Steve
Created by: Steve
Comments: 0
Category: SpreadProcessing
Type: Feature Request
1
Add support for image cropping (a:srcRect). 
Unplanned
Last Updated: 15 Apr 2024 13:10 by Belma
Created by: Belma
Comments: 0
Category: WordsProcessing
Type: Bug Report
0
Outline color of some shapes is not respected.
Unplanned
Last Updated: 12 Apr 2024 13:53 by ADMIN
Currently, the numbers in a CSV file are parsed as numbers, and the leading zeros are lost. In MS Excel, leading zeros could be preserved when the values are imported as text using the more sophisticated text import wizard (http://www.upenn.edu/computing/da/bo/webi/qna/iv_csvLeadingZeros.html ).

Workaround: The values could be extracted using a third-party (or custom) CSV parser, and inserted manually into the model, using CellSelection.SetValueAsText method (http://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/working-with-cells/cell-value-types.html ).
Unplanned
Last Updated: 10 Apr 2024 14:50 by Daniel
The TOC should include the numbers of headings with a list level.
Unplanned
Last Updated: 10 Apr 2024 14:03 by Benjamin

Use the code for inserting the code:

        static void Main(string[] args)
        {
                      Telerik.Windows.Documents.Flow.Model.RadFlowDocument templateDocument = GetDocument("Template.rtf");
            Telerik.Windows.Documents.Flow.Model.RadFlowDocument contentDocument = GetDocument("Content.rtf");
            InsertDocumentOptions options = new InsertDocumentOptions();
            options.ConflictingStylesResolutionMode = ConflictingStylesResolutionMode.RenameSourceStyle;
            options.InsertLastParagraphMarker = true;

            RadFlowDocumentEditor editor = new RadFlowDocumentEditor(templateDocument);
            editor.InsertDocument(contentDocument, options);

            string mergedDocumentFilePath ="MergeDocumentsWithWordsProcessing.rtf";
            File.Delete(mergedDocumentFilePath);
            WriteDocToFile(templateDocument, mergedDocumentFilePath);

        }
        private static Telerik.Windows.Documents.Flow.Model.RadFlowDocument GetDocument(string rtfFilePath)
        {
            Telerik.Windows.Documents.Flow.Model.RadFlowDocument document = null;
            var rtfImporter = new Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider();
            using (Stream stream = File.OpenRead(rtfFilePath))
            {
                document = rtfImporter.Import(stream);
            }
            return document;
        }


        private static void WriteDocToFile(Telerik.Windows.Documents.Flow.Model.RadFlowDocument doc, string filename)
        {
            var rtfExporter = new Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider();
            string rtfText = rtfExporter.Export(doc);
            File.WriteAllText(filename, rtfText);

            Process.Start(filename);
        }

Observed result: The After spacing is reset

Expected result: keep the style settings from the original documents.

Unplanned
Last Updated: 08 Apr 2024 12:03 by ADMIN

NumberedHierarchical list type has inconsistent indentation after bullets.

Unplanned
Last Updated: 05 Apr 2024 10:36 by Vandana
Created by: Vandana
Comments: 0
Category: SpreadProcessing
Type: Feature Request
0
Provide support for content controls
Unplanned
Last Updated: 03 Apr 2024 06:05 by ADMIN

When exporting a document with the .NET Framework implementation, only subsets of the used fonts are embedded in the document.

1 2 3 4 5 6