Declined
Last Updated: 20 Sep 2023 12:14 by ADMIN
Devel
Created on: 13 Jul 2023 19:54
Category: PdfProcessing
Type: Bug Report
0
PdfFormatProvider.Import bug "Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfName' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Mode"

Hello, I had many problems with version 2023.1.117, latest stable 2023.2.606 is unusable also due to issue with scanned documents etc, so I tried 2020.2.703-hotfix, but I am getting other set of issues.

Unfortunately I cannot share the documents, since they are confidential.

With some documents I am getting this error:
Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfName' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Objects.FormXObject'.

 

Loading Code:

            PdfFormatProvider pdfFormatProvider = new();

            RadFixedDocument document = pdfFormatProvider.Import(bytes);

 

And stack trace:

   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.AppearanceConverter.ConvertFromDictionary(PostScriptReader reader, IPdfImportContext context, PdfDictionary dictionary)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.AppearanceConverter.Convert(Type type, PostScriptReader reader, IPdfImportContext context, IPdfPrimitive value)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.AppearanceConverter.ConvertFromIndirectReference(Type type, PostScriptReader reader, IPdfImportContext context, IndirectReference indirectReference)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.AppearanceConverter.Convert(Type type, PostScriptReader reader, IPdfImportContext context, IPdfPrimitive value)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.AppearancesConverter.TryImportAppearance(String key, PostScriptReader reader, IPdfImportContext context, PdfDictionary appearancesDictionary, Appearance& appearance)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.AppearancesConverter.ConvertFromDictionary(Type type, PostScriptReader reader, IPdfImportContext context, PdfDictionary dictionary)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.Converter.Convert(Type type, PostScriptReader reader, IPdfImportContext context, IPdfPrimitive value)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Data.PdfPropertyBase`1.PrepareValue(PostScriptReader reader, IPdfImportContext context, IPdfPrimitive value)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Data.LoadOnDemandPropertyBase`1.GetValueFromSource(Boolean shouldDecrypt)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Data.LoadOnDemandPropertyBase`1.GetValue(Boolean shouldDecrypt)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Annotations.AnnotationObject.get_Appearances()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Annotations.AnnotationObject.ToAnnotation(PostScriptReader reader, IRadFixedDocumentImportContext context, Double pageHeightInDip)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.Page.<>c__DisplayClass21_0.<CopyPageAnnotationsTo>b__0()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.ExceptionHandling.ExecutionHandler.TryHandleExecution[E](Action operation)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.Page.CopyPageAnnotationsTo(IRadFixedDocumentImportContext context, RadFixedPage fixedPage)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.DocumentCatalog.<>c__DisplayClass59_2.<CopyAllPageProperties>b__2()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.ExceptionHandling.ExecutionHandler.TryHandleExecution[E](Action operation)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.DocumentCatalog.CopyAllPageProperties(PostScriptReader reader, IRadFixedDocumentImportContext context, List`1 contextPages, IList`1 pages)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.DocumentCatalog.CopyPagePropertiesTo(PostScriptReader reader, IRadFixedDocumentImportContext context)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.DocumentCatalog.CopyPropertiesTo(PostScriptReader reader, IRadFixedDocumentImportContext context)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.RadFixedDocumentImportContext.BeginImportOverride()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.BaseImportContext.BeginImport(Stream pdfFileStream)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.PdfImporter.Import(Stream input, IPdfImportContext context)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.<>c__DisplayClass18_0.<ImportOverride>b__0()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.ExceptionHandling.ExecutionHandler.TryHandleExecution[E](Action operation)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.ImportOverride(Stream input)
   at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Import(Stream input)
   at Telerik.Windows.Documents.Common.FormatProviders.BinaryFormatProviderBase`1.Import(Byte[] input)
   at Client.Wpf.Common.UserControls.PdfViewer.LoadBytesToPdfViewer(Byte[] bytes) in C:\Users\tomas.filip\source\repos\FiFi\Client.Wpf\Common\UserControls\PdfViewer.xaml.cs:line 65
   at System.Reactive.AnonymousSafeObserver`1.OnNext(T value)
   at System.Reactive.ObserveOnObserverNew`1.DrainStep(ConcurrentQueue`1 q)
   at System.Reactive.ObserveOnObserverNew`1.DrainShortRunning(IScheduler recursiveScheduler)
   at System.Reactive.Concurrency.DispatcherScheduler.<>c__DisplayClass12_0`1.<Schedule>b__0()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)


3 comments
ADMIN
Peshito
Posted on: 20 Sep 2023 12:14

Hello,

This ticket is now marked as Declined due to inactivity and missing needed information.

Regards,
Peshito
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Martin
Posted on: 17 Jul 2023 07:58

Hi Devel,

Thank you for the feedback but I am afraid such behavior is not reported until now and we cannot reproduce it on our side without a sample document.

I must assure you we treat all client files in a strictly confidential manner and for testing purposes only but if you are not able to share the original PDF document that is causing the issue I would like to ask you to send us the document by deleting the sensitive data if possible and if this behavior is observed after modifying it.

If we don't have the option to test this behavior on our side, I am afraid we cannot fix the issue.

Looking forward to hearing from you.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Devel
Posted on: 13 Jul 2023 21:26
Also the file normally opens in Adobe Acrobat.