These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

API Method to Save pdf as text?

cormanaz
Registered: Jan 30 2009
Posts: 3

Greetings. I have been beating my head against a wall for the last couple of days trying to find the answer to this, and I was told this is where the Wizards hang out. What API method to you use to save pdf doc (that you have opened with the API) as a text file, i.e. the equivalent of clicking "Save As..." and selecting the text from the drop down? This seems to be a great mystery to a lot of people. If someone could point me to some docs or an example I would be very grateful.

Many TIA...

Steve

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The Doc.SaveAs() function has a conversion ID option that is equivalent to the type pull down.

this.saveAs({cPath:<...>, cConvID:"com.adobe.Acrobat.plain-text"});Howerver, this fucntion must be called from a privileged context, i.e., a trusted fuction. You can look all of the up in the Acrobat JavaScript References, and the Guide (different document, links below)

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script