In Development
Last Updated: 10 Jan 2025 13:00 by ADMIN

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

In Development
Last Updated: 10 Jan 2025 12:24 by ADMIN

Some documents loaded through WordsProcessing and then exported to a RadFixedDocument by utilizing the ExportToFixedDocument() method, fails on export through ImageFormatProvider with System.AggregateException.

As a workaround, you can export the RadFixedDocument to a PDF and then import it again before exporting it to an image.

var pdfFixedProvider = new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider();
bytes = pdfFixedProvider.Export(fixedDocument);
fixedDocument = pdfFixedProvider.Import(bytes);

 

In Development
Last Updated: 06 Jan 2025 09:20 by ADMIN
After merging documents with PdfStreamWriter the JavaScript actions are broken and not working.
In Development
Last Updated: 06 Jan 2025 07:17 by ADMIN
NullReferenceException has thrown when importing a form XObject with null Resources in PDF dictionary.
In Development
Last Updated: 03 Jan 2025 16:54 by ADMIN

An ArgumentNullException is thrown when importing a document with a missing required MediaBox operator in the Page object ("ArgumentNullException: 'Value cannot be null.")

In Development
Last Updated: 03 Jan 2025 15:08 by ADMIN
 InvalidCastException when importing a file with missing space. The file contains no space between the objects declarations and the page content and this is why the exception occurs.
In Development
Last Updated: 03 Jan 2025 15:08 by ADMIN

When importing a document with a missing state separator (e.g. linefeed) in the object stream (ObjStm) an exception is thrown: System.InvalidCastException: 'Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfDictionary' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfInt'.'

А possible workaround could be handling the exceptions: Handling Exceptions.

In Development
Last Updated: 03 Jan 2025 13:47 by ADMIN
ArgumentNullException is thrown when importing a document with missing indirect reference object.
In Development
Last Updated: 03 Jan 2025 13:33 by ADMIN
When importing a document, the following error message is observed when reading the Arial, Italic font: System.InvalidCastException: 'Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfLiteralString' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfName'.'
In Development
Last Updated: 02 Jan 2025 13:21 by ADMIN

If I simply import the xls file with the XlsFormatProvider that RadSpreadProcessing offers and then export it either to xls or xlsx format, the following message pops up when opening the document in MS Excel:

The exported XLS or XLSX file with RadSpreadProcessing contains an additional <definedName>: 

<?xml version="1.0" encoding="utf-8"?>
<workbook xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
	<sheets>
		<sheet sheetId="1" name="Sheet1" state="visible" r:id="rId1" />
	</sheets>
	<definedNames>
		<definedName name="Print_Titles" localSheetId="0" hidden="false">Sheet1!$A$1:$IV$3</definedName>
		<definedName name="_xlnm.Print_Area" localSheetId="0" hidden="false">Sheet1!$A:$G</definedName>
		<definedName name="_xlnm.Print_Titles" localSheetId="0" hidden="false">Sheet1!$1:$3</definedName>
	</definedNames>
</workbook>

 

In Development
Last Updated: 19 Dec 2024 14:57 by ADMIN
Created by: Rob
Comments: 0
Category: PdfProcessing
Type: Feature Request
1
Add support for Named Actions.
In Development
Last Updated: 16 Dec 2024 12:53 by ADMIN
StackOverflowException is thrown when applying filter for SVG.
In Development
Last Updated: 13 Dec 2024 14:33 by ADMIN
When a Form with AlphaConstant and/or StrokeConstant contains a Path, alpha is applied to Form and Path, leading to a wrong transparency.
In Development
Last Updated: 06 Dec 2024 12:42 by ADMIN
The export method of the WorkbookFormatProviderBase does not use its timeout parameter.
In Development
Last Updated: 06 Dec 2024 11:11 by ADMIN
Implement support for adding barcodes to a PDF document.
In Development
Last Updated: 29 Mar 2024 10:37 by ADMIN
SearchResult's GetWordBoundingRect returns the Rect of only the first word of the whole match.