Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > PDF

Notices

Reply
 
Thread Tools Search this Thread
Old 07-03-2021, 01:16 PM   #1876
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
Rip8--unfortunately k2pdfopt does not transfer the hyperlinks to the converted files at this time. I'll make a note of your request.
willus is offline   Reply With Quote
Old 07-23-2021, 12:44 PM   #1877
phate89
Junior Member
phate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Time
 
Posts: 2
Karma: 49664
Join Date: Jul 2021
Device: kindle
Hi. I have a very weird problem.
I'm using this command to split files in half:
k2pdfopt -grid 2x1x0 -mode crop -p 2-4 "input.pdf" -n -o "output.pdf"
It gives me a very well split pdf with pages in half.
The problem is that if i open the pdf in calibre I see them attached. They are logically bound in some way. If i open them with adobe reader I see them splitted how they want.
The problem is that if i convert them from pdf to other formats I get compressed images with the 2 pages joined.
How can I avoid that? I can't understand why it does that
Thanks in advance!
phate89 is offline   Reply With Quote
Advert
Old 07-23-2021, 12:59 PM   #1878
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
Did you try the -ppgs option? This post-processes with Ghostscript and sometimes helps with problems like this. The issue is that k2pdfopt is taking the original PDF and adding cropping commands to show cropped portions of each page (it does this in “native” mode), and it sounds like some software doesn’t respect that or ignores that. You could turn off native mode also (-n-) but that will bitmap each page and may not be what you want.
willus is offline   Reply With Quote
Old 07-25-2021, 03:22 PM   #1879
phate89
Junior Member
phate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Timephate89 possesses cleverness exceeding the boundaries of Space and Time
 
Posts: 2
Karma: 49664
Join Date: Jul 2021
Device: kindle
I understand now.. that option didn't do anything. I went with non-native option (it's still a scanned pdf afterall with images so no problem).
it seems is a known problem of the pdf reader they use and it's there since a long time:
https://bugs.launchpad.net/calibre/+bug/881717
thanks for the help!
phate89 is offline   Reply With Quote
Old 08-14-2021, 02:45 PM   #1880
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: 7
Karma: 105302
Join Date: Aug 2021
Device: Kindle PW2
Post Word breaks: hyphens and dashes

Hello,

Is there any possible way to remove hyphen when in the original pdf we have a line ending with a word and hyphen (without a space between them):

This is an original example where we do not need to pre-
serve the hyphen in the word "preserve" if it is not broken
in two lines in the output file. The algorithm/rule is simple.
If we have any character (not a space) preceding the hyphen,
it means we have a word break between the lines.

And in opposite - this is an original example where we need
to keep the dash in the destination file.

If the line ended with a word and dash like this -
that would mean we still need to preserve this dash in the
destination (since there is a space preceding the dash)

Not sure if that's possible at all, could not find any set of parameters
that would work like this...

Thank you very much.
Using KPW2, if that matters...
stillstill is offline   Reply With Quote
Advert
Old 08-15-2021, 09:03 AM   #1881
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: 7
Karma: 105302
Join Date: Aug 2021
Device: Kindle PW2
Quote:
Originally Posted by stillstill View Post
Hello,

Is there any possible way to remove hyphen when in the original pdf we have a line ending with a word and hyphen (without a space between them):

This is an original example where we do not need to pre-
serve the hyphen in the word "preserve" if it is not broken
in two lines in the output file. The algorithm/rule is simple.
If we have any character (not a space) preceding the hyphen,
it means we have a word break between the lines.

And in opposite - this is an original example where we need
to keep the dash in the destination file.

If the line ended with a word and dash like this -
that would mean we still need to preserve this dash in the
destination (since there is a space preceding the dash)

Not sure if that's possible at all, could not find any set of parameters
that would work like this...

Thank you very much.
Using KPW2, if that matters...
Attaching the screenshots - original and converted, problematic place is red marked.
Attached Thumbnails
Click image for larger version

Name:	original.png
Views:	265
Size:	85.1 KB
ID:	188702   Click image for larger version

Name:	converted.png
Views:	258
Size:	206.4 KB
ID:	188703  
stillstill is offline   Reply With Quote
Old 08-16-2021, 10:24 PM   #1882
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
K2pdfopt should remove hyphens (-hy option) by default. Do you have the source PDF or a sample of it that I could test out?
willus is offline   Reply With Quote
Old 08-21-2021, 07:51 PM   #1883
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 converted your bitmap to a pdf at 150 dpi and then processed it with k2pdfopt using the default parameters. It eliminated 3 of the 4 hyphens. See attached.
Attached Files
File Type: pdf hyphen.pdf (82.1 KB, 226 views)
File Type: pdf hyphen_k2opt.pdf (69.4 KB, 239 views)
willus is offline   Reply With Quote
Old 08-25-2021, 06:50 AM   #1884
MarjaE
Guru
MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.
 
Posts: 937
Karma: 53902736
Join Date: Jun 2015
Device: multiple
Hi,

If I'm using k2pdfopt -mode copy to convert a png map to pdf and moderately compress it, is there any way to compress less aggressively?

I've tried adjusting -dr 2, -dr 4, -odpi, -w and -h, etc. but it always outputs the same compression and file size, which is much too aggressive for me.
MarjaE is offline   Reply With Quote
Old 08-25-2021, 10:10 AM   #1885
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
MarjaE — try using -idpi -1 — that will force the input and output dpi to remain the same and thus k2pdfopt will not change the resolution of your .png file:

k2pdfopt -mode copy -idpi -1 myfile.png

By default, the input dpi is 2x the output dpi (-idpi -2), which results in k2pdfopt resampling your image at half the resolution if supplied with a .png file unless you are careful to specify output resolution, width, and height all together.

If you specify -odpi on the above command also, it will set the size of the PDF page.
willus is offline   Reply With Quote
Old 08-26-2021, 06:15 PM   #1886
MarjaE
Guru
MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.
 
Posts: 937
Karma: 53902736
Join Date: Jun 2015
Device: multiple
Thank you, that worked.
MarjaE is offline   Reply With Quote
Old 08-31-2021, 06:33 AM   #1887
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: 7
Karma: 105302
Join Date: Aug 2021
Device: Kindle PW2
Quote:
Originally Posted by willus View Post
I converted your bitmap to a pdf at 150 dpi and then processed it with k2pdfopt using the default parameters. It eliminated 3 of the 4 hyphens. See attached.
Attaching original and output. 3 hyphens have not been removed in the first page of the output. Converted using the following options:

-dev kp2 -fs 12 -o C:\Users\demo\Downloads\%b_k2opt -nt -80 -ocrlang lit -ocr t -as -p 7 -cbox- -ibox- -cbox 0.3066in,0.1775in,4.147in,6.423in

additional options:
-f2p -1 -bp-- -fc-

Any ideas how to improve the hyphens detection?...
Thank you
Attached Files
File Type: pdf original.pdf (33.7 KB, 220 views)
File Type: pdf output.pdf (127.1 KB, 214 views)
stillstill is offline   Reply With Quote
Old 09-04-2021, 01:57 PM   #1888
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
Quote:
Originally Posted by stillstill View Post
Any ideas how to improve the hyphens detection?...
Improving hyphen detection for this case would require a code modification. I'll make a note of it and maybe add an extra command-line option to tweak hyphen detection in the future. These hyphens are a bit "stubby" and also tilted somewhat, which is odd.
willus is offline   Reply With Quote
Old 09-06-2021, 11:42 AM   #1889
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: 7
Karma: 105302
Join Date: Aug 2021
Device: Kindle PW2
Thumbs up

Quote:
Originally Posted by willus View Post
Improving hyphen detection for this case would require a code modification. I'll make a note of it and maybe add an extra command-line option to tweak hyphen detection in the future. These hyphens are a bit "stubby" and also tilted somewhat, which is odd.
Zoomed in, and, indeed - they are tilted a bit. IMHO the easiest logic would be just if we have any dash-like symbol at the end of line, that is not preceded with space it should be interpreted as a hyphen. And I believe the hardest part is to detect that dash-like symbol, especially if we have slightly different types of it (like slight tilting, symbol width, line width...) due to variety of fonts used.

Anyway I really do appreciate your talent and hard work on this truly ingenious tool helping millions mobile readers.
stillstill is offline   Reply With Quote
Old 09-06-2021, 03:38 PM   #1890
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
Quote:
Originally Posted by stillstill View Post
Zoomed in, and, indeed - they are tilted a bit. IMHO the easiest logic would be just if we have any dash-like symbol at the end of line, that is not preceded with space it should be interpreted as a hyphen. ...
FYI the current detection algorithm is looking at the graphic, not the characters. It is looking for the "shape" of a hyphen. Thanks for the nice comments--I'm not sure k2pdfopt is helping millions, though--the download count is at 700k. Not that I'm complaining.
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 03:54 AM.


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