Planet PDF Forum Archive

Planet PDF  ForumThe page you are viewing is part of our 160,000 page discussion forum archive. See below for PDF-related discussions spanning 1999-2008. To ask questions and get help, head to the live Planet PDF Forum.


How to search this archive. The quickest way is to use the filters on our Advanced Search page so that only archive pages are included in the results.


Previous | Next | (P-PDF) Developers


Topic: Re: GetJSObject() from C++
Conf: (P-PDF) Developers, Msg: 105982
From: kirkoman
Date: 2/14/2004 08:15 AM

> Then what if you use the new AddDocumentJavaScript() command to
> add a JS and then call it from your ExecuteThisJavaScript()??

I tried this, but it did not work. Turns out I was not quite right about the restrictions on SaveAs(). It is actually in the JS Ref, but I did not read carefully enough: SaveAs() is disabled except from console, batch, and menu events. In other words, you just plain *have* to open the the Acrobat app and touch a button or type something in order to save in a different format. This policy seems intentionally to disallow externally-scripted conversion of files. I guess I can understand this, since they have to protect Acrobat from being turned into a server.

So I'm giving up on this feature - maybe in the future we will write a plugin or some kind of workflow that starts from Acrobat.

Thanks for your help, Leonard.

To anyone else trying to find out how to get the OLE Automation interface working from C++: Even though the IDispatch object returned by GetJSObject() does not give up its ITypeLib, you *can* find and invoke methods and properties on it by name. As I discovered after my initial post, the only problem with my attempt to get the dispatch ID of the "app" object (see the code from my first post) is that I was not using a wide string for the "app" constant (oops!). It should read:

OLECHAR FAR *rgszNames = (unsigned short *)L"app"; // Note the "L"

Good luck

PDF In-Depth Free Product Trials Ubiquitous PDF

Pitstop Pro

Now graphic arts professionals have even broader and more expert control over their PDF documents. With...

Download free demo

ARTS PDF Aerialist

The ultimate plug-in for Adobe Acrobat and #1 selling product at PDF Store. Advanced splitting, merging,...

Download free demo

Ubiquitous PDF: 2009 IRS income tax forms available for download

With less than a month to go until Americans will be scrambling to file their 2009 tax paperwork. Luckily, printable PDF versions of forms such as the 1040 can be downloaded for free from the IRS website.

March 18, 2010
Search Planet PDF
more searching options...







Download PDF Creator

PDF Resources
Platinum Sponsor
Create & Edit PDF - Nitro PDF Software

ARTS PDF

Silver Sponsors

PDF-Tools QuickPDF: The Unrivaled PDF Developer Toolkit

Get Nitro PDF Professional
Featured Product

NITRO PDF Professional

Built from the ground up, the perfect desktop PDF product for business and enterprise. Nitro PDF Professional has an uncompromising feature set so you can create, combine, edit, collaborate on and...

Featured Event

No upcoming events

PDF Store Categories