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 Sun 21 Dec 2014, 17:57
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Documents
How to add pdf thumbnails to ROX?
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Author Message
dosh2684

Joined: 10 Jun 2013
Posts: 6

PostPosted: Tue 16 Dec 2014, 19:13    Post_subject:  How to add pdf thumbnails to ROX?
Sub_title: Or any file manager
 

i'd like to know if there is in any way for me to view thumbnails for all documents namely pdfs texts docs... heh i like ro view those when i browse thru rox or any file manager (if there is any).

how to go about this?
Back to top
View user's profile Send_private_message 
Semme

Joined: 07 Aug 2011
Posts: 4138
Location: World_Hub

PostPosted: Tue 16 Dec 2014, 20:03    Post_subject:  

Very Happy Though nonsense I agree, this post *may* get the ball rollin aboard Pup. As an aside, me thinks the big BOYZ have it.
_________________
>>>Punctuation Crash Course<<<
Back to top
View user's profile Send_private_message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 692
Location: nyc

PostPosted: Tue 16 Dec 2014, 20:32    Post_subject:  

http://bernaerts.dyndns.org/linux/76-gnome/285-gnome-shell-generate-libreoffice-thumbnail-nautilus

^perhaps can be adapted for puppy.
Question
Back to top
View user's profile Send_private_message 
Semme

Joined: 07 Aug 2011
Posts: 4138
Location: World_Hub

PostPosted: Tue 16 Dec 2014, 20:41    Post_subject:  

Hmm? >> http://stackoverflow.com/questions/14569551/how-to-render-pdf-into-pixbuf-with-python-and-gtk3
_________________
>>>Punctuation Crash Course<<<
Back to top
View user's profile Send_private_message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 692
Location: nyc

PostPosted: Tue 16 Dec 2014, 21:40    Post_subject:  

libreoffice gives document previews but only at launch and only in the "startcenter."
Back to top
View user's profile Send_private_message 
dosh2684

Joined: 10 Jun 2013
Posts: 6

PostPosted: Wed 17 Dec 2014, 02:40    Post_subject:  

how about rox? can rox do it?
Back to top
View user's profile Send_private_message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 692
Location: nyc

PostPosted: Wed 17 Dec 2014, 03:39    Post_subject:  

dosh2684 wrote:
how about rox? can rox do it?


not until someone more competent shows up.
Very Happy


my guess is that it can, but i'm not skilled enough to do it. it looks to me like the first script i linked to can generate the thumbnails. i don't see where it's specifically tied to nautilus, so i have no idea what to change to get it to work with rox (maybe it's just set to work with whatever is default?), but since the site says LO and OO and you also want pdf and doc/x, i'm not sure it'd fit your needs. libre itself can show previews for pretty much everything from what i've read, but i can't seem to find a way to be able to get back to the startcenter screen without first closing down the application and then restarting it. through LO seems like the simplest way since it has all the stuff needed to give the previews already built in. i'd like to see rox be able to do it as well--maybe mavrothal or mochimoppel or [there are many really skilled people here] will happen upon this thread and add something more helpful.
Back to top
View user's profile Send_private_message 
musher0


Joined: 04 Jan 2009
Posts: 4465
Location: Gatineau (Qc), Canada

PostPosted: Wed 17 Dec 2014, 03:51    Post_subject:  

Hi, dosh2684.

If you really want to see pdfs in thumbnails, I can't help you much, I know little
about image programming. (EDIT: I'm taking that back! See below!)

However, if you want to quickly see the contents of a pdf file, even faster than with
epdfview, I may have a solution.

First download and install the pets from:
http://murga-linux.com/puppy/viewtopic.php?p=745250&sort=lastpost&search_id=995947877#745250 and
http://murga-linux.com/puppy/viewtopic.php?p=745241&sort=lastpost&search_id=995947877#745241
(The latter is the real "less", not the crippled "busybox" one that ships by default in
most Puppies. This real one has many more features.)

Then put this little script in /root//my-applications/bin as file pdf2less.sh.
Code:
#!/bin/sh
# Location and title:
# ~/my-applications/bin/pdf2less.sh
# (c) musher0, 2014-12-17
####
pdftotext -layout "$@" /tmp/pdf-to.txt | view-with-less.sh /tmp/pdf-to.txt
rm /tmp/pdf-to.txt

(Included in zip file below.) pdftotext normally ships in all Puppies.

Then in rox, open folder /root/.config/rox.sourceforge.net/OpenWith/.application_pdf
and make a symlink from ~/my-applications/bin/pdf2less.sh to there.

Next time you right click over a pdf file, you'll see a new entry. Left click on it, and
your pdf will open in plain text in less. (See pic below.)

I hope this answers part of your question.
(EDIT: It should for any "txt" or similar.)

Best regards.

musher0
pdf2less.jpg
 Description   Don't worry about the instructions in French at the bottom of the window. The
"view-in-less" script is bilingual. The instructions at the bottom will show in English
in your Puppy if you have a default set-up.
 Filesize   49.78 KB
 Viewed   140 Time(s)

pdf2less.jpg

pdf2less.sh.zip
Description 
zip

 Download 
Filename  pdf2less.sh.zip 
Filesize  311 Bytes 
Downloaded  4 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Edited_times_total
Back to top
View user's profile Send_private_message Visit_website 
musher0


Joined: 04 Jan 2009
Posts: 4465
Location: Gatineau (Qc), Canada

PostPosted: Wed 17 Dec 2014, 04:26    Post_subject:  

Alternatively, if you have the pdf plugin-in installed in abiword, you can view the text
contents of any pdf file in abiword. Same principle as above: you make a link from
/usr/local/bin/defaultwordprocessor to
/root/.config/rox.sourceforge.net/SendTo/.application_pdf/.
(See pic.)
view-pdf-in-abiword.jpg
 Description   
 Filesize   40.61 KB
 Viewed   125 Time(s)

view-pdf-in-abiword.jpg


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
musher0


Joined: 04 Jan 2009
Posts: 4465
Location: Gatineau (Qc), Canada

PostPosted: Wed 17 Dec 2014, 05:12    Post_subject:  

Back to generating actual pdf thumbnails, I found this, which avoids IMageMagick's slowness.
http://www.linuxquestions.org/questions/linux-software-2/pdf-to-png-converter-57142/

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
musher0


Joined: 04 Jan 2009
Posts: 4465
Location: Gatineau (Qc), Canada

PostPosted: Wed 17 Dec 2014, 06:44    Post_subject:  

For the record, this java app generates thumbnails as well as bookmarks.
http://flavianopetrocchi.blogspot.ca/

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
musher0


Joined: 04 Jan 2009
Posts: 4465
Location: Gatineau (Qc), Canada

PostPosted: Wed 17 Dec 2014, 08:35    Post_subject:  

There you go! For pdf's at least ! Smile

Code:
#!/bin/sh
# Location and title:
# ~/my-applications/bin/pdf2thumb.sh
# (c) musher0, 2014-12-17
####
# set -xv
dirpath=${@%/*}
NOMFICHIER="`basename "$1" | cut -d. -f1`"
pdftops "$@"
cd $dirpath
pstopnm $NOMFICHIER.ps
# These little pnm* executables are pretty fussy, so
# we have to take the winding road.
for i in `ls -1 $NOMFICHIER*.ppm`;do
   pnmscale 0.2 $i > "`basename $i | cut -d. -f1`".pnm
# For thumbnails, parameter can be from 0.1 to 0.3
done
for i in `ls -1 $NOMFICHIER*.pnm`;do
   pnmtojpeg $i > "`basename $i | cut -d. -f1`".jpg
done
rm -f *.p?m
rm -f *.ps
mtpaint -v "$NOMFICHIER"00?.jpg
# set +xv
####
# Final note.
# Usage from cli:
# pdf2thumb.sh <nameof>.pdf


Usage: Same principle: copy the above and past in file pdf2thumb.sh in folder
~/my-applications/bin. Make it executable.
Then make a kink from there to folder
/root/.config/rox.sourceforge.net/OpenWith/.application_pdf.

Now when you want to view some pdf thumbnails, highlight the file, right-click on it,
choose pdf2thumbs.sh in the list, and left-click.

Note. It still takes pretty iong. The bigger the pdf, the longer the process, of course.
For example, are you really sure that you want to view the bashReference.pdf in
160 thumbnails? Twisted Evil I suppose you could take out the trash in the meantime! Wink

BTW, all valid improvements are welcome.

Enjoy! Smile

musher0
pdf2thumb.sh.zip
Description 
zip

 Download 
Filename  pdf2thumb.sh.zip 
Filesize  574 Bytes 
Downloaded  4 Time(s) 
pdf2thumb.jpg
 Description   
 Filesize   32.43 KB
 Viewed   105 Time(s)

pdf2thumb.jpg


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
Semme

Joined: 07 Aug 2011
Posts: 4138
Location: World_Hub

PostPosted: Wed 17 Dec 2014, 09:38    Post_subject:  

Very Happy I suppose organization skills and a memory couldn't hurt.

Musher, can you even read those from your systems view?

_________________
>>>Punctuation Crash Course<<<
Back to top
View user's profile Send_private_message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 692
Location: nyc

PostPosted: Wed 17 Dec 2014, 10:04    Post_subject:  

musher, does your program generate a preview for every page? if so, is there a way to limit it to just the first page? i think the main purpose of a preview thumbnail is to give a document a unique icon that helps identify its contents and visually differentiate similarly titled files, in which case the cover shot (so to speak) should be enough. i think most previews show only the first page for this reason, or at least i'm not aware of any that show more than the first page. then again, libreoffice, old memories of windows, and google drive are the only things i've used that actually give document previews, or at least so it seems to me in my morning grogginess.

anyway, cool (but if you want to look at 20 pages of a document at a time you'd probably be better off using libreoffice and making the pages fit your screen as legibly as possible).
Back to top
View user's profile Send_private_message 
musher0


Joined: 04 Jan 2009
Posts: 4465
Location: Gatineau (Qc), Canada

PostPosted: Wed 17 Dec 2014, 11:50    Post_subject:  

Semme wrote:
Very Happy I suppose organization skills and a memory couldn't hurt.

Musher, can you even read those from your systems view?


Nope! Smile Not even in mtpaint! Smile What are you getting at, man? Smile

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 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.0828s ][ Queries: 12 (0.0069s) ][ GZIP on ]