How to add pdf thumbnails to ROX?
How to add pdf thumbnails to ROX?
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?
how to go about this?
- Puppus Dogfellow
- Posts: 1667
- Joined: Tue 08 Jan 2013, 01:39
- Location: nyc
- Puppus Dogfellow
- Posts: 1667
- Joined: Tue 08 Jan 2013, 01:39
- Location: nyc
- Puppus Dogfellow
- Posts: 1667
- Joined: Tue 08 Jan 2013, 01:39
- Location: nyc
not until someone more competent shows up.dosh2684 wrote:how about rox? can rox do it?
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.
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. ... 877#745250 and
http://murga-linux.com/puppy/viewtopic. ... 877#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.
(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
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. ... 877#745250 and
http://murga-linux.com/puppy/viewtopic. ... 877#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: Select all
#!/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
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
- Attachments
-
- pdf2less.jpg
- 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. - (49.78 KiB) Downloaded 322 times
-
- pdf2less.sh.zip
- (311 Bytes) Downloaded 285 times
Last edited by musher0 on Wed 17 Dec 2014, 12:55, edited 2 times in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
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.)
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.)
- Attachments
-
- view-pdf-in-abiword.jpg
- (40.61 KiB) Downloaded 306 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to generating actual pdf thumbnails, I found this, which avoids IMageMagick's slowness.
http://www.linuxquestions.org/questions ... ter-57142/
http://www.linuxquestions.org/questions ... ter-57142/
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
For the record, this java app generates thumbnails as well as bookmarks.
http://flavianopetrocchi.blogspot.ca/
http://flavianopetrocchi.blogspot.ca/
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
There you go! For pdf's at least !
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? I suppose you could take out the trash in the meantime!
BTW, all valid improvements are welcome.
Enjoy!
musher0
Code: Select all
#!/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
~/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? I suppose you could take out the trash in the meantime!
BTW, all valid improvements are welcome.
Enjoy!
musher0
- Attachments
-
- pdf2thumb.sh.zip
- (574 Bytes) Downloaded 237 times
-
- pdf2thumb.jpg
- (32.43 KiB) Downloaded 291 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- Puppus Dogfellow
- Posts: 1667
- Joined: Tue 08 Jan 2013, 01:39
- Location: nyc
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).
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).
Now you tell me! Ok, guys, version 2 coming up!Puppus Dogfellow wrote:musher, [...] 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. [... ]
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Hi, guys.
Best I can do ATM taking into consideration the remarks of both of you. For some
reason, if the # of p. is limited to 1 in pdftops, later, pmnmscale doesn't like ti. So
we have 2 pages minimum. Also, I don't like the wide whitespace at the top and at
the right, and the guilty program should be hunted down later. Finally, if we want to
be able to read the content, IMO, these are not "thumbnails" anymore, simply
"reduced-size images".
Which is why it's not version 2 yet, only version 1a! Sorry. Again, you're welcome
to fiddle with the script to improve it. BFN.
musher0
Best I can do ATM taking into consideration the remarks of both of you. For some
reason, if the # of p. is limited to 1 in pdftops, later, pmnmscale doesn't like ti. So
we have 2 pages minimum. Also, I don't like the wide whitespace at the top and at
the right, and the guilty program should be hunted down later. Finally, if we want to
be able to read the content, IMO, these are not "thumbnails" anymore, simply
"reduced-size images".
Which is why it's not version 2 yet, only version 1a! Sorry. Again, you're welcome
to fiddle with the script to improve it. BFN.
musher0
#!/bin/sh
# Location and title:
# ~/my-applications/bin/pdf2thumb-1a.sh
# Version 1a, for Semme and PuppusDogfellow!
# (c) musher0, 2014-12-17
####
# set -xv
dirpath=${@%/*}
NOMFICHIER="`basename "$1" | cut -d. -f1`"
pdftops -f 1 -l 2 "$@"
cd $dirpath
pstopnm -xsize=700 -ysize=900 -portrait $NOMFICHIER.ps
# -dpi=300, no.
# 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.9 $i > "`basename $i | cut -d. -f1`".pnm
# This is barely readable... # Still, for real thumbnails, parameter should 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
wait
rm -f *.p?m
rm -f *.ps
mtpaint -v "$NOMFICHIER"00?.jpg || defaultimageviewer "$NOMFICHIER"00?.jpg
# set +xv
####
# Final note.
# Usage from cli:
# pdf2thumb.sh <nameof>.pdf
- Attachments
-
- article001.jpg
- I removed about an inch of whitespace at the top and right borders...
Readable... barely. :) - (60.39 KiB) Downloaded 273 times
Last edited by musher0 on Wed 17 Dec 2014, 22:49, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Hi Semme.Semme wrote:To our OP, Dosh.. What's the *target icon size* here, and *where* are
you accustomed to viewing such a preview?
I'd suggest that Dosh is a WhineDose refugee. WhineDose Explorer has it and a couple of
document organiszers in WhineDose * Seven.
musher0
~~~~~~~
* The OS that Whines if it doesn't get it's Dose (of anti-something). Hey, man, fear
sells! (It's not just sex anymore !) .
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)