* [gentoo-user] PDF to png/jpg/...
@ 2009-05-10 9:26 meino.cramer
2009-05-10 10:04 ` Dale
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: meino.cramer @ 2009-05-10 9:26 UTC (permalink / raw
To: Gentoo
Hi,
does anyone know a trick/package, which allows my to
convert the pages of a pdf file to images via the commandline
(useable from a script).
I have a/LOT/ of datasheets of electronics and want to make
something like a "pdf gallery" to find pdfs faster...
Thanks a lot for any help in advance!
Kind regards,
Meino Cramer
--
Please don't send me any Word- or Powerpoint-Attachments
unless it's absolutely neccessary. - Send simply Text.
See http://www.gnu.org/philosophy/no-word-attachments.html
In a world without fences and walls nobody needs gates and windows.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] PDF to png/jpg/...
2009-05-10 9:26 [gentoo-user] PDF to png/jpg/ meino.cramer
@ 2009-05-10 10:04 ` Dale
2009-05-10 10:30 ` Florian Philipp
2009-05-10 10:57 ` Cédric Cabessa
2 siblings, 0 replies; 7+ messages in thread
From: Dale @ 2009-05-10 10:04 UTC (permalink / raw
To: gentoo-user
meino.cramer@gmx.de wrote:
> Hi,
>
> does anyone know a trick/package, which allows my to
> convert the pages of a pdf file to images via the commandline
> (useable from a script).
>
> I have a/LOT/ of datasheets of electronics and want to make
> something like a "pdf gallery" to find pdfs faster...
>
> Thanks a lot for any help in advance!
> Kind regards,
> Meino Cramer
>
>
This is not command line but at least it shows it can be done. I got a
local store to scan some legal documents for me and they were in .pdf.
I opened them with Gimp, yea, the picture program. I could rotate them
so they would not give me or my lawyer a sore neck when reading them.
They were sideways.
I doubt Gimp has any command line options but I suspect that Gimp uses
some sort of a plugin to do this. If you can find out what plugin it
uses, then you may can do it on command line.
Hope that info will bring forth much fruit.
Dale
:-) :-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] PDF to png/jpg/...
2009-05-10 9:26 [gentoo-user] PDF to png/jpg/ meino.cramer
2009-05-10 10:04 ` Dale
@ 2009-05-10 10:30 ` Florian Philipp
2009-05-10 10:49 ` meino.cramer
2009-05-10 20:24 ` Neil Bothwick
2009-05-10 10:57 ` Cédric Cabessa
2 siblings, 2 replies; 7+ messages in thread
From: Florian Philipp @ 2009-05-10 10:30 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 835 bytes --]
meino.cramer@gmx.de schrieb:
> Hi,
>
> does anyone know a trick/package, which allows my to
> convert the pages of a pdf file to images via the commandline
> (useable from a script).
>
> I have a/LOT/ of datasheets of electronics and want to make
> something like a "pdf gallery" to find pdfs faster...
>
> Thanks a lot for any help in advance!
> Kind regards,
> Meino Cramer
>
You can use pdftopnm (app-text/poppler) to generate bitmap images from
your pdfs. Then you can use pnmtopng (media-libs/netpbm) to create pngs
from them. I suppose there are also tools for creating jpegs and such
alike but I haven't looked yet.
You will probably need some tweaking to get optimal results but the
process should be straight forward.
Make sure you have enough disk space spare. Those pnms can be quiet huge.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] PDF to png/jpg/...
2009-05-10 10:30 ` Florian Philipp
@ 2009-05-10 10:49 ` meino.cramer
2009-05-10 20:24 ` Neil Bothwick
1 sibling, 0 replies; 7+ messages in thread
From: meino.cramer @ 2009-05-10 10:49 UTC (permalink / raw
To: gentoo-user
Florian Philipp <lists@f_philipp.fastmail.net> [09-05-10 12:35]:
> meino.cramer@gmx.de schrieb:
> > Hi,
> >
> > does anyone know a trick/package, which allows my to
> > convert the pages of a pdf file to images via the commandline
> > (useable from a script).
> >
> > I have a/LOT/ of datasheets of electronics and want to make
> > something like a "pdf gallery" to find pdfs faster...
> >
> > Thanks a lot for any help in advance!
> > Kind regards,
> > Meino Cramer
> >
>
> You can use pdftopnm (app-text/poppler) to generate bitmap images from
> your pdfs. Then you can use pnmtopng (media-libs/netpbm) to create pngs
> from them. I suppose there are also tools for creating jpegs and such
> alike but I haven't looked yet.
>
> You will probably need some tweaking to get optimal results but the
> process should be straight forward.
>
> Make sure you have enough disk space spare. Those pnms can be quiet huge.
>
Thanks a lot for all tipe!
I will use pdftoppm now.
Here is a quick script written on the commandline to do this job.
(I use zsh.)
mkdir PDFviews
cd PDFviews
for i in ../*.pdf ../*.PDF
do
fn=${i:r}
fn=${fn:t}
fn=${fn}.png
pdftoppm -f 1 -l 1 $i > tmp.ppm
ppmtojpeg < tmp.ppm > $fn
done
rm -f tmp.ppm
Have a nice sun(ny)day !
Meino
--
Please don't send me any Word- or Powerpoint-Attachments
unless it's absolutely neccessary. - Send simply Text.
See http://www.gnu.org/philosophy/no-word-attachments.html
In a world without fences and walls nobody needs gates and windows.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] PDF to png/jpg/...
2009-05-10 9:26 [gentoo-user] PDF to png/jpg/ meino.cramer
2009-05-10 10:04 ` Dale
2009-05-10 10:30 ` Florian Philipp
@ 2009-05-10 10:57 ` Cédric Cabessa
2009-05-10 17:56 ` Paul Hartman
2 siblings, 1 reply; 7+ messages in thread
From: Cédric Cabessa @ 2009-05-10 10:57 UTC (permalink / raw
To: gentoo-user
Le dimanche 10 mai 2009 11:26:55, cramer a écrit :
> Hi,
>
> does anyone know a trick/package, which allows my to
> convert the pages of a pdf file to images via the commandline
> (useable from a script).
>
imagemagick ?
$ convert myfile.pdf prefix.jpg
will create prefix-1.jpg, prefix-2.jpg, .... (one jpg by page)
$ convert myfile.pdf[10-15] prefix.jpg
if you want to extract only page 10 to 15.
--
ced
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] PDF to png/jpg/...
2009-05-10 10:57 ` Cédric Cabessa
@ 2009-05-10 17:56 ` Paul Hartman
0 siblings, 0 replies; 7+ messages in thread
From: Paul Hartman @ 2009-05-10 17:56 UTC (permalink / raw
To: gentoo-user
On Sun, May 10, 2009 at 5:57 AM, Cédric Cabessa <ced@ryick.net> wrote:
> Le dimanche 10 mai 2009 11:26:55, cramer a écrit :
>> Hi,
>>
>> does anyone know a trick/package, which allows my to
>> convert the pages of a pdf file to images via the commandline
>> (useable from a script).
>>
> imagemagick ?
>
> $ convert myfile.pdf prefix.jpg
>
> will create prefix-1.jpg, prefix-2.jpg, .... (one jpg by page)
>
> $ convert myfile.pdf[10-15] prefix.jpg
>
> if you want to extract only page 10 to 15.
I agree, that's what I use and it seems to work fine :)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] PDF to png/jpg/...
2009-05-10 10:30 ` Florian Philipp
2009-05-10 10:49 ` meino.cramer
@ 2009-05-10 20:24 ` Neil Bothwick
1 sibling, 0 replies; 7+ messages in thread
From: Neil Bothwick @ 2009-05-10 20:24 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 605 bytes --]
On Sun, 10 May 2009 12:30:43 +0200, Florian Philipp wrote:
> You can use pdftopnm (app-text/poppler) to generate bitmap images from
> your pdfs. Then you can use pnmtopng (media-libs/netpbm) to create pngs
> from them. I suppose there are also tools for creating jpegs and such
> alike but I haven't looked yet.
> Make sure you have enough disk space spare. Those pnms can be quiet
> huge.
Don't write them to disk then. Piping the output of pdftopnm into pnmtopng
will save disk space and speed up the process.
--
Neil Bothwick
Oregano: the ancient Italian art of pizza folding.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-05-10 20:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-10 9:26 [gentoo-user] PDF to png/jpg/ meino.cramer
2009-05-10 10:04 ` Dale
2009-05-10 10:30 ` Florian Philipp
2009-05-10 10:49 ` meino.cramer
2009-05-10 20:24 ` Neil Bothwick
2009-05-10 10:57 ` Cédric Cabessa
2009-05-10 17:56 ` Paul Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox