Closed workflowsguy closed 2 years ago
A workaround is to modify lesspipe.sh and replace the first occurrence of html2text in parsehtml by broken_html2text
Unfortunately, this does not work.
The first line with html2text
in the parsehtml
function is
elif cmd_exist html2text; then
If I change this to
elif cmd_exist broken_html2text; then
less anyfile.pdf
shows no file contents:
==> append : to filename to view the PDF source
anyfile.pdf (END)
the latest lesspipe.sh first tries pdftotext for converting pdf files. If that is not found, then using pdftohtml it is converted to html. The html file is converted to text by first trying w3m, then lynx, then elinks and if all of it is not installed then html2text without flags for different encodings, as several incompatible html2text implementations do exist. The test suite passes the interpretation of pdf files.
When running
less anyfile.pdf
, the following error is displayed:(looks similar to #60)
I have
pdftotext
installed on my system and was hoping by running the above command to get output comparable topdftotext --layout anyfile.pdf -
. But I can not figure out how to configure lesspipe.sh to usepdftotext
instead ofhtml2text
for pdf files.I am using lesspipe.sh 1.91 installed via MacPorts in zsh.