So, I tried differents cases to analyze the problem.
First of all, these are all the Syncfusion dependecies I'm using for my project.
First case : Xamarin.Forms v.4.0.0.497661 and all Syncfusion dll at 17.1.0.49
- The problem occurres randomicaly after I open 3/4 pdf documents in sequence, but It happens most of the time if I try to open a bigger document ( > 10MB file)
Then, I get an Unhandled exception, these are different logs I collected:
$exception {Syncfusion.Pdf.PdfException: Fatal Error at 1532181.
at Syncfusion.Pdf.IO.PdfLexer.YyError(YYError code, Boolean fatal)
at Syncfusion.Pdf.IO.PdfLexer.GetNextToken()
at Syncfusion.Pdf.IO.PdfParser.Parse(Int64 offset)
at Syncfusion.Pdf.IO.CrossTable.GetObject(IPdfPrimitive pointer)
at Syncfusion.Pdf.IO.PdfCrossTable.GetObject(IPdfPrimitive pointer)
at Syncfusion.Pdf.Primitives.PdfReferenceHolder.get_Index()
at Syncfusion.Pdf.Primitives.PdfReferenceHolder.ObtainObject()
at Syncfusion.Pdf.Primitives.PdfReferenceHolder.get_Object()
at Syncfusion.Pdf.PdfPageBase.get_Contents()
at Syncfusion.Pdf.PdfPageLayerCollection.ParseLayers(PdfPageBase loadedPage)
at Syncfusion.Pdf.PdfPageBase.ExtractText()
at Syncfusion.SfPdfViewer.XForms.UWP.PdfDocumentView.IncludeCanvas(Int32 pageIndex, Int32 width, Int32 height)
at Syncfusion.SfPdfViewer.XForms.UWP.PdfDocumentView.LoadPages()
at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()} Syncfusion.Pdf.PdfExceptionAnother one, restarting the application, also open 3/4 documents in sequence:
Message "One or more errors occurred. (Exception from HRESULT: 0x80048030)" string
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\r\n
at Syncfusion.SfPdfViewer.XForms.UWP.PdfDocumentView.LoadDocumentAsync(Stream stream)\r\n
at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()" string
source : Source "System.Private.CoreLib" string
Another try, same scenario as before: $exception {Syncfusion.Pdf.PdfException: Unexpected token String before 289330
at Syncfusion.Pdf.IO.PdfParser.Error(ErrorType error, String additional)
at Syncfusion.Pdf.IO.PdfParser.Parse()
at Syncfusion.Pdf.IO.CrossTable.RetrieveArchive(Int64 archiveNumber)
at Syncfusion.Pdf.IO.ArchiveInformation.get_Archive()
at Syncfusion.Pdf.IO.CrossTable.RetrieveParser(ArchiveInformation archive)
at Syncfusion.Pdf.IO.CrossTable.GetObject(IPdfPrimitive pointer)
at Syncfusion.Pdf.IO.PdfCrossTable.GetObject(IPdfPrimitive pointer)
at Syncfusion.Pdf.Primitives.PdfReferenceHolder.get_Index()
at Syncfusion.Pdf.Primitives.PdfReferenceHolder.ObtainObject()
at Syncfusion.Pdf.Primitives.PdfReferenceHolder.get_Object()
at Syncfusion.Pdf.PageResourceLoader.GetFontResources(PdfDictionary resourceDictionary, PdfPageBase page)
at Syncfusion.Pdf.PageResourceLoader.GetPageResources(PdfPageBase page)
at Syncfusion.Pdf.PdfPageBase.ExtractText()
at Syncfusion.SfPdfViewer.XForms.UWP.PdfDocumentView.IncludeCanvas(Int32 pageIndex, Int32 width, Int32 height)
at Syncfusion.SfPdfViewer.XForms.UWP.PdfDocumentView.LoadPages()
at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()} Syncfusion.Pdf.PdfException
Second case : Xamarin.Forms v.4.0.0.497661 , all Synfussion dll at 17.1.0.49 except for - Syncfusion.Licensing at 17.1.0.51- Syncfusione.Xamarin.Compression at 17.1.0.51- Syncfusion.Xamarin.Pdf at 17.1.0.51- Syncfusion.Xamarin.Presentation at 17.1.0.51Same scenario as First case, but different exceptions : - $exception {System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at Syncfusion.Pdf.PdfPageLayerCollection.ParseLayers(PdfPageBase loadedPage)
at Syncfusion.Pdf.PdfPageBase.ExtractText()
at Syncfusion.SfPdfViewer.XForms.UWP.PdfDocumentView.IncludeCanvas(Int32 pageIndex, Int32 width, Int32 height)
at Syncfusion.SfPdfViewer.XForms.UWP.PdfDocumentView.LoadPages()
at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()} System.InvalidOperationExceptionAnother try, same scenario : $exception {System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at Syncfusion.Pdf.PdfPageLayerCollection.ParseLayers(PdfPageBase loadedPage)
at Syncfusion.Pdf.PdfPageBase.get_DefaultLayer()
at Syncfusion.Pdf.Parsing.PdfLoadedDocument.AddWaterMark()
at Syncfusion.Pdf.Parsing.PdfLoadedDocument.Save(Stream stream)
at Syncfusion.SfPdfViewer.XForms.UWP.PdfDocumentView.BackgroundWorker_DoWork(Object sender, DoWorkEventArgs e)} System.InvalidOperationException
If it could help you more, in attacched files you can find All dependencies that I use in my project.Thanks for your work, your support is brillant and one of the best I could ever see in my carreer :)
Attachment:
Dependecies_5f2a8e47.rar