Matlab: Save pdf as txt?

  • Follow


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
0
Reply Alexander 7/1/2010 12:33:05 PM

"Alexander Schulz" wrote in message <i0i1u1$lh8$1@fred.mathworks.com>...
> 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

Anyone solved the above problem? If so, I would highly appreciate it if you could tell me how to save the PDF.

Thank you,
Rami Skaik
0
Reply r_skeik (12) 9/22/2011 8:19:26 PM


1 Replies
399 Views

(page loaded in 0.055 seconds)

Similiar Articles:













7/23/2012 10:00:32 PM


Reply: