Skip to main content
Participant
October 17, 2016
Question

Scripted save as text suppress difficult pages prompt

  • October 17, 2016
  • 1 reply
  • 435 views

Hello All

I have the VBA code below for batch saving PDFs as text - pretty standard (/borrowed) code. The save path and file
name gets fed in by the calling routine (that recurses through a folder structure).

Problem is I keep getting a prompt "Some difficult pages were enountered requiring all graphics on those pages
to be labeled as figures. [1,2]". This obviously defeats the idea of a hands-off batch process. Can anyone help
out with how to defeat this? I can't see anything documented for the SaveAs() method.

Why am I doing the in VBA not Acrobat JavaScript? I couldn't get the script to work - it's a whole other story (/possible posting).

Thanks

Dim AcroXApp As Acrobat.Acroapp
Dim AcroXAVDoc As Acrobat.AcroAVDoc
Dim AcroXPDDoc As Acrobat.AcroPDDoc

Set AcroXApp = CreateObject("AcroExch.App")

Set AcroXAVDoc = CreateObject("AcroExch.AVDoc")
AcroXAVDoc.Open FileToConvert, "Acrobat"

Set AcroXPDDoc = AcroXAVDoc.GetPDDoc

Dim jsObj As Object
Set jsObj = AcroXPDDoc.GetJSObject

'start to create new file name
textFileName = Left(FileToConvert, Len(FileToConvert) - 4) + ".txt"

jsObj.SaveAs textFileName, "com.adobe.acrobat.plain-text"

AcroXAVDoc.Close False
AcroXApp.Hide
AcroXApp.Exit

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
October 17, 2016

In Acrobat DC Pro you can use the Action Wizard for this.