在Linux/Free BSD 下打开PDF文件

Howto Open a PDF file under Linux / FreeBSD

值得注意的是在终端 terminal 中查看pdf文件的方法。


PDF is an acronym for Portable Document Format. It is a proprietary file format developed by Adobe Systems for representing two-dimensional documents in a device independent and resolution independent format. You can open pdf file using graphical as well as command line tools (i.e. without GUI). Linux supports following PDF viewer under X window:

◾Gnome pdf viewer (gpdf)
◾KDE pdf viewer (kpdf)
◾xpdf
◾Official Adobe acrobat reader

Graphic pdf viewer under Linux/FreeBSD

If you are using Gnome desktop...

Open a shell prompt and type the command:

$ gpdf file.pdf

在RHEL5 gpdf 已经被舍弃,换做命令 evince

or:

$ evince file.pdf

If you are using KDE desktop...

Open a shell prompt and type the command:

$ kpdf file.pdf

You can also click on K icon > Select Graphics > Select PDF viewer

Console pdf viewer under Linux/FreeBSD

Console pdf viewer

As far as I know there is no console based PDF viewer exists. But you can use the following trick to open a PDF file:

a) First install pdftohtml - A command-line tool for converting pdf-files into html and other formats.

Debian User install pdftohtml using following command:

# apt-get install pdftohtml

Red Hat / Fedora user install pdftohtml using following command:

# yum install pdftohtml

FreeBSD user install pdftohtml using following command:

# pkg_add -v -r pdftohtml

OR use ports collection:

# cd /usr/ports/textproc/pdftohtml
 # make; make install

The idea is very simple you will use a pdftohtml program to convert a PDF file into html, xml and png images and then display them using text browser such as elinks or lynx. This is useful when you works on remote server or if GUI is not available:
For example to convert CH09.PDF file you need to type the following set of commands:
$ pdftohtml CH09.PDF
 $ lynx CH09.html
OR
$ elinks CH09.html
You can also convert a PDF file to text file using following command:
$ pdftotext CH09.pdf
$ vi CH09.txt
See also

=> You can get Official Adobe acrobat reader here for UNIX/Linux oses.





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值