Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Acrobat SDK with VFP

Status
Not open for further replies.

CFB

Programmer
Jan 11, 2001
74
0
0
US
Has anyone used the Acrobat SDK in any of their VFP projects? I've got an application that creates PDF files from pages which the user selects from another file. Right now I'm using the PDF.ocx so the user can view the PDF file from which they are extracting pages. The problem with this is Adobe does not support that ActiveX component, it's intended only to be used as a plugin within a browser. It also only gives me limited control over navigation and data retrieval from the PDF file. I'd like to add my own PDF viewer into the application, but can't seem to figure out how to implement that using the Acrobat SDK. Any help would be appreciated. Thanks.
 
CFB

When you mention the PDF.ocx do you mean the Adobe Acrobat Control for ActiveX?

If so, be warned that if a user opens and subsequently closes the Acrobat Reader whilst the Adobe Acrobat Control for ActiveX is open in a VFP form, the Adobe Acrobat Control will simply vanish from the VFP form.

Not what you want to hear, but might save you some time in fruitless development.

Chris :)

 
Yes, that's the ActiveX control I'm talking about. Fortunately my end users don't user Reader for anything other than this application, but they could. That's yet another reason I want to create my own PDF Viewer within a Fox window. I think it calls for me to create a window and take the handle from that window and pass it along to one of the Adobe SDK objects. Unfortunately I'm not sure how to create a window and grab it's handle within VFP.
 
I've found the Adobe PDF ActiveX to be pretty limited. In your situation, since you want to view it from within vfp. Try using the Internet Explorer Control and viewing the PDF through IE (which in turn will display the PDF). This may give you better control over it.

Stephen
 
I have full control over the PDF using the Acrobat SDK, but my problem is I'm using the SDK to manipulate the PDFs that are being viewed through the PDF ActiveX control. The ActiveX control loads fine and displays the PDFs fine, but that's all it can be used for. If I was able to create my own viewer I could allow the user to manipulate the PDFs directly from the view within the VFP form. Anyhow, I guess my question really is, does anyone know how to create a window within VFP form and grab the handle from that window?
 
What exactly do you mean by manipulate the PDFs? If you mean zooming in and out and changing pages within a pdf, thats possible, but to actually modify the pdfs from outside of Adobe Acrobat using their activex is not possible. Adobe has never wanted to give public/easy access to their pdf SDK.
 
Access to the Acrobat SDK is free with a licenesed copy of Adobe Acrobat. When I say I'm manipulating PDFs I mean I'm creating new PDFs, inserting pages for existing PDFs into the newly created PDF, deleting pages, linearizing, etc. I'm doing these things now with the Acrobat SDK, but I use Adobe's ActiveX control to handle the viewing of the PDF files which I'm working with. If I were able to create my own viewer instead of using Adobe's ActiveX control it would make my application run more smoothly.

I'll give you an example. The user opens a 5 page PDF in my application. They can view the PDF using the ActiveX control. They are able to zoom in, turn pages, etc. Based on what they view they can enter page numbers from that PDF into a grid. Then I have a 'Create' command button on the form which creates a new PDF file from the PDF which they are viewing in the ActiveX control, based on the numbers entered into that the grid . To do that I instantiate the 'AcroExch.PDDOC' object and use the related methods to create the new PDF file. If I were able to create my own viewer I'd have a lot more control over how they control the PDF they are viewing. One example would be, instead of having to data enter pages into a grid, they could turn to a page in the PDF they are viewing and click a button to extract the current page. Since I'm using the ActiveX to view the PDF and the SDK to edit the PDF I'm unable to do that.

I may have just made this more confusing, but that basically sums up my problem.
 
Access to the Acrobat SDK is free with a licenesed copy of Adobe Acrobat. When I say I'm manipulating PDFs I mean I'm creating new PDFs, inserting pages for existing PDFs into the newly created PDF, deleting pages, linearizing, etc. I'm doing these things now with the Acrobat SDK, but I use Adobe's ActiveX control to handle the viewing of the PDF files which I'm working with. If I were able to create my own viewer instead of using Adobe's ActiveX control it would make my application run more smoothly.

I'll give you an example. The user opens a 5 page PDF in my application. They can view the PDF using the ActiveX control. They are able to zoom in, turn pages, etc. Based on what they view they can enter page numbers from that PDF into a grid. Then I have a 'Create' command button on the form which creates a new PDF file from the PDF which they are viewing in the ActiveX control, based on the numbers entered into that the grid . To do that I instantiate the 'AcroExch.PDDOC' object and use the related methods to create the new PDF file. If I were able to create my own viewer I'd have a lot more control over how they control the PDF they are viewing. One example would be, instead of having to data enter pages into a grid, they could turn to a page in the PDF they are viewing and click a button to extract the current page. Since I'm using the ActiveX to view the PDF and the SDK to edit the PDF I'm unable to do that.

I may have just made this more confusing, but that basically sums up my problem.
 
Just thought I'd ask one last time. No one knows how to create a window in a VFP form and grab the handle from that window? Thanks again.
 
CFB,
In VFP 7.0 each form has a HWnd property which is it's Window's handle. Otherwise you can get the Windows handle for a Window using this technique:

SET LIBRARY TO ( HOME()+'foxtools.fll' )
lnwhandle = _WFindTitl(THISFORM.CAPTION)
? _WhToHWnd(lnwhandle)

Rick
 
Thanks Rick, that almost did the trick, but not completely. It did lead me to another API call which seemed to work.

WHANDLE = WGetPort()
HWND = WhToHwnd(WHANDLE)

That returns the window handle of a window I created in my VFP form window using Define Window in Window. Thanks for all the help, it's greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top