View Single Post
Old 02-18-2015, 08:41 PM   #1003
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 wdq4587 View Post
I know I need explain.

First is what I want: I want view a scanned PDF using mobi format in my Kindle paperwhite 2. The reason is I dislike kinlde display a border around the PDF content, and also kindle may be not stable for PDF file. Then I want the convert process is lossless to avoid scale image twice (kinlde will scale while display if resolution not match the best resolution, although I don't know which is but the PDF file I've tested is small than that), and do not want increase the output filesize (the test file image have 5 color and resample will have 32 color and double the filesize).

Then what I have done. After many test and adjustment, I found using trim mode and native PDF output, by using a tool to render the pages, the result image can match the source exactly pixel by pixel. But since I view it in landscape mode, I need k2pdfopt split the pages to about 40% original height and trim and merge with next page. Then I found the I can not render out page exactly as the original. Even using native PDF mode, the transform matrix of Xobj image can not always be like "1 0 0 1 -12 -405", so it will resample pixels and color number will be extended and finale mobi filesize will double.

By now I just think I almost have made it, by using such parameter (I am using GUI):

-m 74p,145p,74p,81p -idpi 72 -bp-- 0 -vb -2
-de 1.5 -wrap- -n -c -col 1 -odpi 72 -h 0.37s -w 0.8s -ws 0

but there are a few pages still have 32 color and big size, I checked then I found these are combined by two pages, I guess there are a gap between page. But even I use -bp-- 0, it's still there, 2 matrix look like "0.99643 0 0 0.99643 -71.74332 220.49945" and "0.99643 0 0 0.99643 -60.78253 -531.09894".
Any chance you can post the source and conversion (or PM to me) so I can see what you are talking about? I kind of get it, but not completely. BTW, -mode fw turns on a lot of the options you're using. It's the same as:

-n -wrap- -col 1 -vb -2 -f2p -2 -t

If you don't want it to include -f2p -2 or -t, you can turn those off after you specify it, e.g.

-mode fw -f2p 0 -t-

Also, since you've turned off re-flow (-wrap-), you don't need to specify the -ws 0 option. It won't be used unless re-flow is turned on.
willus is offline   Reply With Quote