View Single Post
Old 08-17-2024, 03:35 PM   #2076
Shohreh
Addict
Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.
 
Posts: 207
Karma: 304158
Join Date: Jan 2016
Location: France
Device: none
Too bad. Thanks.

I'm struggling at getting k2 to convert a searchable PDF to something that displays on my reader as well as it does on the computer. For some reason, the output has carriage returns in the middle, along with garbage characters like #, and the font size changes occasionally. Unreadable.

I'm suprised since the doco says that by default, k2 converts PDFs to bitmaps so the output should be clean without having anything fancier to do than this:
Code:
k2pdfopt.exe -w 758 -h 1024 input.pdf
---
Edit: Using the GUI, I found that the solution is to keep the "Re-flow text" unchecked (default: -fc- -wrap-), which looks better than checking that option (-fc- -wrap+)… and way better than the options I tried through the CLI after reading the list of options availables.

Edit: False hope. I tried again, and for some reason, I get crap, with or without the wrap option (-fc- -wrap-, -fc- -wrap+). I don't get it.

--
Edit: As a work-around, I convert the PDF into PNG, merge them back into a PDF, and run it through k2

Code:
#Use best resolution
mutool.exe convert -O resolution=600 -o %03d.png input.pdf

FAILS mutool.exe merge -o output.pdf -O compress *.png
img2pdf --title "My book" --author "My author" -o output.pdf *.png

k2pdfopt.exe -odpi 213 -m 0.2 -fc- -wrap- -h 1024 -w 758 output.pdf
Still worth it because, like the help page says, bitmaps are displayed faster than a native PDF, besides the optimized output for 6" readers.
Attached Thumbnails
Click image for larger version

Name:	IMG_20240818_104036.jpg
Views:	644
Size:	48.8 KB
ID:	210255  

Last edited by Shohreh; 08-19-2024 at 06:13 AM.
Shohreh is offline   Reply With Quote