Can someone show me how to view pdf file in a form (.sct)

Re: Viewing pdf


gamease wrote:
Can someone show me how to view pdf file in a form (.sct)

If you are looking for something free, you might want to have a look at this link It shows you how to view PDFs using the web browser control.

If you need to be able to generate PDFs as well as view them, you may want to look at a commerical product such as amyuni.

Re: Viewing pdf


You may try (if you have reader installed):

Code Snippet

declare INTEGER ShellExecute in shell32 INTEGER handle, STRING @ oper, ;

STRING @ ifile, STRING @ iparam, STRING @ ipath, INTEGER showcmd

lcFileName = GETFILE("PDF")


Re: Viewing pdf

Naomi Nosonovsky

Look closer to the link already provided and read the comments.

Here they are again:

1. Drop olecontrol on the form and pick Microsoft Web Browser
2. Change its name to oWB
3. Create method ShowPdf on the form and copy code from PROCEDURE ShowPdf there.
4. Drop a command button on the form and copy code from command1.Click into its click method.
5. In VFP8 and earlier put NODEFAULT into REFRESH() event of the WebBrowser control to prevent an error. In VFP9 this problem is fixed and you don't need this code.

Re: Viewing pdf


Is it just my imagination or is this the same topic by the same poster that I saw in another thread here I can't seem to find the prior thread now, however I could have sworn I saw it. Perhaps I am thinking of another forum on another site or perhaps deja vu has gotten the better of me here.

Re: Viewing pdf

Naomi Nosonovsky

The same poster asked this question differently (OleObject error) few threads bellow.