Thursday, May 2, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1494  / 2 Years ago, mon, february 28, 2022, 3:39:28

Need to convert hundreads of pdf files across several folders. pdf2djvu gui is junk on windows and always crashes after a couple of conversions.



Taking this code of which I am working from



for file in *.pdf; do pdftotext "$file" "$file.txt"; done



I normally run pdf2djvu like this:
pdf2djvu -o *.djvu *.pdf



Using what's below gives me: I Won't write DjVu data to terminal



for file in *.pdf; do pdf2djvu "$file" "$file.djvu"; done



And for:
file in *.pdf; do pdf2djvu -o "$file" "$file.djvu"; done



Unable to load document
PDF error: Couldn't open file*.pdf.djvu: random unknown characters



And for: for file in *.pdf; do "pdf2djvu -o" "$file" "$file.djvu"; done



pdf2djvu -o: command not found



And for: for file in .pdf; do "pdf2djvu -o *.djvu *.pdf" "$file" "$file.djvu"; done
bash: pdf2djvu -o *.djvu *.pdf: No such file or directory


More From » batch-rename

 Answers
0

-o is output options. Output filename should follow after it. So this works for me:



for file in *.pdf; do pdf2djvu -o "$file.djvu" "$file"; done

[#32121] Wednesday, March 2, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ionodest

Total Points: 252
Total Questions: 122
Total Answers: 100

Location: Liechtenstein
Member since Tue, Apr 27, 2021
3 Years ago
;