seb-mac icon indicating copy to clipboard operation
seb-mac copied to clipboard

CMD+F search disabled in embedded PDF files, works in external PDF files

Open wilenius opened this issue 2 years ago • 13 comments

We just tested the search functionality in the latest seb-mac (3.2.4), MacOS version was 12.6.3.

When starting a Moodle Quiz SEB session, CMD+F works in the Quiz view. However, it does not work (no search results) in PDF files embedded to the Quiz (links starting with /pluginfile.php/(.*).pdf. Also, the search does not work in PDF files that are embedded on websites, which are linked to the quiz.

An example: The quiz has a link to the legislation collection https://eur-lex.europa.edu, which opens in a popup window. The PDF on that website opens, and the CMD+F search dialog opens, but no search results are displayed.

However, when a PDF is linked directly in the quiz, e.g., https://www.echr.coe.int/Documents/Convention_FIN.pdf, the search functionality works normally.

Search on embedded PDFs work in the Windows version, and they used to work in the Mac version too.

wilenius avatar Apr 28 '23 08:04 wilenius

Unfortunately Apple doesn't properly support search in PDFs in their web browser engine. Search in PDFs works only if SEB is using the modern WebView (depends on the SEB integration in the assessment/LMS solution, if pinch-to-zoom with two fingers on a trackpad works, then the modern WebView is used) and on macOS >=11 (currently not in iOS).

The issues with the search functionality you are mentioning are most likely caused by limitations of the browser engine we have to use in SEB for macOS and the differences how those PDF files are presented/embedded by the web application. Some web applications render PDF files themselves in HTML code, then the search functionality should work in any case.

It's extremely unlikely that a change in the SEB for Mac version caused the search to no longer work with PDF files, as we didn't change anything regarding this in its code. I would assume that a change in the web application caused this no longer to work in SEB for macOS.

I would look at this, but I would need testing access to your assessment system with some example quiz where I could reproduce these PDF issues.

danschlet avatar Apr 28 '23 10:04 danschlet

Thanks – I'll try to arrange a temporary user account for you. I assume that I can send the access info to your ETH email address?

wilenius avatar May 23 '23 07:05 wilenius

Yes, please do that.

danschlet avatar May 23 '23 07:05 danschlet

There was actually an issue in SEB 3.1 - 3.2.5 which prevented the text search to work in embedded PDF files. I fixed that in the beta of SEB 3.3 for macOS. Maybe you can test it and confirm if it works for you (I tested it on the https://eur-lex.europa.eu page).

danschlet avatar Jun 15 '23 08:06 danschlet

3.2.5 on macOS's last version. when opening a pdf that was uploaded to moodle, pressing CMD+F will open a search box but won't show results for the word searched.

notice the CMD+F work perfectly on the moodle's webpage itself.

that's a critical for our faculty law, which has lot of texts in exams.

javierravel avatar Jun 25 '23 12:06 javierravel

@javierravel Did you read the postings above?

danschlet avatar Jun 25 '23 13:06 danschlet

@danschlet Yes I saw I tried several versions and still the search on Mac does not work

javierravel avatar Jun 29 '23 08:06 javierravel

after enabling ”prefer modern” as a browser engine policy, the key now can’t be registered with our server beacause (quote) “Prefer Modern ignores the 'Use Browser & Config Keys'”

Is there another way to make searching in pdf work while still be able to register the key of the web file ?

No, your e-assessment solution needs to implement support for the SEB Javascript API to query the Browser and Config Keys, otherwise SEB cannot use the modern WebView and PDF search doesn't work. See the developer documentation page about this. Which assessment system or LMS are you using? Moodle for example has support built-in for this from version 4.1 and backported to the latest 4.0.x release. With older versions, you can install the updated Moodle SEB plugin manually, see SEB for macOS release notes for more information.

The only other way is to use some server-side PDF renderer like pdf.js which then offers search in PDFs.

danschlet avatar Jun 29 '23 10:06 danschlet

Hello, has this issue been fixed by any chance? Is there a known way to fix this issue? My university uses SEB 3.3.1 and Moodle, and we still experience the issue with Cmd+F not working on Mac. Thanks!

itamarm10 avatar Mar 27 '24 20:03 itamarm10

Please provide a test link/demo exam and instructions how to reproduce. For me searching in PDFs works (only on macOS, iOS/iPadOS unfortunately doesn't support that in the web browser engine we're using).

danschlet avatar Apr 09 '24 12:04 danschlet

@danschlet For the past months we have not been able to simulate a test to show the problem. However, it is possible to create a test that will work for 24 hours (perhaps a bit more). If that could work, we would very much like to coordinate a suitable time for you to check out the issue and we will prepare a test link when you're available. Thank you so much!

itamarm10 avatar Jul 09 '24 13:07 itamarm10

We are actually using SEB 3.4 on MacOS computers and have the same problem. We also seem to be using Modern Engine Policy.

1

ghost avatar Oct 31 '24 14:10 ghost

Prefer Moder in New Tab+Different Host is not the correct setting, still the classic WebView will be used for the main window containing the exam. See release notes (for SEB macOS/iOS, topics not yet covered in the manuals are usually briefly explained in the release notes; go on that page, search for a key word):

When using the modern WebKit browser engine (WKWebView), SEB currently doesn't support URL content filters(only URL filters for links and page loading) and sending the Config Key and Browser Exam Key in HTTP headers (the latter feature will not be possible with WKWebView at all, so you will need to transition to the SEB JavaScript API in your web applications, see the developer documentation). If one of the settings sendBrowserExamKey=true or URLFilterEnableContentFilter=true is enabled, the classic WebView is used depending on the new setting Preferences/ Browser/"Select Browser Engine Policy" (key browserWindowWebView), "Prefer Modern in New Tab+Different Host" (value 2), ensures that you still can use testing systems/LMS like Moodle which use the Browser Exam/Config Key test for SEB connecting to the exam (as they open in the classic WebView), but webpages opened in new tabs, which have another host than the exam system, open in WKWebView.

danschlet avatar Nov 01 '24 22:11 danschlet

Check if you can pinch-to-zoom in the browser window with the PDF on the trackpad, if yes, it's the modern WebView (or check SEB logs). Only then text search should work in the PDF. Of course only if the PDF contains text and isn't scanned text in bitmap format.

danschlet avatar Nov 01 '24 22:11 danschlet

We are actually using SEB 3.4 on MacOS computers and have the same problem. We also seem to be using Modern Engine Policy.

1

Dear Daniel,

After more testing, we used the other option Prefer Modern and we had the search function in PDF working. In both cases we had the "pinch to zoom" function working, but only on the second one (Prefer Modern) we had search in PDF working.

ghost avatar Nov 04 '24 15:11 ghost

I realized that "pinch-to-zoom" works in PDF files displayed in SEB browser windows regardless of the browser engine, so also if the classic WebView is used. Only for plain web content "pinch-to-zoom" is a sign that the modern WebView is used.

danschlet avatar Nov 15 '24 13:11 danschlet