View Single Post
Old 02-17-2023, 11:37 AM   #14
willus
Fuzzball, the purple cat
willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.
 
willus's Avatar
 
Posts: 1,303
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
I had not seriously used qpdf in quite a while. It has many more options than it did even four years ago, including an underlay option that works perfectly for this. So you can also use qpdf--in fact, it's simpler. Ignoring the commands to clean up temporary files:
Code:
k2pdfopt -mode copy -dpi 300 -ocr t -ocrd p src.pdf -o temp1.pdf
k2pdfopt -mode copy -dpi 50 -bpc 1 -g 100 -cmax -100 -s- temp1.pdf -o temp2.pdf
qpdf src.pdf --underlay temp2.pdf -- out.pdf
I bumped up the dpi in the throw-away file to 50 to improve the placement of the text layer.
willus is offline   Reply With Quote