Show PDF in HTMLViewer (Win)

I try to open a PDF on disk and show it in a HTMLViewer. But Windows shows a message ‘do you want to open etc’ and then displays the PDF in the separate viewer app.

[code]'Get the PDF file as a folderitem
Dim f As FolderItem = SpecialFolder.Desktop.Child(“CAO.pdf”)

'load doc in viewer
'HTMLViewer1.LoadURL(“file:///C:/Users/Sander/Desktop/CAO.pdf”)
HTMLViewer1.LoadPage(f)[/code]

How can I force to open the PDF in the HTMLViewer?

You need to install Acrobat Reader plugin. Contrary to macOS, Windows has no native support for PDF files.

I forgot… ofcourse. Thanks

Alas…doesn’t work in Windows 10. It wants to display the PDF in the Windows Reader app.

Display it in Edge. It supports PDF.

http://www.intowindows.com/how-to-open-microsoft-edge-from-run-or-command-prompt/

Is there a way to run searches and highlight the pdf from code using this method? I need to be able to do it on both Mac and PC. Preferably with one code base.

You can do highlighting with DynaPDF and show the page as picture.
Cross platform and without browser capabilities.

Like in this video:

https://www.mbsplugins.de/archive/2019-12-12/New_example_database_PDF_libra/monkeybreadsoftware_blog_archive

Can be done in Xojo same way.

as alternative PDF.js
https://mozilla.github.io/pdf.js/