Description
When printing from Okular, the files turn up but show as "Unable to load document" on the ReMarkable. The same file, sent through lp filename.pdf -d reMarkable
works fine.
I did some digging, and it appears Okular sends ps
files, rather than pdf
(as in, sudo pdfinfo /var/spool/cups/<id of job printed with lp>
shows a bunch of pdf info, but sudo pdfinfo /var/spool/cups/<job from okular>
errors out, and ${5}
contains document-name-supplied=okular_<name>.ps
).
I got it working with
if pdfinfo "${jobfile}" > /dev/null ; then
cp "${jobfile}" "${outname}"
else
ps2pdf "${jobfile}" "${outname}"
fi
instead of cat ${jobfile} > ${outname}
.
but it's a bit of a hack (it assumes that the file is either pdf or a ps). Printing is pure magic to me, so I don't know if there's a good way to do this.
Just thought I'd share in case anyone else needs this (or has a better idea for how to solve it).