Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading PDF files in VFP
Message
 
To
27/04/2001 09:53:12
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00500641
Message ID:
00501249
Views:
21
This message has been marked as the solution to the initial question of the thread.
Martin, I understand why you are confused. -Been there

two basic different ways to get it to work, different aproaches.
1 (not my favorite way) is to open the application, adobe pdf reader, and let that open the the pdf file. (thats the ole method) where you control adobe directly from inside vfp.

However, today you want to open pdf, files, and tomorrow you may want to open tiff files, and the next day who knows. a wave file, word doc, the list goes on.

There is a nice wrapper to the shellexecute function, here in the file section, which come in very handy.. to understand the basics, if the machine (users machine has an application associated with a file type. then all you need to do is call that file, and the default application will be called, with the default method.(as controlled by windows) The default method when calling - or clicking on a pdf file when you use exporer is to view it. (as apposed to editing or deleting it right) so by somwhow getting vfp to click on that file, you have it.

You might need to use the getfile() command to ge the file name by type that You want to view, or using some other method like list box to expose your user to what files you want to select from. but from there. pass the filename into the sh_execute function, its written by John Harvey and works great.


in my opinion, I wouldnt write an ole - remote function just to display pdf files, unless I truly wanted to control the pdf reader itself. there maybe reasons that you want or need to control the pdf reader more than just displaying the file, but if not, stick to the sh_execute type generic control to load it and view the file.


once you get the class then this is all that required to call it.
set classlib to sh_execute addi
ex=create('sh_execute')
ex.shellexecute(m_fileopen)  && your pdf file, (or any other windows known file) 
Bob Lee




>I want to create an app which reads PDF files.
>
>I haven't been able to figure out a CREATEOBJECT() command that works.
>
>Once I create the object, what is the command to open a file?
>
>Thanks, Martin
In the beginning, there was a command prompt, and all was well.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform