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 05-05-2020, 01:25 PM   #1786
Shohreh
Connoisseur
Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'
 
Posts: 52
Karma: 42650
Join Date: Jan 2016
Device: none
Thanks for the offer: https://we.tl/t-KA9InMaCCd

It looks much better. I just need to leave a bit more on the right, before merging the pages back into a single PDF.

k2pdfopt input.pdf -m 0.8 -mode fw -ls- -o output.pdf -p 30-40,70-75

--
Edit: While we're at it: Can k2pdfopt crop such and such page, and then turn them into pictures in place, without having to do this myself?

ie.
1. Use k2 to crop margins and rescale text
2. Export those pages
3. Convert to PNG
4. Convert to PDF
5. Merge all pages into hybrid PDF (text + pics)

Or maybe k2 can massage the PDF in such as way that there's simply no need to turn problematic pages into pictures (eg. tables, insets, etc.)?
Attached Thumbnails
Click image for larger version

Name:	C7C208E7-C147-4ADE-9835-5C0798733AD9.png
Views:	15
Size:	65.7 KB
ID:	179092  

Last edited by Shohreh; 05-05-2020 at 02:26 PM.
Shohreh is offline   Reply With Quote
Old 05-05-2020, 10:25 PM   #1787
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,118
Karma: 8504331
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by Shohreh View Post
Thanks for the offer: https://we.tl/t-KA9InMaCCd

It looks much better. I just need to leave a bit more on the right, before merging the pages back into a single PDF.

k2pdfopt input.pdf -m 0.8 -mode fw -ls- -o output.pdf -p 30-40,70-75

--
Edit: While we're at it: Can k2pdfopt crop such and such page, and then turn them into pictures in place, without having to do this myself?

ie.
1. Use k2 to crop margins and rescale text
2. Export those pages
3. Convert to PNG
4. Convert to PDF
5. Merge all pages into hybrid PDF (text + pics)

Or maybe k2 can massage the PDF in such as way that there's simply no need to turn problematic pages into pictures (eg. tables, insets, etc.)?
I'm not really sure what you're asking above. I think the point of using k2pdfopt is to avoid exactly those steps. k2pdfopt internally converts every page to a bitmap for a graphical analysis. It can then save a bitmap to the output file or use its internal bitmap to figure out how to insert cropping instructions into the native PDF file (which is what -mode fw does).

Also, I don't think you need to use the -m option since your PDF is very clean (not scanned). k2pdfopt will automatically trim away the margins in the fit-width mode (-fw). What is wrong with the output from this:

k2pdfopt -mode fw -ls- twilight.pdf

Which converted pages don't you like?
willus is offline   Reply With Quote
Old 05-06-2020, 06:44 PM   #1788
Shohreh
Connoisseur
Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'
 
Posts: 52
Karma: 42650
Join Date: Jan 2016
Device: none
Sorry: It's because I started this journey with Calibre to turn PDF into EPUB. After seeing that my e-reader could actually read PDF rather well except complicated layouts such as tables, I figured I could just turn those pages into bitmaps and generate an hybrid PDF (text/bitmaps).

And then it dawned on me that k2pdfopt made all this useless since it can massage the whole file.

As for the particular PDF I sent: It looks perfect on the computer (SumatraPDF), but on my 6 inch e-reader (768x1024, 212 DPI), some pages are a bit messy although, strangely enough, those only contain only text, in one column.

I used the command above:
Code:
k2pdfopt -mode fw -ls- twilight.pdf
Why does it occur, and what could I try?

https://postimg.cc/gallery/YLbzKXP
Shohreh is offline   Reply With Quote
Old 05-06-2020, 11:27 PM   #1789
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,118
Karma: 8504331
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by Shohreh View Post
Sorry: It's because I started this journey with Calibre to turn PDF into EPUB. After seeing that my e-reader could actually read PDF rather well except complicated layouts such as tables, I figured I could just turn those pages into bitmaps and generate an hybrid PDF (text/bitmaps).

And then it dawned on me that k2pdfopt made all this useless since it can massage the whole file.

As for the particular PDF I sent: It looks perfect on the computer (SumatraPDF), but on my 6 inch e-reader (768x1024, 212 DPI), some pages are a bit messy although, strangely enough, those only contain only text, in one column.

I used the command above:
Code:
k2pdfopt -mode fw -ls- twilight.pdf
Why does it occur, and what could I try?

https://postimg.cc/gallery/YLbzKXP
Try turning off native mode so that you get bitmapped output. Your e-reader shouldn't be able to mess that up:

k2pdfopt -mode fw -ls- -n- twilight.pdf
willus is offline   Reply With Quote
Old 05-07-2020, 07:39 AM   #1790
Shohreh
Connoisseur
Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'
 
Posts: 52
Karma: 42650
Join Date: Jan 2016
Device: none
Thanks for the tip.

As expected, the filesize is much bigger (6x).

FWIW, my e-reader offers a few settings when reading PDFs, one of them being a "Reflow text" option: The issue I had (some pages, with basic text, being a bit messy) occurs when I enable this option.

OTOH, with the "bitmapped file" (-mode fw -ls- -n-):
"Reflow text" enabled: The layout has even more issues than the native PDF (without -n-)
"Reflow text" disabled: Better, although I'll need to add a bit more margins because they're too close from the edge.

I'm surprised bitmaps can be reflowed at all, since they're just pictures, unlike native PDFs.

Out of curiosity, why does this layout issue occurs with some pages in native PDF, with pages that only contain text? I would have expected this issue with more complicated layout (tables, insets, etc.)
Shohreh is offline   Reply With Quote
Old 05-07-2020, 07:58 AM   #1791
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,118
Karma: 8504331
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by Shohreh View Post
Thanks for the tip.

As expected, the filesize is much bigger (6x).

FWIW, my e-reader offers a few settings when reading PDFs, one of them being a "Reflow text" option: The issue I had (some pages, with basic text, being a bit messy) occurs when I enable this option.

OTOH, with the "bitmapped file" (-mode fw -ls- -n-):
"Reflow text" enabled: The layout has even more issues than the native PDF (without -n-)
"Reflow text" disabled: Better, although I'll need to add a bit more margins because they're too close from the edge.

I'm surprised bitmaps can be reflowed at all, since they're just pictures, unlike native PDFs.

Out of curiosity, why does this layout issue occurs with some pages in native PDF, with pages that only contain text? I would have expected this issue with more complicated layout (tables, insets, etc.)
You’d have to ask tech support for your e-reader why those issues come up, but like you said, it has to do with enabling the reflow text option. As you said, Sumatra shows the file okay, so it’s an issue with the PDF display software in your reader. I’m surprised if your reader is trying to modify a bitmapped page, but it’s possible—especially if it uses some fork of KOReader or Duokan. KOReader reflow actually uses code from k2pdfopt (ha ha).

You can increase the output margins with the -om command-line option, e.g. -om 0.2 will add 0.2 inches of padding around the output pages.

Last edited by willus; 05-07-2020 at 08:03 AM.
willus is offline   Reply With Quote
Old 05-07-2020, 08:46 AM   #1792
Shohreh
Connoisseur
Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'
 
Posts: 52
Karma: 42650
Join Date: Jan 2016
Device: none
Thanks much!

--
Edit: I went through the list of commands, but didn't find how to do this.

Since only some pages are wrongly displayed on my e-reader, is it possible to have k2 only turn those into bitmaps, while leaving the rest as text (native PDF)?

And out of curiosity, would you have an idea why my e-reader goes crazy with those, although they only contain basic text (so shouldn't be a problem)?

Last edited by Shohreh; 05-07-2020 at 03:32 PM.
Shohreh is offline   Reply With Quote
Old 05-08-2020, 01:45 PM   #1793
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,118
Karma: 8504331
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by Shohreh View Post
Thanks much!

--
Edit: I went through the list of commands, but didn't find how to do this.

Since only some pages are wrongly displayed on my e-reader, is it possible to have k2 only turn those into bitmaps, while leaving the rest as text (native PDF)?

And out of curiosity, would you have an idea why my e-reader goes crazy with those, although they only contain basic text (so shouldn't be a problem)?
The best option is to use native mode for the whole thing and try to tell your reader not to do any reflow or anything else to the file. There is no way to do native mode on some pages and bitmapped output on others--you would have to do it both ways, creating two separate output files, and then merge the pages from each output file that you want into one final file using a program like cpdf. As I said in a previous post, I can't explain why your particular e-reader is displaying the PDF strangely if a standard reader like Sumatra is not. It would have to do with the particular PDF display software installed on your reader.
willus is offline   Reply With Quote
Old 05-08-2020, 04:09 PM   #1794
Shohreh
Connoisseur
Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'Shohreh understands when you whisper 'The dog barks at midnight.'
 
Posts: 52
Karma: 42650
Join Date: Jan 2016
Device: none
Yes, disabling "Reflow text" and adding a .2 inch margin looks pretty good. Thank you.
Shohreh 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 09:55 AM.


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