LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   view pdf in terminal? (https://www.linuxquestions.org/questions/slackware-14/view-pdf-in-terminal-599593/)

tramni1980 11-14-2007 10:37 AM

view pdf in terminal?
 
Hello!
I am running Slackware Linux 12.0. I would like to ask whether there is a tool for viewing pdf files in terminal? (ncurses based or whatever).

Thank you.

pwc101 11-14-2007 10:45 AM

You can convert the pdf to ascii with pdftotext, and view that. But it really depends on what kind of information you want to see in the pdf - pictures or text?

tramni1980 11-14-2007 11:10 AM

Quote:

Originally Posted by pwc101 (Post 2958735)
You can convert the pdf to ascii with pdftotext, and view that. But it really depends on what kind of information you want to see in the pdf - pictures or text?

I would be glad if it could be possible to view the pdf as it is, inevitably allowing for deteriorated quality, of course. I just wondered if there is such a tool that I am not aware of.

H_TeXMeX_H 11-14-2007 11:26 AM

You can view images and you can view text using svgalib.

So, here's something to try:
Use 'pdftoppm' to convert pdf to ppm, then use 'seejpeg' to view the ppm using svgalib.

Quote:

PACKAGE NAME: seejpeg-1.10-i386-1
COMPRESSED PACKAGE SIZE: 53 K
UNCOMPRESSED PACKAGE SIZE: 120 K
PACKAGE LOCATION: /var/log/mount/slackware/ap/seejpeg-1.10-i386-1.tgz
PACKAGE DESCRIPTION:
seejpeg: seejpeg (console JPEG viewer)
seejpeg:
seejpeg: Seejpeg is an image viewer which uses SVGAlib. In spite of the name,
seejpeg: it understands the JPEG, GIF, PPM, BMP and TARGA formats. One nice
seejpeg: feature of seejpeg is that it automatically decides on the best video
seejpeg: mode to use based on the image being displayed and the video card
seejpeg: being used.
seejpeg:
seejpeg: Evan Harris is the author of seejpeg.
seejpeg:
seejpeg:

tramni1980 11-14-2007 12:31 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 2958776)
You can view images and you can view text using svgalib.

So, here's something to try:
Use 'pdftoppm' to convert pdf to ppm, then use 'seejpeg' to view the ppm using svgalib.

I tried this but it does not seem to work right out of the box. When I issue in the terminal without X:
seejpeg opit.ppm-000001.ppm
I get :

svgalib: ark: Unknown chiptype 0.
Warning: you have not yet configured your mouse type. If you have no mouse,
setting the type to `none' in /etc/vga/libvga.config will get rid of this
annoying message.
svgalib: Failed to initialize mouse.
Cannot find a 32K/16M colour video mode
svgalib: Signal 8: Floating point exception received.

If I issue the same command in the kde konsole I get:
svgalib: can't open /dev/console

Is there somewhere a guide on configuring this to work?

BCarey 11-14-2007 12:53 PM

Quote:

Originally Posted by tramni1980 (Post 2958752)
I would be glad if it could be possible to view the pdf as it is, inevitably allowing for deteriorated quality, of course. I just wondered if there is such a tool that I am not aware of.

Here is one: http://linux.bytesex.org/fbida/ . It compiles fine with src2pkg. Quality of images isn't too great, obviously.

Brian

tramni1980 11-14-2007 01:03 PM

Quote:

Originally Posted by BCarey (Post 2958846)
Here is one: http://linux.bytesex.org/fbida/ . It compiles fine with src2pkg. Quality of images isn't too great, obviously.

Brian

Thank you very much! That is exactly what I needed :)

H_TeXMeX_H 11-14-2007 01:05 PM

Well, you'll have to edit '/etc/vga/libvga.config', there are notes in there to help you configure it, also read 'man libvga.config'.


All times are GMT -5. The time now is 09:50 PM.