Batch PDF to MP3 Conversion - TechRepublic
Question
June 28, 2019 at 07:57 PM
ericlindellnyc

Batch PDF to MP3 Conversion

by ericlindellnyc . Updated 6 years, 11 months ago

I have the following four commands, which executed in sequence, will convert one PDF to MP3.

pdftohtml FNX.pdf
textutil -convert txt FNX.html
say -f FNX.txt -r 220 -o FNX.aiff –progress
ffmpeg -i FNX.aiff FNX.mp3

I convert from PDF to HTML and from HTML to TXT
because my pdftotext doesn’t work.

If I try looping the first line, above, as in
for f in *.pdf; do pdftohtml “$f”; done
it gives the message
Error: Couldn’t open file ‘“??’

If I loop the second line,
for f in *.html; do textutil -convert txt “$f”; done
I get
Error reading â. The file doesn’t exist.

This is all after a lot of tinkering on the LinuxQuestions site,
cuz I forgot it’s not the same as Mac.

So I’m pretty lost here.
Any help appreciated !!

This discussion is locked

All Comments