From: Alexander Schulz on
Hello all,

I'd like to use Matlab to save the contents of a pdf as a txt-file. The procedure as it is implemeted is to use "actxserver('Excel.Application');" and start an Excel-macro that in turn opens the pdf and saves its contents as txt:

----- VBA Code -----

Dim AcroXApp As Object
Dim AcroXAVDoc As Object
Dim AcroXPDDoc As Object
Dim jsObj As Object

Set AcroXApp = CreateObject("AcroExch.App")
AcroXApp.Hide

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

Set AcroXPDDoc = AcroXAVDoc.GetPDDoc
Set jsObj = AcroXPDDoc.GetJSObject

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

----------

I have tried to do this in Matlab:

----- m Code -----

AVDoc = actxserver('AcroExch.AVDoc');
AVDoc.Open(fileName, 'Acrobat');
AVDoc.BringToFront;

PDDoc = AVDoc.GetPDDoc;

JSObject = PDDoc.GetJSObject;

----------

I get to the point where I have a JSObject in Matlab, but I do not know how to save it. There seems to be no equivalent method that does what [jsObj.SaveAs SaveDir, "com.adobe.acrobat.plain-text"] does.

Some advice would be very much appreciated!

Thanks,
Alexander