Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to see pdf files available on our cluster rather than copying them into my local machine and than visualize. Please tell me how can i do this.

share|improve this question
    
See also unix.stackexchange.com/questions/36201/… –  Marco Jun 22 '12 at 12:03
1  
If you're connectiong to the cluster with ssh, I recommend using SSHFS. It provides a common solution to all “How do I do X with remote files” issues. –  Gilles Jun 23 '12 at 0:49

4 Answers 4

In many systems less uses lesspipe, which can handle pdftotext automatically. Therefore, you can immediately try

 less file.pdf

which will show the output of pdftotext in less.

share|improve this answer
    
+1 I did not know this. You just made my day! –  KennyPeanuts Jun 22 '12 at 13:38
    
+1 Wow! Awesome trick! –  helpermethod Feb 27 '13 at 14:29

I guess, it is not possible to see PDF file in terminal but you can check it's content by converting PDF file to text. You can do this as:

pdftotext a.pdf

It will produce a.txt file which you can read into VIM.

For ubuntu-variant, this binary is available in following package.

poppler-utils

share|improve this answer

One more solution is to use command gnome-open

gnome-open youfile.pdf

Provided that you have login your server with -X option (ssh -X)

share|improve this answer
    
How does this view the PDF file in the terminal? –  Michael Kjörling Feb 27 '13 at 12:27
    
Not on terminal, but can view a pdf on issuing command from terminal. –  bioinformatician Feb 28 '13 at 12:40
    
While that is true, the OP did specifically ask for a terminal-based approach. –  Michael Kjörling Feb 28 '13 at 20:52

When I want to "view a pdf file in terminal", that for me means that I want to actually see an uncompressed PDF, I do:

pdftk in.pdf output out.pdf uncompress

I always wondered why both less in.pdf and less out.pdf give me just text strings in the PDF (and excluding the text-only PDF commands I'd expect in out.pdf).

Well, that happens because of the lesspipe assuming I want pdftotext being run first - and since here I don't, I have to specifically disable the lesspipe by setting LESSOPEN environment variable to nothing; that is:

$ LESSOPEN="" less out.pdf

And finally, I can view the uncompressed PDF code using less

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.