Florian Philipp <li...@f_philipp.fastmail.net> [09-05-10 12:35]:
> [email protected] 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.