I am trying to convert multiple htm files to pdf using HTMLDOC.
I can convert a single file with the following: htmldoc --webpage -f filename.pdf sample/filename.htm
.
I try making a script and it seems to run but does not create the pdf files.
for F in *; do
if [ "${F}" ]; then
echo "${F}" htmldoc --webpage -f /home/name/pdf/$F.pdf /home/name/sample/$F
fi
done
I would appreciate if someone would help me to get this working. I am not getting any errors other than not resulting in expected pdf files.
Thank you.
Jesse.
P.S. I just noticed that the output from my script prefixes the filename on the command line that executes the program htmldoc.
computer1% ./convertpdf.sh
convertpdf.sh htmldoc --webpage -f /home/name/pdf/convertpdf.sh.pdf /home/name/oz-sample/convertpdf.sh
sample1.htm htmldoc --webpage -f /home/name/pdf/sample1.htm.pdf /home/name/oz-sample/sample1.htm
sample2.htm htmldoc --webpage -f /home/name/pdf/sample2.htm.pdf /home/name/oz-sample/sample2.htm
sample3.htm htmldoc --webpage -f /home/name/pdf/sample3.htm.pdf /home/name/oz-sample/sample3.htm
sample4.htm htmldoc --webpage -f /home/name/pdf/sample4.htm.pdf /home/name/oz-sample/sample4.htm
sample5.htm htmldoc --webpage -f /home/name/pdf/sample5.htm.pdf /home/name/oz-sample/sample5.htm
computer1%
I edited the script
for F in *; do
if [ "${F}" ]; then
echo htmldoc --webpage -f /home/name/pdf/$F.pdf /home/name/sample/$F
fi
done
Now I get normal output but still no pdf.
computer1% ./convertpdf.sh
htmldoc --webpage -f /home/name/pdf/sample1.htm.pdf /home/name/oz-sample/sample1.htm
htmldoc --webpage -f /home/name/pdf/sample2.htm.pdf /home/name/oz-sample/sample2.htm