Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > PDF

Notices

Reply
 
Thread Tools Search this Thread
Old 08-11-2024, 04:16 AM   #2071
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 72,031
Karma: 307903668
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Academic papers are often still in copyright. This one even had a copyright notice on each page. Removed. Please be more careful about uploading.
pdurrant is offline   Reply With Quote
Old 08-11-2024, 09:01 AM   #2072
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,282
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by pdurrant View Post
Academic papers are often still in copyright. This one even had a copyright notice on each page. Removed. Please be more careful about uploading.
My attachments replaced with small samples (less than one page of the source document).
willus is offline   Reply With Quote
Old 08-15-2024, 03:56 PM   #2073
Shohreh
Groupie
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: 157
Karma: 248528
Join Date: Jan 2016
Device: none
I find sans serif fonts easier to read on my e-reader.

Unless I missed it, it looks like k2 doesn't support setting the fonts in the output.

Is there a utility that can replace them in the input file?

For instance, here are the fonts in a book I'm currently reading:
Code:
.SFNS-Regular_wdth_opsz110000_GRAD_wght (TrueType; embedded)
.SFNS-Regular_wdth_opsz110000_GRAD_wght (TrueType; Roman; embedded)
Alegreya-Regular (TrueType; Roman; embedded)
Thank you.
Attached Thumbnails
Click image for larger version

Name:	B93B8F15-1F9D-431C-B232-366E3A4C0662.png
Views:	18
Size:	74.9 KB
ID:	210196  
Shohreh is offline   Reply With Quote
Old 08-17-2024, 02:43 AM   #2074
Shohreh
Groupie
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: 157
Karma: 248528
Join Date: Jan 2016
Device: none
I have another question.

The original PDF is an image-only file — meaning: In SumatraPDF, I can't select text with the mouse.

After running that original file through k2, the output on my e-reader is fine.

However, I'm having a problem with inputs that I ran through Abbyy Fine Reader:
- Saved as "searchable" PDF: The output from k2 inserts carriage returns about half-way through each line
- Saved as "image" PDF: I only get empty pages.

I zipped a sample of each file (original, searchable, image). I used the following commands:
Code:
#mt to remove header
#good
k2pdfopt.exe -w 758 -h 1024 -dpi 213 -mode fw -ls- -mt 1.02 -fc- input.original.pdf
#wrong carriage returns
k2pdfopt.exe -w 758 -h 1024 -dpi 213 -mode fw -ls- -mt 1.02 -fc- input.OCR.searchable.pdf
#only empty pages
k2pdfopt.exe -w 758 -h 1024 -dpi 213 -mode fw -ls- -mt 1.02 -fc- input.OCR.image.pdf
Thank you.
Shohreh is offline   Reply With Quote
Old 08-17-2024, 12:05 PM   #2075
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 3,007
Karma: 18401861
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
Quote:
Originally Posted by Shohreh View Post
I find sans serif fonts easier to read on my e-reader.

Unless I missed it, it looks like k2 doesn't support setting the fonts in the output.

Is there a utility that can replace them in the input file?

For instance, here are the fonts in a book I'm currently reading:
Code:
.SFNS-Regular_wdth_opsz110000_GRAD_wght (TrueType; embedded)
.SFNS-Regular_wdth_opsz110000_GRAD_wght (TrueType; Roman; embedded)
Alegreya-Regular (TrueType; Roman; embedded)
Thank you.
It is generally a bad idea to replace the fonts in a PDF. When the PDF is constructed, the characters are precisely positioned (i.e. kerned) according to their shapes in the original font. If you change the font, then you get weird spacings between the characters in words (some have bigger gaps, others overlap). It just looks bad.

EPUBs are rendered completely differently from PDFs. There is no kerning information in EPUBs, so swapping fonts doesn't lead to weird character spacing.
rkomar is offline   Reply With Quote
Old 08-17-2024, 03:35 PM   #2076
Shohreh
Groupie
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: 157
Karma: 248528
Join Date: Jan 2016
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:	17
Size:	48.8 KB
ID:	210255  

Last edited by Shohreh; 08-19-2024 at 06:13 AM.
Shohreh is offline   Reply With Quote
Old 08-18-2024, 08:24 PM   #2077
galloshumour
Junior Member
galloshumour makes transoceanic flights without the assistance of an airplanegalloshumour makes transoceanic flights without the assistance of an airplanegalloshumour makes transoceanic flights without the assistance of an airplanegalloshumour makes transoceanic flights without the assistance of an airplanegalloshumour makes transoceanic flights without the assistance of an airplanegalloshumour makes transoceanic flights without the assistance of an airplanegalloshumour makes transoceanic flights without the assistance of an airplanegalloshumour makes transoceanic flights without the assistance of an airplanegalloshumour makes transoceanic flights without the assistance of an airplanegalloshumour makes transoceanic flights without the assistance of an airplanegalloshumour makes transoceanic flights without the assistance of an airplane
 
Posts: 1
Karma: 55640
Join Date: Aug 2024
Device: Kindle Paperwhite
Does anyone have tips for processing magazine PDFs with k2pdfopt? I've been trying to figure out how to best read a 3-column magazine that has text interspersed with lots of images and small cartoons, but the text gets broken up oddly around the images/cartoons
galloshumour is offline   Reply With Quote
Old Today, 06:55 PM   #2078
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,282
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by Shohreh View Post
...
However, I'm having a problem with inputs that I ran through Abbyy Fine Reader:
- Saved as "searchable" PDF: The output from k2 inserts carriage returns about half-way through each line
- Saved as "image" PDF: I only get empty pages.
I cannot reproduce what you describe. Are you running k2pdfopt v2.55 on Windows. I've attached a couple of pages of output from your 2nd and 3rd commands (I added -p 1-2 to them). They all look the same. Is it only on your e-reader that the PDFs display funny? I'm just looking at these using Sumatra PDF on my desktop PC. There's really no way k2pdfopt can be inserting a carriage return in "fitwidth" mode. It's just adding commands to the source PDF to display different cropped regions of the source content on each page. It's not doing any text re-flow. I'm guessing this is an artifact of whatever reader you are using.

BTW, you used # for comments in your command list, so clearly you're not running them in a .bat file. What shell are you using?
Attached Files
File Type: pdf out_wrongcr.pdf (90.1 KB, 3 views)
File Type: pdf out_empty.pdf (69.7 KB, 2 views)

Last edited by willus; Today at 07:06 PM.
willus is offline   Reply With Quote
Old Today, 07:00 PM   #2079
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,282
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by rkomar View Post
It is generally a bad idea to replace the fonts in a PDF. When the PDF is constructed, the characters are precisely positioned (i.e. kerned) according to their shapes in the original font. If you change the font, then you get weird spacings between the characters in words (some have bigger gaps, others overlap). It just looks bad.

EPUBs are rendered completely differently from PDFs. There is no kerning information in EPUBs, so swapping fonts doesn't lead to weird character spacing.
Agree 100%. I was going to write the same thing but you beat me to it. Thank you, rkomar.
willus is offline   Reply With Quote
Old Today, 07:04 PM   #2080
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,282
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by galloshumour View Post
Does anyone have tips for processing magazine PDFs with k2pdfopt? I've been trying to figure out how to best read a 3-column magazine that has text interspersed with lots of images and small cartoons, but the text gets broken up oddly around the images/cartoons
It all kind of depends on the specific 3-column layout, but I guess I'd try to set k2pdfopt for > 2 columns (-col 4) and then you may have to tweak some of the column finding parameters. Search "column" in the command-line params or maybe check this somewhat dated help page on column detection. If you could post a couple of pages or privately mail me a link to your doc I might be able to suggest something more specific.
willus is offline   Reply With Quote
Reply

Tags
ebook apps, k5 tools, kindle tools, kindle touch, tools


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Viewing PDFs with another font Font PocketBook 4 11-12-2010 08:27 AM
Viewing Textbook PDFs... NJReader enTourage Archive 4 08-17-2010 05:17 PM
PRS-600 Restart bug while viewing PDFs? conundrum Sony Reader 2 03-04-2010 08:46 PM
More on viewing pdfs dso371 Bookeen 8 03-11-2008 07:15 PM
Viewing Untagged PDFs on Palm T|X Eroica Reading and Management 3 12-10-2007 01:44 PM


All times are GMT -4. The time now is 09:32 PM.


MobileRead.com is a privately owned, operated and funded community.