Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 09-27-2020, 10:13 AM   #1
Douman
Junior Member
Douman began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2020
Device: Pocketbook Aqua 2
EPUB to PDF - force image to be fit within single page

I normally prefer to convert my japanese books to pdf (allows me to force particular text orientation despite the device and handles furigana better)
But I encountered some issue with relatively big images being split across two pages, which I really don't like as it kinda ruins illustrations.

Sadly I do not see any option that would help to control how images are placed in pdf or at least forced to stay within single page.
So I hope maybe someone here have advise?
Thank you.

P.s. with epub my reader renders these images just fine without breaking anything (they are contained within single page)
Douman is offline   Reply With Quote
Old 09-27-2020, 10:23 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use something like:

img { max-height: 95vh !important}

in the extra css section of the conversion dialog.
kovidgoyal is offline   Reply With Quote
Advert
Old 09-27-2020, 10:52 AM   #3
Douman
Junior Member
Douman began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2020
Device: Pocketbook Aqua 2
Quote:
Originally Posted by kovidgoyal View Post
Use something like:

img { max-height: 95vh !important}

in the extra css section of the conversion dialog.
Yeah I also considered to try to limit img height myself, but sadly it didn't really work well.
I unzipped original epub to check dimensions and it is 1443x2048 and I have feeling when it renders onto pdf it just splits based on these dimensions
Probably in worst case I can just manually edit these epubs...
Douman is offline   Reply With Quote
Old 09-27-2020, 11:02 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
what happens when you try it?
kovidgoyal is offline   Reply With Quote
Old 09-27-2020, 11:05 AM   #5
Douman
Junior Member
Douman began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2020
Device: Pocketbook Aqua 2
Regardless of how I change max-height the image is rendered in the same way as it was originally.
I even tried to set it to simply 40%, but visually it looks the same size (still broke onto two pages)
Douman is offline   Reply With Quote
Advert
Old 09-27-2020, 11:39 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
what happens if you use 200px and what exactly are you putting in extra css?
kovidgoyal is offline   Reply With Quote
Old 09-27-2020, 11:47 AM   #7
Douman
Junior Member
Douman began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2020
Device: Pocketbook Aqua 2
Hm interestingly enough setting precise px value makes image smaller.

I'll probably have to adjust it for every book.
Probably smaller `vh` would work too, but I'm actually not sure what is viewport size in case of calibre.

Anyway, thanks.
Douman is offline   Reply With Quote
Old 09-27-2020, 11:55 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There is no viewport size, conversion to PDF happens via chromium's print to pdf feature. so the viewport is the page, and 95vh should work, no idea why it doesnt, you might need to add display:block to it as well.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EPUB to HTLM (single page) obihal Conversion 8 05-20-2014 01:45 PM
Images fit page as mobi, but not ePub Mat Ward ePub 2 12-19-2012 11:48 PM
converting epub to pdf: can't get the front page image in Nicoo Calibre 3 12-05-2009 08:18 AM
Any way to force page breaks when converting HTML to EPUB Bierkonig Calibre 23 10-31-2009 01:51 PM
PDF Fit Visible per page/landscape view jessesn Sony Reader 4 10-02-2006 10:42 AM


All times are GMT -4. The time now is 09:01 AM.


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