Re: Reading a pdf text file
Re: Reading a pdf text file
- Subject: Re: Reading a pdf text file
- From: Rob Stott <email@hidden>
- Date: Tue, 25 Jan 2005 07:56:58 +0000
On 9 Jan 2005, at 15:44, Richard Smykla wrote:
After installing the xpdf-tools package, the command-line tool pdftotext can be found in the /sw/bin/ directory. (At least that is where it installed by default on my machine.) You can then use a simple Applescript 'do script' command to create a text version of your pdf.
Hi all,
I've been following this thread with interest. I have the following chunk of applescript...
set pdfPosixPath to POSIX path of (choose file with prompt "Please find the PDF")
set outputPosixPath to (pdfPosixPath & ".txt")
set theResult to do shell script ("/usr/local/pdftotext -eol mac opw 1234 -raw " & quoted form of pdfPosixPath & " " & quoted form of outputPosixPath & " ; cat " & outputPosixPath)
...this works exactly as I wanted for my English files, but certain 'foreign' characters come out strangely, for example the German character "ΓΌ". Apparently adding the option "
-enc utf-8" should work so we end up with...
set theResult to do shell script ("/usr/local/pdftotext -eol mac opw 1234 -raw -enc utf-8 " & quoted form of pdfPosixPath & " " & quoted form of outputPosixPath & " ; cat " & outputPosixPath)
...but for some reason this doesn't seem to work at all - am I doing something daft? Does anyone have any suggestions?
Any hints would be appreciated,
Thanks in advance
Rob
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden