We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Problem with search highliter

Hi,

I'm using SfPdfViewer in Xamarin.Forms for my application.
I noted that the search function works fine with most of pdf files, but I came up with a graphic bug for
documents that are wider than others:
in particular the highliter for the searched text does not correspond to the actual text position.

You can see the problem in the rar file I attached.

Thanks for your work.



Attachment: SfPdfViewer_bug_ddd8f205.rar

13 Replies

SS Sathish Sivakumar Syncfusion Team April 1, 2019 10:19 AM UTC

Hi Mauro, 

We are unable to reproduce the issue “Search highlight is placed incorrect location for some PDF document” in our side and we suspect this issue is specific to the PDF document you have used to display in SfPdfViewer. Please find the sample in the below link with which we tried to reproduce the reported issue. 


Kindly share the following details to analyze more on this issue and assist you with the better solution. 

  1. PDF document with which the issue could be reproduced.
  2. Simple sample / modify the sample shared in the above link to reproduce the issue.
  3. Platform
  4. Android/iOS/Windows SDK version
  5. Android/iOS/Windows emulator or device details with its OS version
  6. Syncfusion PdfViewer version
  7. Xamarin.Forms version

Regards, 
Sathish 



MA Mauro April 3, 2019 03:57 PM UTC

Thanks for your answer.

I tried the sample on the link you posted but it worked fine.

1. You can find the file that gives me problem in the rar i attached.
2. You can find a screenshot of the Document opened in your sample in the attached file
3. Xamarin Forms UWP
4/5. Issure reproduced on different devices, Windows 10 1809
6. SfPdfViewer v.16.3451
7. Reproduced in different version of Xamarin.Forms

Thanks for your work,

Mauro

Attachment: wide_file_example_e58b2edb.rar


SS Sathish Sivakumar Syncfusion Team April 4, 2019 11:27 AM UTC

Hi Mauro, 

Thank you for sharing the information. 

We are able to reproduce the issue “Searched text is not highlighted to the appropriate location” in our side and we suspect this to be a defect. We have forwarded this issue to our development team for more analysis and we will update further details on 08th April 2019. 

Regards,
Sathish 



GR Gayathri Ramalingam Syncfusion Team April 8, 2019 11:32 AM UTC

Hi Mauro,  
 
We have confirmed that the issue “Searched text is not highlighted to the appropriate location” is a defect. We have already resolved it. The fix for the defect will be included in our Weekly Nuget packages that will be release on April 9, 2019. Meanwhile we will deliver the patch in the version 16.3 as you requested. 
 
With Regards, 
Gayathri R 



SS Sathish Sivakumar Syncfusion Team April 9, 2019 01:53 PM UTC

Hi Mauro, 
  
We have fixed the issue “Searched text is not highlighted to the appropriate location” and the fix is published in nuget.org with version 17.1.0.40. Kindly update your SfPdfViewer the mentioned version to get the issue resolved. Kindly let us know if you still require the patch for this fix in the version 16.3 
  
Regards,
Sathish 
 



MA Mauro April 19, 2019 08:18 AM UTC

Thanks for your help. It works! When the package will be available in the Essential Studio Enterprise Edition - Community license?




SS Sathish Sivakumar Syncfusion Team April 22, 2019 09:01 AM UTC

Hi Mauro, 

Thank you for your update. 

The fix will be included in our 2019 Vol 1 SP 1 release, which is expected to be rolled out by May 13, 2019. Once this is released, it will be available for Community license holders also. 

Regards, 
Sathish 



MA Mauro June 10, 2019 11:40 AM UTC

Hi,

since I updated all Syncfusion packages my app crashes going on Unhandled Exception when I open 4 pdf in a row in Syncfusion.PdfViever.

I tried updating all my references, (using Xamarin.Forms last version) but It keeps crashing, what the problem could be?


SS Sathish Sivakumar Syncfusion Team June 11, 2019 11:55 AM UTC

Hi Mauro, 
 
We have tried to reproduce the issue “Application crashes while loading the PDF document in Xamarin.Forms.UWP” with latest Xamarin.Forms version(4.0.0.482894). 
 
Please find the sample in the below link with which we tried to reproduce the reported issue.  
 
We also attached the video recording for the same in the below link,  
 
Please try to reproduce this issue with the above sample at your end and send us the modified sample 
 
Meanwhile, share the following details to analyze further 
  1. PDF document with which the issue could be reproduced.
  2. Syncfusion PdfViewer version
Regards, 
Sathish 



MA Mauro June 13, 2019 03:46 PM UTC

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.PdfException

Another 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 
                at Syncfusion.SfPdfViewer.XForms.UWP.PdfDocumentView.LoadDocumentAsync(Stream stream)\r  
              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.51

Same 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.InvalidOperationException

Another 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


SS Sathish Sivakumar Syncfusion Team June 14, 2019 07:20 AM UTC

Hi Mauro,

Sorry for the inconvenience caused.

We are able to reproduce all the exceptions which you reported in SfPdfViewer(UWP) with Xamarin.Forms version (4.0.0.497661) in our side. We have forwarded this issue to our development team for further analysis and we will update more details on 18th June 2019.

Regards,
Sathish



SS Sathish Sivakumar Syncfusion Team June 18, 2019 12:09 PM UTC

Hi Mauro,

We have confirmed that the issue “Application crashes with multiple exceptions in SfPdfViewer in Xamarin.Forms(UWP)” is defect and logged defect report for this issue. The patch for this issue will be delivered on 02-July-2019.

Regards,
Sathish



JP Jhansi Priya Ramesh Syncfusion Team July 3, 2019 11:40 AM UTC

Hi Mauro,   
 
The fix for the issue “Application crashes with multiple exceptions in SfPdfViewer in Xamarin.Forms(UWP) was included in the 17.2.0.28-beta release(17.2.0.28). Kindly upgrade to this version to get this issue resolved.  Also, this fix will be included in our Essential Studio Volume 2 Main release which is expected to be rolled out in the mid of July 2019. 
 
Regards, 
Jhansi 


Loader.
Live Chat Icon For mobile
Up arrow icon