Need More Info
Last Updated: 24 Apr 2024 10:12 by ADMIN
Created by: Vitalii
Comments: 1
Category: PdfProcessing
Type: Bug Report
1
Hi.

I'm currently working with the large PDFs. I'm able to process PDFs up to 2.1 GB easily without any error using Telerik Document Processing. However, if I take a larger PDF (e.g. 2.8 GB), PdfFormatProvider.Import throws an IOException with the next message: "The parameter is incorrect. : {path}".
I'm using FileStream to provide a sample for the Import method.

I've checked it with the different samples, all have the same behavior. So, I guess, it will work for any PDF larger than 2.1 GB.
In Development
Last Updated: 18 Apr 2024 12:13 by ADMIN
When merging documents with exactly the same font but different character widths, some characters are rendered with the wrong width.

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

In Development
Last Updated: 18 Apr 2024 12:11 by ADMIN

This is the code used for merging:

        private  void MergeDifferentDocumentsPagesWithFixed()
        {
            string[] documentsToMerge =
            {
                "14301-STOCK_Proforma.pdf",
                "14302-STOCK_Proforma.pdf",
                "14303-STOCK_Proforma.pdf",
                "14304-STOCK_Proforma.pdf",
                "14305-STOCK_Proforma.pdf",
                "14330-STOCK_Proforma.pdf"
            };
            RadFixedDocument doc = new RadFixedDocument();
            PdfFormatProvider provider = new PdfFormatProvider();
            foreach (string current_item in documentsToMerge)
            {
                string path = @"..\..\Samples\" + current_item;
                RadFixedDocument docToMerge;
                if (!File.Exists(path))
                {
                    continue;
                }
                using (Stream stream = File.OpenRead(path))
                {
                    docToMerge = provider.Import(stream);
                }
                doc.Merge(docToMerge);
            }


            string outputFilePath = @"..\..\mergedFixed.pdf";
            File.Delete(outputFilePath);

            using (Stream output = File.OpenWrite(outputFilePath))
            {
                provider.Export(doc, output);
            }
            Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });


        }

Workaround:  

   private void MergeDifferentDocumentsPages(string resultFileName)
   {
       string[] documentsToMerge =
       {
           "14301-STOCK_Proforma.pdf",
           "14302-STOCK_Proforma.pdf",
           "14303-STOCK_Proforma.pdf",
           "14304-STOCK_Proforma.pdf",
           "14305-STOCK_Proforma.pdf",
           "14330-STOCK_Proforma.pdf"
       };

       File.Delete(resultFileName);
       using (PdfStreamWriter fileWriter = new PdfStreamWriter(File.OpenWrite(resultFileName)))
       {
           foreach (string documentName in documentsToMerge)
           {
               string path = @"..\..\Samples\" + documentName;
               using (PdfFileSource fileToMerge = new PdfFileSource(File.OpenRead(path)))
               {
                   foreach (PdfPageSource pageToMerge in fileToMerge.Pages)
                   {
                       fileWriter.WritePage(pageToMerge);
                   }
               }
           }
       }


      
       Process.Start(new ProcessStartInfo() { FileName = resultFileName, UseShellExecute = true });
   }

In Development
Last Updated: 16 Apr 2024 11:02 by ADMIN
Unplanned
Last Updated: 29 Mar 2024 14:03 by Koichi

The visual fill element is not exported to pdf:

Only the text part is present.

Unplanned
Last Updated: 29 Mar 2024 13:27 by Koichi

Import the document with RadSpreadProcessing and export it PDF format. You will notice that the cell value is displayed in the exported PDF document while in the Excel file it is hidden due to the custom format:

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.
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: 19 Mar 2024 09:08 by ADMIN
In scenarios with negative font and/or negative horizontal scaling the text is not rendered correctly.
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!!!)
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)
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)
Wrong glyph measurement results in overlapping text.
Unplanned
Last Updated: 06 Feb 2024 14:40 by John
Sign a random pdf document with the following code. If UseSignatureProperties=1, the produced PDF document will be corrupted and Adobe displays an error message when opening the file: 
        Dim signProp As New SignatureDataProperties
        signProp.ContactInfo = strContactInfo
        signProp.Name = strSignersName
        signProp.Reason = strReason
        signProp.Location = strLocation
        signProp.TimeOfSigning = DateTime.Now

        Dim signatureName As String = "EsignSignature"

        Dim signatureField1 As SignatureField = New SignatureField(signatureName)
        UseSignatureProperties = 1

        If UseSignatureProperties = 1 Then
            Dim sign1 = New Signature(certificate)
            signatureField1.Signature = sign1
            signatureField1.Signature.Properties = signProp 'THIS WOULD FAIL
        Else
            signatureField1.Signature = New Signature(certificate)
            signatureField1.Signature.Properties.ContactInfo = strContactInfo
            signatureField1.Signature.Properties.Location = strLocation
            signatureField1.Signature.Properties.Name = strSignersName
            signatureField1.Signature.Properties.Reason = strReason
            signatureField1.Signature.Properties.TimeOfSigning = DateTime.Now  'THIS WORKS
        End If
Unplanned
Last Updated: 31 Jan 2024 11:55 by ADMIN

Observed: the following dialog appears:

Image

Unplanned
Last Updated: 30 Jan 2024 09:55 by Abdulbaqi
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)

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

Image

Completed
Last Updated: 11 Jan 2024 08:24 by ADMIN
Release 2024 Q1
A password is asked although Adobe opens the document without one.
1 2 3 4 5 6