Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > PDF

Notices

Reply
 
Thread Tools Search this Thread
Old 02-18-2015, 11:18 PM   #1006
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,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by wdq4587 View Post
Let me explain:

First is I want export k2pdfopt processed PDF file to images and then convert to mobi file. Then I found I can not let even the native PDF output render pixel-for-pixel image result because the transformation matrix not equal to (1 0 0 1 x y). May be I can adjust let it look like 1.001 but not exactly to 1. That will cause pixel resampling while rending the page.

I know if I view the native PDF mode processed PDF in kindle directly, it will only scale once to screen. But in this situation I mean convert to other file format, extract images form the PDF file will not help, I need render the pages to get the split page and merge page result.

Secondary I also want in text reflow mode can has a option pixel-for-pixel, so the result filesize will not increase. I know there are some limitation, for example can not use Autostraighteen and so may be cause bad result.

But in other meaning, if the output file resolution not match the read device best resolution, the read device will do scale. And since the text reflow process have scaled once, then when reader view it will scale twice. I think scale twice can not have better quality then only scale once by read device, even it use bilinear interpolation and text reflow process use some advanced algorithm like bicubic.

Only way can get better quality now is not let the read device scale, only the text reflow process scale. That need output resolution just match the read device best display resolution which I don't know exactly. And this resolution will also change if some user using landscape mode and others using portrait mode.

My test file here: http://pan.baidu.com/s/1jGtGXpW password: 1h91

BTW, I also suggest add using percent option in GUI for -m option.
I cannot get your download link to work. I don't think I can help you. There is too much of a language issue here and I cannot understand enough about what you want to do. I'm also not quite sure why you are so concerned with pixel-for-pixel display. It is very difficult to get the bitmap from a PDF mapped one-to-one into your device display--and it is very unlikely that will result in the scale that you want. A good re-sampling algorithm which uses anti-aliasing will typically do a very good job.

FYI, you can specify -m values as a percentage of the source page size by putting 's' after them, but you have to use the "Additional Options" box--you can't use the GUI entries (yet). E.g. in the "Additional Options" box you can put:

-m 0.1s,0.1s,0.1s,0.1s

Last edited by willus; 02-19-2015 at 11:21 PM. Reason: Fixed -m options.
willus is offline   Reply With Quote
Old 02-19-2015, 02:45 AM   #1007
wdq4587
Junior Member
wdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterwdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterwdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterwdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterwdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterwdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterwdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterwdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterwdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterwdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterwdq4587 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
Posts: 5
Karma: 12852
Join Date: Feb 2015
Device: kpw2
I have tried (under resolution 699x1006)

-m 0.122s,0.144s,0.122s,0.81s

before my last post. It did not work as I expect, I mean the result has more area included than I expect compare to:

-m 74p,145p,74p,81p

I have not test more to see if I've made a mistake.

Then about pixel-for-pixel, I am not mean display, only a rare case you can display a book pixel-for-pixel in device screen (unless it's a text book). I mean convert. If a conversion process is lossless, you can to do it any passes without worry loss information. And in this particular case, I mean do not increase output filesize in text reflow mode, and font may be displayed more sharp than current scale twice process. The price of the pixel-for-pixel process is you can not do some rotate correction for scanned content. If you use native PDF mode, the PDF viewer program can do rotate correction and display scale operation in one pass (two transformation matrix multiply to one before apply), but it can not do text reflow now.
wdq4587 is offline   Reply With Quote
Old 02-19-2015, 08:50 AM   #1008
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,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by wdq4587 View Post
I have tried (under resolution 699x1006)

-m 0.122s,0.144s,0.122s,0.81s

before my last post. It did not work as I expect, I mean the result has more area included than I expect compare to:

-m 74p,145p,74p,81p

I have not test more to see if I've made a mistake.

Then about pixel-for-pixel, I am not mean display, only a rare case you can display a book pixel-for-pixel in device screen (unless it's a text book). I mean convert. If a conversion process is lossless, you can to do it any passes without worry loss information. And in this particular case, I mean do not increase output filesize in text reflow mode, and font may be displayed more sharp than current scale twice process. The price of the pixel-for-pixel process is you can not do some rotate correction for scanned content. If you use native PDF mode, the PDF viewer program can do rotate correction and display scale operation in one pass (two transformation matrix multiply to one before apply), but it can not do text reflow now.
There are options in place to control the size (scale) (-odpi) and bits per pixel (-bpc) of bitmap output from k2pdfopt, and also how it is encoded (-jpg, -png). That is what is available.
willus is offline   Reply With Quote
Old 02-19-2015, 11:28 PM   #1009
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,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by wdq4587 View Post
I have tried (under resolution 699x1006)

-m 0.122s,0.144s,0.122s,0.81s

before my last post. It did not work as I expect, I mean the result has more area included than I expect compare to:

-m 74p,145p,74p,81p

I have not test more to see if I've made a mistake.

...
I made a mistake in my example of the -m option using the 's' unit (three posts back). I have edited that post and fixed it, but let's say your source file is internally rendered at 700 x 1000 pixels using your specified input dpi value and you want to crop it as above (74p,145p,74p,81p). Then the equivalent 's' values would be 74/700,145/1000,74/700,81/1000, e.g.

-m .106s,.145s,.106s,.081s

The advantage of specifying this way is that the crop margins are independent of the resolution at which the source file is rendered.
willus is offline   Reply With Quote
Old 02-20-2015, 10:55 AM   #1010
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 829
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
On another issue, I just became aware of the sejda tool to work with PDF files. It has features that even pdftk lacks. I was able to use it in conjunction with k2pdfopt to merge the processed articles into a single PDF with an outline permitting access to each of the articles directly. I had been looking for a way to do so for a while, so I thought this might be of interest to others using your tool.

Dave
dhdurgee is offline   Reply With Quote
Old 02-26-2015, 08:59 PM   #1011
Louis_2015
Junior Member
Louis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterLouis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterLouis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterLouis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterLouis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterLouis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterLouis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterLouis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterLouis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterLouis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterLouis_2015 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
Posts: 1
Karma: 12852
Join Date: Feb 2015
Device: Kindle Paperwhite 2
i am having a problem converting a certain page
This is the page i am converting http://imagizer.imageshack.us/a/img538/4415/Z1QR38.jpg

This is the settings i am using
http://imagizer.imageshack.us/a/img661/8248/yyLpbe.jpg

This is the result
http://imagizer.imageshack.us/a/img661/3821/utMukp.jpg

This is the mark-up file
http://imagizer.imageshack.us/a/img537/1738/oEENhd.jpg

For what i see in the mark-up file , the blue "G" is the cause , Willus , do you have any idea what options should i try ?
Louis_2015 is offline   Reply With Quote
Old 02-26-2015, 10:35 PM   #1012
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,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by Louis_2015 View Post
i am having a problem converting a certain page
This is the page i am converting http://imagizer.imageshack.us/a/img538/4415/Z1QR38.jpg

This is the settings i am using
http://imagizer.imageshack.us/a/img661/8248/yyLpbe.jpg

This is the result
http://imagizer.imageshack.us/a/img661/3821/utMukp.jpg

This is the mark-up file
http://imagizer.imageshack.us/a/img537/1738/oEENhd.jpg

For what i see in the mark-up file , the blue "G" is the cause , Willus , do you have any idea what options should i try ?
This is discussed on the version history under v2.20:

- While not a perfect work-around, large, stylized first letters which frequently begin a book chapter (typically the height of 2 or 3 normal-sized text rows) are now detected when wrapping text lines so that the lines adjacent to them are more-or-less correctly wrapped. Still needs improvement.


Sorry, but that's as good as the conversion gets now--it chops up the G, but everything else is correctly re-flowed. I haven't improved it beyond that. I don't believe there are any options to affect this behavior significantly.
willus is offline   Reply With Quote
Old 02-27-2015, 03:17 PM   #1013
nook user
Member
nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.
 
Posts: 15
Karma: 25800
Join Date: Dec 2014
Device: Nook Simple Touch
Willus, we are getting impatient for the new release
nook user is offline   Reply With Quote
Old 02-27-2015, 09:01 PM   #1014
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,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by nook user View Post
Willus, we are getting impatient for the new release
I could release it as it is now, but it wouldn't have the changes you requested.
willus is offline   Reply With Quote
Old 03-05-2015, 02:31 PM   #1015
sp313
Junior Member
sp313 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2015
Device: Kindle Paperwhite
If you have a look at books about maths and physics which have their official Kindle versions on Amazon, eg. this one (click the cover to see a preview), the regular text is OCR'd but the mathematical symbols and equations are left intact, as images.

Would it be possible to do something similar with k2pdfopt? Right now the two options I've found are to leave the original text in and deal with a huge PDF file, or to leave only the OCR'd text and lose all equations.
sp313 is offline   Reply With Quote
Old 03-06-2015, 08:36 AM   #1016
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,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by sp313 View Post
If you have a look at books about maths and physics which have their official Kindle versions on Amazon, eg. this one (click the cover to see a preview), the regular text is OCR'd but the mathematical symbols and equations are left intact, as images.

Would it be possible to do something similar with k2pdfopt? Right now the two options I've found are to leave the original text in and deal with a huge PDF file, or to leave only the OCR'd text and lose all equations.
The issue here is how to tell k2pdfopt what is to be left as an image and what is to be OCR'd. I don't have an easy way to tell a bitmapped equation from bitmapped regular text. I would have to look more into the Tesseract OCR library. It may have a confidence factor in its OCR conversion, and I could leave regions with low confidence as bitmaps.
willus is offline   Reply With Quote
Old 03-06-2015, 07:58 PM   #1017
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,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
k2pdfopt v2.32 released

K2pdfopt v2.32 is released. This release adds a feature I've long wanted to implement in the MS Windows GUI--graphical selection of the crop margins. See all of the other new features, improvements and numerous bug fixes at the web site.
willus is offline   Reply With Quote
Old 03-06-2015, 09:52 PM   #1018
markom
Banned
markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.
 
Posts: 488
Karma: 1080260
Join Date: Sep 2012
Device: sony prs t1 kindle dx ipad
Quote:
Originally Posted by willus View Post
K2pdfopt v2.32 is released. This release adds a feature I've long wanted to implement in the MS Windows GUI--graphical selection of the crop margins. See all of the other new features, improvements and numerous bug fixes at the web site.
Great!

What would be the best way to crop the margins separately for odd and even pages before new release

Last edited by markom; 03-06-2015 at 10:00 PM.
markom is offline   Reply With Quote
Old 03-06-2015, 11:11 PM   #1019
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,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by markom View Post
Great!

What would be the best way to crop the margins separately for odd and even pages before new release
In this release, assuming you have the MS Windows version, you can now graphically select margins for the even and odd pages by putting 'e' or 'o', respectively, into the "Pages to convert" box and then clicking the "Margin Select" button for each case and selecting your crop rectangle. The hitch is that after each rectangle selection, you need to translate the values in the left, top, right, and bottom "Crop Margins" boxes to -cbox values and put them in as a -cbox option in the "Additional Options" box. E.g. if the left, top, right, and bottom "Crop Margins" filled in by the GUI Margin Select for the even 8.5 x 11 pages are 0.5 in, 0.75 in, 1 in, and 1.5 in, respectively, then you'd need to put in this into the "Additional Options" box:

-cboxe 0.5in,0.75in,7in,8.75in


The 'e' is for even pages, and the last two values are width (8.5in - 0.5in - 1in) and height (11in - 0.75in -1.5in). You can then add another -cbox option for odd pages (-cboxo ...). It's complicated, I know, but at least it's a little easier than it used to be now that I added the "Margin Select" option. I plan to make this easier in a future release.

Last edited by willus; 03-07-2015 at 08:26 AM. Reason: clarifications
willus is offline   Reply With Quote
Old 03-07-2015, 10:33 AM   #1020
nook user
Member
nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.nook user knows what's going on.
 
Posts: 15
Karma: 25800
Join Date: Dec 2014
Device: Nook Simple Touch
Great, thanks for the enormous job , Willus

But i have other question now
Let's assume, that we have page in this format:
========
Text
Picture (graphic) (table)
Text
=============

Is there any chance the picture or graphic or table to be stretched in landscape mode onto whole page and the text in the file to be in portrait mode...

In other words said - every one picture or graphic or table to be in landscape mode onto one whole page - for example

we have 2 pictures in the file on pages 4 and 8 -
Pages 4 and 8 will be converted automatically in landscape mode, showing only the pics...
Or we have to say, 3 pictures on page 5 - in this case, after conversion pages 5, 6 and 7 will be automatically re-shaped in landscape mode for the pictures on them....
nook user is offline   Reply With Quote
Reply

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:12 PM.


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