Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Is there an easy way to extract plain text from a pdf file?

On *nix systems I used to have a command ps2ascii that would do the job, but it seems that this command is not installed by default on my Mac.

What would be the easiest way to extract text from a pdf file or, alternatively, how to get ps2ascii on my system?

share|improve this question

5 Answers 5

up vote 4 down vote accepted

Adobe Reader has a "Save as Text…" option under the File menu. Easiest way.

share|improve this answer
    
Thanks! This is by far the most simple solution, it was able to cope with my huge file without any problems and produced a reasonably clean and usable text output. –  Juan A. Navarro Sep 27 '10 at 11:14
1  
Yes, it is the easiest, but not always the cleanest output. v7 output the best, but things go haywire before and after that. Part of my job is to supply plain text versions of college textbooks to disabled college students. I have a lot of experience with this, and that's why I recommend Ghostscript if looking for the free option. –  Philip Regan Sep 27 '10 at 13:43
    
@ghoppe thanks to this easy option but it is not available in mac version of adobe,how to make it in adobe via Adobe reader? –  user11707 Oct 7 '11 at 5:35

I’m not aware of any OS X native utility that does that, however, you can install most of the unix/linux commands with any of these three methods:

Homebew: Homebrew is the easiest and most flexible way to install the UNIX tools Apple didn't include with OS X.

Fink: The Fink project wants to bring the full world of Unix Open Source software to Darwin and Mac OS X.

Macports: The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system.

Homebrew is the “new kid on the block” and promises to solve the “problems and limitations” that the other two have (whatever those problems may be). I suggest you take a look at all of them and use what you consider most flexible/simple for your needs.

There is, however, an app (Payware) that used to do that (I don’t know if it still does it). I’m talking about DEVONthink, and you can try a demo for a few days.

update: According to this post, you could install DevonThink (trial version) and extract the ‘pdftotext’ binary "which is free, of course" [sic] out of the bundle.

share|improve this answer
    
Thanks for the pointers, but which of these would actually contain ps2ascii? And which one should I prefer? –  Juan A. Navarro Sep 23 '10 at 16:10
    
MacPorts handles Ghostscript 9 (the latest version). –  Philip Regan Sep 23 '10 at 16:51
    
OS X native utility is the Adobe Reader application, which has Save as Text. –  ghoppe Sep 23 '10 at 20:21

ps2ascii is a part of Ghostscript, which can be installed on Mac OS X (and it might already be by default from the factory).

share|improve this answer
1  
Ghostscript is not included with OSX. Tho any of the methods listed below would happily install it. –  Martín Marconcini Sep 22 '10 at 14:02
    
I don't know if I'm pushing it too much but could you give me details on exactly what do I have to install and how? (Full disclaimer: I'm a fairly experienced user and I've already managed to install it, but on the beta stage of this site I would like to see how much detail and information are we to expect from people giving answers.) –  Juan A. Navarro Sep 23 '10 at 16:17
    
I think a question like that would step out of the scope of SE since there are already very detailed docs available on their site. A more suitable question in this case, as far as I see it, would be to post a question related to installation after you've tried to install it, installation fails after repeated attempts, and searching the web yields little or no answers. –  Philip Regan Sep 23 '10 at 16:49
    
good, thanks for the pointers! –  Juan A. Navarro Sep 27 '10 at 11:15

If you don't mind using a GUI, you can select text from a PDF opened with Preview.app

share|improve this answer
    
Thanks, this seems to work for simple cases. But I've got a very large document (over 1000 pages) and it almost crashes the system just by trying to select-all! –  Juan A. Navarro Sep 23 '10 at 16:09
    
An offbeat solution related to the above answer is that Acrobat 7 actually made surprisingly clean text extractions (but you are better off using a proper utility like ghostscript for something that large). –  Philip Regan Sep 23 '10 at 16:53

Use Online document converters like Saaspose.PDF that can convert your PDF file to a TXT-based document. And because its a cloud API, there is no need to download or install anything.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.