Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 21 Oct 2014, 17:55
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Documents
Zathura PDF viewer
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Author Message
Iguleder


Joined: 11 Aug 2009
Posts: 1922
Location: Israel, somewhere in the beautiful desert

PostPosted: Fri 08 Jul 2011, 09:16    Post_subject:  Zathura PDF viewer
Sub_title: Minimalistic PDF viewer
 

Here's the best PDF viewer I've ever seen: Zathura.

Very minimalistic, very very very lightweight and awesome for small screens.

zathura-0.0.8.3.pet
Description 
pet

 Download 
Filename  zathura-0.0.8.3.pet 
Filesize  30.27 KB 
Downloaded  677 Time(s) 
zathura-0.0.8.3.tar.gz
Description  sources
gz

 Download 
Filename  zathura-0.0.8.3.tar.gz 
Filesize  33.58 KB 
Downloaded  440 Time(s) 

_________________
My homepage
Back to top
View user's profile Send_private_message Visit_website MSNM 
ICQ 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Fri 08 Jul 2011, 10:00    Post_subject: zathura documentation  

Dear Iguleder,

Many thanks for this little gem. It actually works nicely, but you have to know the keystrokes, which might not be obvious. To that end, here is a little pdf file made from the man page. The main thing to remember are the keys "a" and "s" (zoom to fit and zoom to fit respectively).

With kind regards,
vovchik

PS. It compiles nearly instantly with a simple make file.
zathura.pdf.tar.gz
Description 
gz

 Download 
Filename  zathura.pdf.tar.gz 
Filesize  25.86 KB 
Downloaded  497 Time(s) 
Back to top
View user's profile Send_private_message 
ttuuxxx


Joined: 05 May 2007
Posts: 10821
Location: Ontario Canada,Sydney Australia

PostPosted: Fri 08 Jul 2011, 10:08    Post_subject:  

sounds like someone should take this on as a project and add a simple gui with zoom/print screen, file open dialog, next and previous page and that's about it Smile
ttuuxxx

_________________
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games Smile
Back to top
View user's profile Send_private_message Visit_website 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Tue 12 Jul 2011, 13:42    Post_subject: Zathura PDF viewer  

ttuuxxx wrote:
sounds like someone should take this on as a project and add a simple gui with zoom/print screen, file open dialog, next and previous page and that's about it Smile
ttuuxxx

Maybe I could be the one if it worked in wary Sad Question
Code:
# zathura
zathura: error while loading shared libraries: libpoppler-glib.so.4: cannot open shared object file: No such file or directory
#
Back to top
View user's profile Send_private_message 
ttuuxxx


Joined: 05 May 2007
Posts: 10821
Location: Ontario Canada,Sydney Australia

PostPosted: Tue 12 Jul 2011, 15:22    Post_subject: Re: Zathura PDF viewer  

L18L wrote:
ttuuxxx wrote:
sounds like someone should take this on as a project and add a simple gui with zoom/print screen, file open dialog, next and previous page and that's about it Smile
ttuuxxx

Maybe I could be the one if it worked in wary Sad Question
Code:
# zathura
zathura: error while loading shared libraries: libpoppler-glib.so.4: cannot open shared object file: No such file or directory
#

just locate libpoppler-glib.so and make a system link called libpoppler-glib.so.4 and iy should work.
ttuuxxx

_________________
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games Smile
Back to top
View user's profile Send_private_message Visit_website 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Tue 12 Jul 2011, 15:58    Post_subject: Re: Zathura PDF viewer
Sub_title: libpoppler-glib.so
 

ttuuxxx wrote:
just locate libpoppler-glib.so and make a system link called libpoppler-glib.so.4 and iy should work.

Code:
# ln -s /usr/lib/libpoppler-glib.so.5.0.0 /usr/lib/libpoppler-glib.so.4

Thank you Smile
that was in wary511q
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Thu 14 Jul 2011, 15:15    Post_subject: Zathura PDF viewer
Sub_title: simple gui open file and shortcuts
 

simplePDFreader
download to /root/my-applications/bin
dependency: yad (pet-packages-common: yad and yad-nls)

Code:
#!/bin/sh
#
# simplePDFreader: gui for zathura pdf reader
# 2011-07-14 2011-07-17 L18L seaside
# required: yad version >= 0.9.0
#
RESTART=$0
file=$1            # file to read
#
export TEXTDOMAIN=simple_yad
export OUTPUT_CHARSET=UTF-8
#

title=$(gettext "simplePDFreader zathura")
zathura_manual=`find -name zathura.pdf` # <smile>
echo $zathura_manual

shortcuts="<b> $(gettext 'Shortcuts (^ is Ctrl)') </b>
 <span color='red'>J</span>   $(gettext 'Go to next page')
 K   $(gettext 'Go to previous page')
 h   $(gettext 'Scroll to the left')
 k   $(gettext 'Scroll upwards')
 j   $(gettext 'Scroll downwards')
 ^f   $(gettext 'Scroll page down')
 ^b   $(gettext 'Scroll page up')
 ^d   $(gettext 'Scroll half a page down')
 ^u   $(gettext 'Scroll half a page up')
 l   $(gettext 'Scroll to the right')
 <span color='red'>+</span>   $(gettext 'Zoom in')
 -   $(gettext 'Zoom out')"
 
exitus(){
 kill `cat /tmp/simplePDFreader_PID` 2> /dev/null
 kill `cat /tmp/simplePDFreader_mPID` 2> /dev/null
 exit 0   
}

select_directory()
{
 dir=$(yad --title="$title" \
           --width="450"    \
           --height="300"   \
           --separator=""   \
           --text="    <span stretch='expanded' color='#330099'>$(gettext 'select the <b>directory</b> where to search for PDF files</span>')"   \
           --file-selection           \
           --directory      \
           --filename="/usr/share/examples/"      \
       )
[[ $? -eq 1 ]] && exitus
 list_pdfs_of_dir $dir
}

list_pdfs_of_dir()
{
 dir=$1
 file=""
 until [ "$file" != "" ]
 do
  file=$(find $1 -name '*.pdf' | yad --title="$title" \
        --height="250"                                \
        --separator=""                                \
        --text="    <span stretch='expanded' color='#009933'><i>$(gettext 'Select the <b>file</b> you want to read:</i></span>')"   \
        --list --column="PDF files in your $dir directory"  \
        --button="gtk-go-up:3" \
        --button="gtk-find:2"  \
      --button="gtk-help:4"  \
      --button="gtk-quit:1"  \
      --button="gtk-ok:0"    \
       )
  result=$?     
  case $result in
  1) exitus ;;
  2) select_directory ;;
  3) dir=`dirname $dir` ; list_pdfs_of_dir $dir ;;
  4) if [ "$zathura_manual" != "" ]
     then
      shortcuts
      zathura "$zathura_manual" &
      mPID=$!
      echo $mPID > /tmp/simplePDFreader_mPID
     else yad --button="gtk-ok" --text="Sorry, missing zathura.pdf"
     fi
     ;;
  esac
 done
 echo "file=$file"
 [ "$file" = "" ] && select_directory
}

shortcuts()
{
 if [ `ps | grep 'yad --title=simplePDFreader' | wc -l` -lt 2 ]
 then
  ## Shortcuts top left sticky
  yad --title="simplePDFreader" --text="$shortcuts" --no-buttons --geometry="80x200+0+0" --sticky &
  sPID=$!
  echo $sPID > /tmp/simplePDFreader_PID
 fi
}

##  if no argument we start showing a list of pdf files under $HOME
 [ ! -f "$file" ] && list_pdfs_of_dir $HOME

shortcuts

## lauch viewer
echo lauch viewer $file
zathura "$file"

# continue
file="`echo $file | tr ' ' '_'`"     # just to make sure that dirname will work
echo "file=$file"
dir=`dirname $file`
 [ "$dir" = "" ] && dir=/usr/share     # there are some pdf's
echo "continue dir=$dir/"
list_pdfs_of_dir "$dir/"
$RESTART "$file"
#end of script
zathura-gui.png
 Description   -
 Filesize   20.72 KB
 Viewed   4037 Time(s)

zathura-gui.png


Edited_times_total
Back to top
View user's profile Send_private_message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Thu 14 Jul 2011, 18:16    Post_subject:  

L18L,

That's a good start for a Zathura PDF viewer gui.

There are a few items that you might want to add.

If you use this following form of directory selection, you won't need two dialogs, be able to go to any directory and, additionally, you'll get a *.pdf filter.
Code:
yad  --file-selection --file-filter="Pdf files | *.pdf"


Also, the font command is "--font=" (not "--fontname=") and the "on-top" command doesn't work, but can be utilized by making a "--class" with a matching entry in JWM.

Cheers,
s
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Fri 15 Jul 2011, 16:42    Post_subject: Zathura PDF viewer
Sub_title: simpleGUI
 

seaside,

thank you for your comment
on-top does not work
fontname does not work -> it is used for preselecting a font in fontselect

Thanks for explaining the filter thing

But I want 2 dialogs:

Starting the script with a file, after closing zathura you get a list of pdf files to choose from
because I think this is the intuitive way to continue.
Another choice is using the find button and here see only directories.
The default is now /usr/share/examples where there are pdf´s.

Starting without a file, all pdf´s under $HOME are listed.

I am going to overwrite the above script now. go-up button added.
zathura-gui2.png
 Description   script see 2 posts up
 Filesize   25.66 KB
 Viewed   3650 Time(s)

zathura-gui2.png

Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3337
Location: Ontario

PostPosted: Sat 16 Jul 2011, 11:53    Post_subject:  

I put Zathura in Right-click-4.9.7
for Lucid Puppyand Wary

To remind people of the key shortcuts I put
'a' and 's' in the right click menu


For more info
http://www.murga-linux.com/puppy/viewtopic.php?t=67013
Back to top
View user's profile Send_private_message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Sat 16 Jul 2011, 17:03    Post_subject: Re: Zathura PDF viewer
Sub_title: simpleGUI
 

L18L wrote:

Starting the script with a file, after closing zathura you get a list of pdf files to choose from
because I think this is the intuitive way to continue.
Another choice is using the find button and here see only directories.
The default is now /usr/share/examples where there are pdf´s.

.


L18L,

I have tested this with Yad 0.9.0 on pup431 (would have to upgrade GTK to compile the latest Yad Smile ) and the "find" button doesn't produce anything. The reason is that there are several options used which are newer and not in Yad 0.9.0.

What version of Yad are you using?

Cheers,
s

EDIT:

Actually, if the following change is made, it works as you described. Change "--file' to "--file-selection" and delete "--dclick-action" in the "select_directory" function. It would now read -
Code:
select_directory()
{
 dir=$(yad --title="$title" \
           --width="450"    \
           --height="300"   \
           --separator=""   \
           --text="    <span stretch='expanded' color='#330099'>$(gettext 'select the <b>directory</b> where to search for PDF files</span>')"   \
           --file-selection           \
           --directory      \
           --filename="/usr/share/examples/"      \
           
       )
[[ $? -eq 1 ]] && exitus
 list_pdfs_of_dir $dir
}
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Sun 17 Jul 2011, 08:25    Post_subject: Zathura PDF viewer
Sub_title: gui, yad version
 

seaside,
thank you. It is very good making this script workable in yad 0.9, too Very Happy

I have been overwriting the script (see 5 posts above) now,
added a help button
which launches vovchik´s zathura.pdf
if available anywhere on the system.

vovchik,
where did you get the man page from?
(I think the help button should point to the man page directly)

Thanks for testing and feedback
l
zathura-gui3.png
 Description   script see 5 posts above
 Filesize   16.18 KB
 Viewed   3634 Time(s)

zathura-gui3.png


Edited_time_total
Back to top
View user's profile Send_private_message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Sun 17 Jul 2011, 08:47    Post_subject: zathura manual  

Dear L18L,

I got the manpage from the tarball and made my own pdf Smile The archived manpage is attached. The tarball is here: https://pwmt.org/projects/zathura/.

With kind regards,
vovchik
zathura.1.tar.gz
Description 
gz

 Download 
Filename  zathura.1.tar.gz 
Filesize  1.67 KB 
Downloaded  431 Time(s) 
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Sun 17 Jul 2011, 09:20    Post_subject: zathura manual  

Dear vovchik,

thank you very much making me RTFM (read the Fine manual) Smile
Moved zathura.1.gz to /usr/share/man/1 and
Code:
man zathura
works.

Kind regards
l
Quote:
Version 0.0.8.4 fixes several bugs
Back to top
View user's profile Send_private_message 
keniv

Joined: 06 Oct 2009
Posts: 200
Location: Scotland

PostPosted: Mon 18 Jul 2011, 18:37    Post_subject:  

Hi L18L

I cannot get your gui script to work on 525. I am not sure I am doing the right thing. This is what I have done. I copied your script to a new file in my-applications/bin. I made this file executable. When I click on this file I get a small box With "simple pdf read" and a cancel and ok box. This box does nothing and cannot be closed or killed. To get rid of it I have to restart X. I am using the version of yad in your link. Bellow is the output when I run the script in a terminal then press the ok button on the box that appears.

.

Code:
/root/my-applications/bin/NewFile: line 70: --height=250: command not found
/root/my-applications/bin/NewFile: line 71: --separator=: command not found
/root/my-applications/bin/NewFile: line 72: --text=    <span stretch='expanded' color='#009933'><i>Select the <b>file</b> you want to read:</i></span>: No such file or directory
/root/my-applications/bin/NewFile: line 73: --list: command not found
/root/my-applications/bin/NewFile: line 74: --button=gtk-go-up:3: command not found
/root/my-applications/bin/NewFile: line 75: --button=gtk-find:2: command not found
/root/my-applications/bin/NewFile: line 76: --button=gtk-help:4: command not found
/root/my-applications/bin/NewFile: line 77: --button=gtk-quit:1: command not found
/root/my-applications/bin/NewFile: line 78: --button=gtk-ok:0: command not found


Zathura itself is working ok. I really like it.

I would appreciate any help you can give me.

Regards,

Ken.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Documents
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1253s ][ Queries: 12 (0.0148s) ][ GZIP on ]