How to: Open PDF files in a Linux Console using fbgs, a framebuffer PDF viewer

Another day, another command line/Console based application. Just to refresh your memory, last time we told you about a Linux framebuffer Image viewer, Fbi, that lets you view images without a X server. This time I will introduce you to fbgs, a console based PDF/Postscript viewer which makes use of fbi to view PDFs.

Fbi actually is just a wrapper script which renders the pdf pages using ghostscript and calls fbi to display them.

Install fbgs on Ubuntu or Fedora based systems

In both Ubuntu and Fedora based systems, the package comes integrated with fbi. So, for Debian/Ubuntu based systems, either click this link or run the following command to install it.

[shredder12]$ sudo apt-get install fbi

For Fedora, the package is under the name fbida. Use the following command to install it.

[shredder12]$ su -c 'yum install fbida'

The usage is simple. You will need root permission though.

[shredder12]$ sudo fbgs random.pdf

At since fbgs makes use of fbi, if you haven't already used it, you might get this error

can handle only packed pixel frame buffers

The solution to fix this issue is already explained in the fbi image viewer post. Please take a look at it to resolve this problem.

Fbgs options

Fbgs accepts all the paramters for fbi, but you probably won't need it, default works fine. However, it also has its own parameters that might be useful.

  • If the PDF file is password protected, use the -p option to open it.

[shredder12]$ sudo fbgs -p  this_is_password  file.pdf

  • Another option is to set the dpi of the page rendered. The available options are -l, -xl, -xxl to set 100, 120 or 150 dpi respectively. DPI stands for dots per inch, so the larger you select, it presents a more compact page. The default is 75 dpi.
  • If you want fbgs to render the pages in colour, use the -c flag.

2 Comments

Anon Linuxer (not verified)
August 20th, 2010 11:01 am
thanks for the tips,very useful.
Anon Linuxer (not verified)
September 3rd, 2010 02:22 pm
Your article is very good, I learn a lot from you,thank you!

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <p> <br>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.