How do I display a PDF in LiveCode?
There are occasions when you might want to be able to display a PDF document in your LiveCode application, for example a help file. In this lesson we will look at different ways you can do this.
Launching a PDF in an external viewer

The simplest way to display a PDF from within LiveCode is to use the launch document command. This opens a document with the operating system's default program.
launch document "/Users/<username here>/Documents/mydocument.pdf"
Displaying a PDF within a LiveCode stack

But what if you don't want to display your PDF in a external window? You can use a browser widget to display PDFs within a stack.
To see how to do this we will create a new stack called "PDF Viewer", add a browser widget and a button that allows us to select the PDF file we want to view. Drag a browser widget onto your stack and resize it, add a button and name the button "Browse". Open the code editor from the toolbar and add this script (don't forget to click "Apply"):
Selecting a PDF
on mouseUp
local tFile
answer file "Please choose the file you would like to display" with type "PDF document|pdf|PDF"
if it is not empty then
put it into tFile
// Allow for spaces in filenames
replace " " with "%20" in tFile
set the url of widget "browser" to tFile
end if
end mouseUp
Displaying the PDF

Switch to Run mode and try selecting a PDF file.
here I get the answer:
button "loadPdf": execution error at line 15 (LCB Error in file browser.lcb at line 571: Value is not of correct type for passing as argument - expected type for passing to parameter pUrl of com.livecode.widget.browser.OnBrowserRequestCallback)
What am I doing wrong?
tb