Reputation: 95
I am trying to convert multiple files from PDF to plain text in Adobe. I found a solution online that reads:
/* PDF to Text */
this.saveAs("C:\Users\sandr\Dropbox\Light\Doctorate\Supervisor meetings\2018\October\Method\test_corpus\2sleep.tar\2sleep\2sleep\pdf\txt_output" + this.documentFileName + ".txt","com.adobe.acrobat.plain-text");
The script runs but it always gives an error saying it could not open the file and it doesn't actually create the text file. Does anyone know why this is?
Upvotes: 0
Views: 147
Reputation: 4917
Because Acrobat Javascript needs to run on both Mac and Windows, you need to use platform independent paths. Windows-specific file names and paths won't work. For example...
this.saveAs("C/Users/user/Dropbox/foo.pdf");
Also...
this.documentFileName
will have a ".pdf" extension at the end, you may want to trim that before appending the ".txt"
Upvotes: 1