Wieso möchte pdftoppm nicht im Script arbeiten?
Hallo zusammen
Ich habe viele PDF-Dateien. Einige davon sollen als Bilder konvertiert werden.
Das funktioniert auch wunderbar mit dem Tool pdftoppm.
Nur leider nicht im Script. Es sei denn am Script ist etwas falsch.
Zunächst habe ich für die vielen PDF Dateien einen extra Ordner erstellt und versuchsweise nur 5 der PDF Dateien, welche als Bilder generiert werden sollen, hierher kopiert.
Jetzt soll das erstellte Script diesen Ordner abarbeiten. Nur will pdftoppm nicht mitspielen.
Das Script:
Code:
#!/bin/sh
pdffile=`ls | grep .pdf`
for filename in $pdffile
do
name=` basename -s .pdf $pdffile `
echo $name\;
pdftoppm -jpeg $name.pdf Bilder/$name.jpg
done
exit
Das Script ist im eigenen bin-Ordner ausfühbar gemacht als pdftojpg.
Als Antwort nach dem Start des Scripts erfolgt:
Code:
pdftoppm version 0.79.0
Copyright 2005-2019 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2011 Glyph & Cog, LLC
Usage: pdftoppm [options] [PDF-file [PPM-file-prefix]]
-f <int> : first page to print
-l <int> : last page to print
-o : print only odd pages
-e : print only even pages
-singlefile : write only the first page and do not add digits
-r <fp> : resolution, in DPI (default is 150)
-rx <fp> : X resolution, in DPI (default is 150)
-ry <fp> : Y resolution, in DPI (default is 150)
-scale-to <int> : scales each page to fit within scale-to*scale-to pixel box
-scale-to-x <int> : scales each page horizontally to fit in scale-to-x pixels
-scale-to-y <int> : scales each page vertically to fit in scale-to-y pixels
-x <int> : x-coordinate of the crop area top left corner
-y <int> : y-coordinate of the crop area top left corner
-W <int> : width of crop area in pixels (default is 0)
-H <int> : height of crop area in pixels (default is 0)
-sz <int> : size of crop square in pixels (sets W and H)
-cropbox : use the crop box rather than media box
-mono : generate a monochrome PBM file
-gray : generate a grayscale PGM file
-sep <string> : single character separator between name and page number, default -
-forcenum : force page number even if there is only one page
-png : generate a PNG file
-jpeg : generate a JPEG file
-jpegopt <string> : jpeg options, with format <opt1>=<val1>[,<optN>=<valN>]*
-tiff : generate a TIFF file
-tiffcompression <string>: set TIFF compression: none, packbits, jpeg, lzw, deflate
-freetype <string> : enable FreeType font rasterizer: yes, no
-thinlinemode <string> : set thin line mode: none, solid, shape. Default: none
-aa <string> : enable font anti-aliasing: yes, no
-aaVector <string> : enable vector anti-aliasing: yes, no
-opw <string> : owner password (for encrypted files)
-upw <string> : user password (for encrypted files)
-q : don't print any messages or errors
-v : print copyright and version info
-h : print usage information
-help : print usage information
--help : print usage information
-? : print usage information
Ohne dem pdftoppm-Befehl werden die 5 PDF Dateien durch den eingefügten echo-Befehl ohne Endung richtig anzeigt.
Mit dem pdftoppm-Befehl wird 5 mal die Helpanzeige des Befehls ausgegeben.
Was läuft hier falsch? Wo liegt mein Denkfehler?