Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PDF display in Links
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
CRC
Tux's lil' helper
Tux's lil' helper


Joined: 30 Mar 2003
Posts: 90
Location: Dallas, TX, USA

PostPosted: Thu Feb 03, 2005 2:38 am    Post subject: PDF display in Links Reply with quote

If your like me and use links as the ultimate backup browser (especially when X has issues), then you've probably been missing pdf support. You can view images, get simple javascript, and use the mouse (I recommend directfb as your graphics driver, it uses the first mode in /etc/fb.modes as default - overridden with directfbrc and autodetects everything else - even my usb wacom tablet).

Anyway, for PDFs, download pdf2html from http://coolrunningconcepts.com/gentoo/pdf2html

Drop this in /usr/local/bin or wheverever you like. In Links, go to Setup->Associations. Click [Add]. For label, use "pdf2html", for Content-Type, use "application/pdf", and for Program use "/usr/local/bin/pdf2html %". If you run in high resolution, increase the DPI setting (default is 96) by adding the number after the %. For example, if you use 1024x768 try "/usr/local/bin/pdf2html % 112" Don't forget to Setup->Save options!

You'll need ghostscript and maybe a few other things installed to use it. The script runs SLOW as it has to make PNGs of each page. Be patient (or go into the code and comment the pstoimg line and uncomment the gs line right above it, which turns off antialias, cropping, and a few other features - IOW, it looks really bad for a slight speed up).

When your done viewing the PDF, use 'Q' to quit the second copy of links that the script launches and go back to your original copy. Don't try to use any other features like OS Shell when viewing the PDF. There's 2 copies of links running and you don't want to confuse the terminal!

PDF information displayed in the index is only as accurate as the PDF since many PDF creators don't bother with proper titles, etc.

Have fun - and let me know if you have problems or changes by replying here. I haven't even bothered to clean it up or speed up anything. Its just a first-born hack script, so be nice to it!
_________________
Unix/Linux Consulting & Hosting
We Support Gentoo!
http://CoolRunningConcepts.com

Freenode: Taro!
Back to top
View user's profile Send private message
CRC
Tux's lil' helper
Tux's lil' helper


Joined: 30 Mar 2003
Posts: 90
Location: Dallas, TX, USA

PostPosted: Fri Feb 04, 2005 5:59 pm    Post subject: Reply with quote

Justa quick note: I updated the script the other day. There were some minor errors with the information display. Still slow as *&%$ though.

Apparently, another method is to use fbgs,which is part of the fbi package, but I've limited luck using it, and my machine is borked right now, so I'm sticking with my script.
_________________
Unix/Linux Consulting & Hosting
We Support Gentoo!
http://CoolRunningConcepts.com

Freenode: Taro!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum