Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read contents of the pdf using vim [closed]

How can we read contents of the pdf file using vim command in the terminal? I have tried using pdftk by uncompressing it but still its not working for me. Is there any other way to decrypt or decode the pdf so that we can read by the terminal in any Linux flavour using vim.

like image 393
Rohit Singhal Avatar asked Dec 19 '22 19:12

Rohit Singhal


1 Answers

If you want to read the pdf as text you can try the pdftotext command, though it won't always be beautiful. If you'd like vim to open pdf files in a pdf reader you can use something in your .vimrc like

au BufRead *.pdf sil exe "!xdg-open " . shellescape(expand("%:p")) | bd | let &ft=&ft | redraw!
like image 154
Conner Avatar answered Jan 16 '23 00:01

Conner