today I found out more or less by accident that you can easily build a pdf viewer with the help of the Web*Gadget's. (see example)
Interestingly, all three variants work.
Now I wonder what is behind it.
And of course: Which is the best way?
Any advice or help would be appreciated.
TIA.
BTW: With a quick check I figured out that there are different components 'Chrome' or 'Acrobat' involved.
Code: Select all
; Variant WebViewGadget()
; PID: ? Wnd: ? WT: "" ? CN: "PureWebView"
; PID: ? Wnd: ? WT: "" ? CN: "Chrome_WidgetWin_0"
; PID: ? Wnd: ? WT: "Kuenstliche_Intelligenz.pdf" ? CN: "Chrome_WidgetWin_1"
; Variant WebGadget()
; PID: ? Wnd: ? WT: "Web" ? CN: "PureWeb"
; ....
; PID: ? Wnd: ? WT: "C:\Temp\Kuenstliche_Intelligenz.pdf - Adobe Acrobat Reader (64-bit)" ? CN: "Static"
; Variant WebGadget("", #PB_Web_Edge)
; PID: ? Wnd: ? WT: "" ? CN: "PureWebView"
; PID: ? Wnd: ? WT: "" ? CN: "Chrome_WidgetWin_0"
; PID: ? Wnd: ? WT: "Kuenstliche_Intelligenz.pdf" ? CN: "Chrome_WidgetWin_1"
Code: Select all
#ChooseTheWebGadget = 1
; #ChooseTheWebGadget = 2
; #ChooseTheWebGadget = 3
Global url$ = "file://C:\Temp\Kuenstliche_Intelligenz.pdf" ; <<< change this to your pdf file
If OpenWindow(0, 0, 0, 600, 600, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CompilerSelect #ChooseTheWebGadget
CompilerCase 1 ;<Variant 1>
SetWindowTitle(0, "WebGadget Variant 1")
WebViewGadget(0, 10, 10, 580, 580)
SetGadgetText(0, url$)
CompilerCase 2 ;<Variant 2>
SetWindowTitle(0, "WebGadget Variant 2")
WebGadget(0, 10, 10, 580, 580, url$)
CompilerCase 3 ;<Variant 3>
SetWindowTitle(0, "WebGadget Variant 3")
WebGadget(0, 10, 10, 580, 580, url$, #PB_Web_Edge)
CompilerEndSelect
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf