I'm using the same library (modified for ABMaterial) and my url looks like this:
./viewerpdf.html?file=../PDF/1.pdf
so myabe in your case you could try something similar?
file:/C:/temp/ViewerJS/index.html?file=file:/C:/temp/pdftest.pdf
webview2.PrefWidth=Pane2.width-25
webview2.PrefHeight=Pane2.height-25
It seems that putting the webview in a pane and using these lines of code is the problem
B4X:webview2.PrefWidth=Pane2.width-25 webview2.PrefHeight=Pane2.height-25
They are returning the width and height of Pane2 as 0 (zero) therefore the webview is being resized to -25 x -25 so you cant see it.
(prefWidth and prefHeight also return 0)
I had to explicitly set the pane width and height when I added it to the rootpane (f1.rootpane.addnode(p1,0,0,600,600) before the webview was visible.
if you have a pdf to try - then its
file:/C:/temp/ViewerJS/index.html#file:/where/your/pdf/file/is.pdf
The load method is built into javafx webengine, so can't do anything to that.
If I paste the address file:/C:/temp/ViewerJS/index.html#file:/C:/temp/pdftest.pdf directly into my browser it works as expected.
The pdf can be anywhere on my pc, I don't need it to be in the viewerjs directory.
This is the full code that I have been using. It has calling viewer directly and calling showpdffile(filename) to open a new window with a viewer in.