View Single Post
Old 04-18-2013, 11:17 AM   #400
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,273
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by CheriePie View Post
So I'm playing around with the best conversion options for this particular book I received from the publisher in PDF format.

The options that produce the best options for reading on my paperwhite so far are

-mode fw -dev kpw -ls- -mb 0.25 -mt 0.25

However the cover image is now being split across 2 pages so I tried to add -f2p -1 to the command line as well, but that causes all the other pages to lose their "fit to width" formatting. And then some pages, often the ones that are the beginning of a new chapter, are even more compressed. And as far as I can tell, there aren't even any images on any of those other pages (unless the chapter marker is an image instead of text) so I don't know why the addition of the f2p option would cause all the other pages in the PDF to change too.


Also, I read a few pages back that Vanilla was trying to get k2pdfopt to recognize chapter breaks and keep the existing page breaks there. Were you able to accomplish that? I'd love to have that. But if not, I'll try to run the resulting PDF through Calibre to do that.


Finally, I discovered that k2pdfopt doesn't like filenames with parenthesis in the name. I had to remove the parenthesis so that the program wouldn't error out.


Anyhoo, let me know if you want me to PM you the PDF I'm trying to work with. It's copyrighted so I can't post it here. Though maybe you can just figure out what's going on based on my description above... so I'll wait to hear back from you before sending it along.

Thanks!
Thanks for reporting these issues. I should be able to fix the parentheses-in-the-file names issue relatively simply.

Right now k2pdfopt doesn't have any smarts to look for chapter tags in a PDF file, if there are such things. I hope to add something like that. What I did was to try and at least put a reasonable gap between places where there is an obvious font size change so that new chapters stand out a little better, but I didn't add a way to put a page break in--I'd need to be certain it was a new chapter and I'm not sure how to do that (yet).

As for the issue with the split figure, k2pdfopt is behaving as designed. The -mode fw command essentially tells it to treat every page region like a single figure (i.e. don't look inside the region except to find the break point where it can split the region across pages), so if you then add -f2p -1 (telling it not to break figures), then you see what you get. I'll have to think about how I want to handle this. It's certainly reasonable (and expected) behavior to do what you wanted. For now, if you're really set on having the cover page not split, you can convert that page with a different command and then merge the outputs together using pdfsam or jpdftweak. Hopefully the next release will offer some smarter behavior.
willus is offline   Reply With Quote