Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > PDF

Notices

Reply
 
Thread Tools Search this Thread
Old 06-18-2025, 10:24 AM   #2131
Markus1
Junior Member
Markus1 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2025
Location: Glory to Ukraine
Device: Kindle PW
It doesn't work
Attached Thumbnails
Click image for larger version

Name:	рис4.PNG
Views:	184
Size:	655.3 KB
ID:	216336  
Markus1 is offline   Reply With Quote
Old 06-20-2025, 09:19 AM   #2132
stillstill
Junior Member
stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.
 
Posts: 8
Karma: 105302
Join Date: Aug 2021
Device: Kindle PW2
Empty lines removal

Do we have any option to remove empty lines between paragraphs? These days I found more and more oddly formatted literature... Like no idents for new paragraphs but there are empty lines between each paragraph.
stillstill is offline   Reply With Quote
Old 06-23-2025, 05:36 PM   #2133
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,306
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by Markus1 View Post
It doesn't work. Empty areas remain
Did you look at the PDF output from k2pdfopt on a PDF reader on your PC (e.g. view it in SumatraPDF)? Does it look right on your PC? What reader are you using on the kindle? Is it possibly the kindle reader that is the issue? Can you post your source and converted PDF (just a page or two, at least)?
willus is offline   Reply With Quote
Old 06-23-2025, 05:40 PM   #2134
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,306
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by stillstill View Post
Do we have any option to remove empty lines between paragraphs? These days I found more and more oddly formatted literature... Like no idents for new paragraphs but there are empty lines between each paragraph.
k2pdfopt should remove extra vertical empty space by default when it uses re-flow. What options are you using? Can you post an example of your source document? See these command-line options: -vb, -vls, -vs.
willus is offline   Reply With Quote
Old 07-16-2025, 03:48 AM   #2135
Kule
Member
Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!
 
Kule's Avatar
 
Posts: 17
Karma: 80572
Join Date: Jan 2018
Device: Sony DPT-RP1, Kobo Forma
Removing symbol between paragraphs

Hello @willus

Thanks for the great app.
I attempted to convert the book with symbols between paragraphs
(4 pages attached- original.pdf).

Below are the commands I used (I use terminal version on MacOS):

Code:
-mode def -ws 0.200 -ac 0.3 -dpi 300 -wrap+ -fs 14 -dev kbh2ofs -a- -ui- -x -om 0.8cm -nt -90 -fc- -y -x
The result is almost good (result_k2opt.pdf attached), but I am unable to remove these symbols . (original for removal.pdf attached) attached.

As a result, the text around these symbols is not in order (I have marked in red, and the original order is highlighted in yellow).
This only happens around symbols, nowhere else.

The symbol confuses the conversion and should be removed beforehand.
Could you help?


Thanks in advance
Attached Files
File Type: pdf result_k2opt.pdf (2.78 MB, 186 views)
File Type: pdf original.pdf (2.50 MB, 201 views)
File Type: pdf original for removal.pdf (2.53 MB, 179 views)
Kule is offline   Reply With Quote
Old 07-21-2025, 01:55 PM   #2136
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,306
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by Kule View Post
As a result, the text around these symbols is not in order (I have marked in red, and the original order is highlighted in yellow).
This only happens around symbols, nowhere else.

The symbol confuses the conversion and should be removed beforehand.
Could you help?
Sorry for the delayed response. Just force k2pdfopt to evaluate this as a single column by adding this to your options: -col 1

I think that will do what you want.
willus is offline   Reply With Quote
Old 07-22-2025, 04:14 PM   #2137
Kule
Member
Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!Kule My eyes! My eyes! The light is just too bright!
 
Kule's Avatar
 
Posts: 17
Karma: 80572
Join Date: Jan 2018
Device: Sony DPT-RP1, Kobo Forma
Thanks, it works, the text order is fully preserved.
Kule is offline   Reply With Quote
Old 09-15-2025, 05:19 AM   #2138
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: 219
Karma: 304158
Join Date: Jan 2016
Location: France
Device: none
Hello,

I have a couple of questions:
1. What's the right way to remove a header that extends to 47pt? -mt 47p didn't work — for some reason, it's displayed at the bottom of the page

2. Is there a way to get k2pdfopt to move footnotes at the bottom of the page?

Here's the command I used:
Code:
k2pdfopt.exe -o test.header.pdf -p 13-20 -mt 47p -mode fw -ls- -om 0.2 -w 758 -h 1024 -dpi 213 -fc- input.pdf
Thank you.

--
Edit: And since footnotes obviously have a different height depending on the amount of text, I can't simply grab that section and move footnotes like Abbyy tries to do — sometimes successfully, sometimes not; Regardless, it moves them at the end of the chapter while I'd rather keep them in the page, for easier reading.

Does a PDF wizard know if it's possible to 1) search for all paragraphs that start with a exponented/superscript number and 2) cut those and paste them at the bottom of the page?
Attached Thumbnails
Click image for larger version

Name:	2EDDB6B5-0ED3-4012-8D9B-F2DBD0976E1B.png
Views:	16
Size:	250.2 KB
ID:	218100   Click image for larger version

Name:	2FD9CE6C-D8A7-4626-8A50-6B9E5A13ED0F.png
Views:	15
Size:	143.4 KB
ID:	218104  

Last edited by Shohreh; 09-15-2025 at 06:54 AM.
Shohreh is offline   Reply With Quote
Old 09-15-2025, 09:55 PM   #2139
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,306
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by Shohreh View Post
1. What's the right way to remove a header that extends to 47pt? -mt 47p didn't work — for some reason, it's displayed at the bottom of the page
First question s/b easy--convert points to inches. 47/72=0.653 in, so -mt 0.653. The "p" is used for pixels, not points. See the "-h" option here. Let me think about on the other issue. I think maybe the best option is to use the -bp option? That will start a new output page for each new input page...? I don't really have any intelligence in k2pdfopt to be able to separate out footnotes and place them differently.
willus is offline   Reply With Quote
Old 09-16-2025, 02:53 AM   #2140
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: 219
Karma: 304158
Join Date: Jan 2016
Location: France
Device: none
Thanks. That did the trick to remove headers.

As for keeping footnotes at the bottom: When running pymupdf, I notice they are displayed in a smaller font size, possibly starting with a superscript (but not always: In this book, some footnotes start with a star followed by a superscript), so that would be a "simple" way to grab everything down to the end of the page, or move them all to the end of the chapter/book like Abbyy does and just include hyperlinks so the user can easily go back and forth.

Code:
blocks = page.get_text("dict", flags=11)["blocks"]
for b in blocks:  # iterate through the text blocks
	for l in b["lines"]:  # iterate through the text lines
		stuff = ""
		for s in l["spans"]:  # iterate through the text spans
			print("")
			#4.8 = 4.800000190734863
			if round(s["size"],1) == 4.8:
				print("Found footnote", s["text"])
			stuff += s["text"]
			print(stuff)
Attached Thumbnails
Click image for larger version

Name:	7BEC5927-80FF-48FC-9D16-32169080FA77.png
Views:	17
Size:	61.4 KB
ID:	218118  
Shohreh is offline   Reply With Quote
Old Yesterday, 01:41 PM   #2141
stillstill
Junior Member
stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.stillstill shapes the world with his or her thoughts.
 
Posts: 8
Karma: 105302
Join Date: Aug 2021
Device: Kindle PW2
Quote:
Originally Posted by stillstill View Post
Thank you for both methods. Both of them perfectly eliminated horizontal line and likely in this way helped to workaround the small font issue (the line presence alone in the output was not an issue). The sudden alignment change still remained. Text alignment changed from "justified" to "left aligned" for the entire source page where there at the end is that horizontal line. Sometimes it affects not the entire source page but the chapter on the page before horizontal line. This remediated effectively by "-j +" which worked flawlessly.

Thank you so much for your really brilliant Application development and such a dedication to the support.

Unfortunately it doesn't work with any underlined text. The font gets random sized for each line as the algorithm seems to interpret the underlined parts of text as solid figures and tries to fit the underlined block per line - this renders to wildly variating font size. Is that also possible to correct?

Thank you.
stillstill 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:01 AM.


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