This is a migrated thread and some comments may be shown as answers.

RadFixedDocument Import Bug Issue

1 Answer 177 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
DeveloperTeam
Top achievements
Rank 1
DeveloperTeam asked on 26 Jul 2019, 11:50 AM

I want to report bug with this code:

byte[] file = File.ReadAllBytes("Test.pdf");  
            RadFixedDocument document = null;
            var prov = new PdfFormatProvider();
            using (var input = new MemoryStream())
            {
                input.Write(file, 0, file.Length);
                document = prov.Import(input);
            }
When I tried to import my document to RadFixedDocument  it says:
Ex: {"Stack empty."}
Stack trace:
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Stack`1.Peek()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.Parser.PostScriptReader.PushToken(PdfPrimitive primitive)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.Parser.PrimitiveParsers.ArrayParser.End()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.Parser.PostScriptReader.<BuildStateMachine>b__8(PostScriptReaderArgs b)
   at Telerik.Windows.Documents.Data.StateMachine.State`1.ExecuteActionIfNotNull(Action`1 action, TArgs arguments)
   at Telerik.Windows.Documents.Data.StateMachine.State`1.Enter(TArgs arguments)
   at Telerik.Windows.Documents.Data.StateMachine.StateMachine`1.GoToState(State`1 state, TArgs arguments)
   at Telerik.Windows.Documents.Data.StateMachine.StateMachine`1.GoToNextState(TArgs arguments)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.Parser.PostScriptReader.Read(IPdfImportContext context, Int64 endPosition)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.Parser.PostScriptReader.Read(IPdfImportContext context)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.ContentStreamInterpreter.ReadContentPrimitives()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.ContentStreamInterpreter.Execute()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.ContentStream.ParseContentData(Byte[] data, IRadFixedDocumentImportContext context, IResourceHolder resourceHolder, IContentRootElement contentRoot)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.Page.CopyPropertiesTo(PostScriptReader reader, IRadFixedDocumentImportContext context, RadFixedPage fixedPage)
   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.ImportOverride(Stream input)
   at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Import(Stream input

Please fix this issue.

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 31 Jul 2019, 06:40 AM
Hi Dragan,

Such an exception could be caused by something specific in the contents of the document. Would it be possible to share a sample document which we can use to reproduce the error locally and check what is the exact cause for it?

Regards,
Tanya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
PdfProcessing
Asked by
DeveloperTeam
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or