I am working with the Telerik UI for WinForms 2020 R1 release and I am experiencing a multitude of issues loading PDFs into the Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider via a FileStream (for splitting into individual pages) that I can properly load into the Telerik RadPdfViewer using the Load() method with the file name.
Some of the errors that I am experiencing are "R24 color space not supported", "R25 color space not supported", and "currentIndirectObject should not be null". I cannot provide copies of these PDFs, as they all contain Protected Health Information (PHI), which is protected information under HIPPA.
7 Answers, 1 is accepted
Hello Jay,
The first one (color space not supported) is a known issue that is already logged on our feedback portal. You can track its progress, subscribe to status changes and add your comment to it here: PdfProcessing: NotSupportedColorSpaceException is thrown when importing color space defined as an external resource.
Unfortunately, I cannot suggest a workaround for the issue.
I am not sure what is causing the second exception. Without a file that allows me to reproduce this, I cannot say what is causing it. Would it be possible for you to remove any sensitive information from this file and send it to us? The support tickets are private and we do not share the files with any third parties. This is noted in our EULA (point - 1.11).
I am looking forward to your reply.
Regards,
Dimitar
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.

Stack trace:
System.ArgumentException: currentIndirectObject should be null
at Telerik.Windows.Documents.Utilities.Guard.ThrowExceptionIfNotNull[T](T param, String paramName)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfExportContext.BeginExportIndirectObject(IndirectObject indirectObject, Int64 offset)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.IndirectObject.Write(PdfWriter writer, IPdfExportContext context)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfExporter.WritePendingIndirectObjects(IPdfExportContext context, PdfWriter writer)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfExporter.WriteCatalogAndRelatedProperties(PdfWriter writer, IPdfExportContext context, DocumentCatalog catalog)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Streaming.PdfStreamWriter.WriteAllPendingPdfObjects()
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Streaming.PdfStreamWriter.Dispose()
My C# code:
using(var fileWriter = new PdfStreamWriter(System.IO.File.OpenWrite(model.TargetFileUrl)))
{
fileWriter.Settings.DocumentInfo.Author = "Acme";
foreach(var doc in model.FilesToMerge)
{
using(var fileToMerge = new PdfFileSource(System.IO.File.OpenRead(doc.Location)))
{
foreach(var pageToMerge in fileToMerge.Pages)
{
fileWriter.WritePage(pageToMerge);
}
}
}
}
Hi Jay,
It would better to attach the fields.
The forum threads allow attaching only images. It would be better to open a new support ticket for this. You can attach files up to 20 megabytes per thread. Please note that you should add the files to an archive (zip, rar) and then attach them. Is this approach suitable for you?
I am looking forward to your reply.
Regards,
Dimitar
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Hi Dimitar, would it be possible for you to attempt the code I submitted with a couple PDF files of your own and the same version of the code base and see if you get the same error? I don't think the PDF files really matter here. They are valid PDF files that open successfully on their own.
Thanks
Hi Jay,
I have tested this with some sample files and it works on my side. I have attached my test project that shows this with your code.
Please note that the PDF standard supports many features and usually something very specific in the file is causing the issues. Please consider submitting a ticket with the files. This will allow us to properly investigate this case.
Let me know if you have any other questions.
Regards,
Dimitar
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Hello Andrey,
This might be caused by a known issue that has a workaround. The issue details are located here: PdfProcessing: ArgumentException when merging or splitting files with PdfStreamWriter.
I hope this helps. Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.