Skip to main content
IliaD
Participant
Jun 15, 2017 6:39 AM UTC
Question

VBA: use SetPreferenceEx to change Convert From PDF settings?

Hi! Is it possible to use SetPreferenceEx to change Convert From PDF settings?

I am using Acrobat XI Pro from VBA to convert a large number of PDFs to Word documents. In order to do this I need to programmatically change "Convert From PDF" settings, in particular disable the OCR.

Is SetPreferenceEx the right function for that? Where can I find a list of all preferences that can be set by SetPreferenceEx?

Thanks for any help.

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

IliaD
IliaDAuthor
Participant
Jun 15, 2017 9:22 AM UTC

Yes, its in SDK, I am using VBA to open a PDF file in Acrobat and then call SaveAs (via JavaScript). Here is the VBA code:

Dim objAcroApp As Object, objAcroAVDoc As Object, objAcroPDDoc As Object, objJSO As Object

'Initialize Acrobat by creating App object and setting AVDoc object

Set objAcroApp = CreateObject("AcroExch.App")

Set objAcroAVDoc = CreateObject("AcroExch.AVDoc")

'Open the PDF file

objAcroAVDoc.Open("SomeFile.pdf")

'Obtain the PDDoc object and the Java Script Object

Set objAcroPDDoc = objAcroAVDoc.GetPDDoc

Set objJSO = objAcroPDDoc.GetJSObject

'Save PDF file to the .docx format

objJSO.SaveAs("SomeFile.docx", "com.adobe.acrobat.docx")

'Close the PDF file without saving the changes.

objAcroAVDoc.Close(True)

Translate
Legend
Jun 15, 2017 8:19 AM UTC

Which API method are you using to do the conversion? Is it in the SDK?

Translate