Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scripted save as text suppress difficult pages prompt

New Here ,
Oct 17, 2016 Oct 17, 2016

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

TOPICS
Acrobat SDK and JavaScript
412
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 17, 2016 Oct 17, 2016
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines