pdf viewer is breaking

i'm using pdf file hosted on firebase
and i want to perform text search on my pdf file
it is working when it is finding some result, but breaking when it doesn't find target text

  • with below code search is working (atleast not breaking when no result is found)

Image_5100_1715031989017


  • with this code page is breaking when no result is found
    Image_4438_1715032087235 
  • here is the errorImage_1204_1715032160905


  • my problem: -
  • how can i add custom error message component for it, or how can i handle this error, so that it can show default error message and not break entire page

    thanks in advance

5 Replies

CK Chinnamunia Karthik Chinna Thambi Syncfusion Team May 8, 2024 05:44 PM UTC

Hi Boby,

We have searched the both matched and unmatched text using the following code snippet, and the texts are searched without any issues. We have shared the sample in which we have tried to reproduce the issue in the below link, along with a video recording for your reference.


Sample: https://stackblitz.com/edit/react-pbh64p?file=index.js


Video:  https://www.syncfusion.com/downloads/support/directtrac/general/ze/SearchVideo-194766292.zip


Please test the provided sample on your end. If you encounter any issues, could you please confirm if you've made any customizations? If so, please share those details. Additionally, kindly provide a modified sample and relevant code snippets related to the reported issue. These details will assist us in further analysis and providing appropriate assistance.



BT Boby Tudu May 8, 2024 08:08 PM UTC



CK Chinnamunia Karthik Chinna Thambi Syncfusion Team May 13, 2024 11:24 AM UTC

Hi Boby,

We were able to reproduce the current reported script error, Cannot read properties of undefined (reading 'replace'). We will analyze further on this and update you with more details in two business days on May 15, 2024.

 

Note: The current reported script error differs from the initial one. If the initial error occurred in a different scenario, please provide steps to reproduce the issue



CK Chinnamunia Karthik Chinna Thambi Syncfusion Team May 15, 2024 12:12 PM UTC

Hi Boby,

We have logged this as defect as "Script error occurred when searching the non-matched word in the provided document" and the fix for the issue will be available in our upcoming weekly NuGet release on June 05, 2024. You can track the status of the issue through the following link.

 

Feedback link: Script error occurred when searching the non-matched word in the provided document | Issue Feedback

 

Disclaimer: "Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization."



CK Chinnamunia Karthik Chinna Thambi Syncfusion Team June 5, 2024 12:37 PM UTC

Hi Boby,

We have fixed the reported issue "Script error occurred when searching the non-matched word in the provided document" and the fix for the reported issue was included in our latest weekly release v25.2.7. Kindly upgrade to that version to get the issue resolved.

 

Root cause: The provided document contains a landscape-sized page at the end. When searching for non-matching text, the page text becomes undefined for the landscape-sized page, causing a script error when attempting to access the undefined page text variable.

 

Solution: We have added a condition before accessing the page text and also fixed the issue of getting an undefined value for the landscape page size when the page contains text. This can be resolved by retrieving the data from storage with proper title values.

 

Packages:   

 

CDN Links:

 

https://cdn.syncfusion.com/ej2/25.2.7/dist/ej2.min.js

https://cdn.syncfusion.com/ej2/25.2.7/material.css

https://cdn.syncfusion.com/ej2/25.2.7/dist/ej2-pdfviewer-lib/pdfium.js

https://cdn.syncfusion.com/ej2/25.2.7/dist/ej2-pdfviewer-lib/pdfium.wasm


Loader.
Up arrow icon