09-08-2015, 02:17 AM | #1 |
Enthusiast
Posts: 40
Karma: 10
Join Date: Jul 2015
Device: none
|
correct way to set background image to pdf's
Hi, ive found a method to set a background image when converting from epub to pdf, but it only works in one instance
basically entailing setting a background image file in the stylesheet.css like body { url('sometexture.jpg') } and setting all .calibre elements in the ebook with css margin-left and margin-right values (forget if also needed in the convert book > look and feel tab) so looks like : .calibre, .calibre1, .calibre2, .calibre3, .calibre4, .calibre5, .calibre6, .calibre7 { margin-left: 30pt; margin-right: 30pt; } then in the convert book > page setup, configuring those left and right margins to 0.0pt with the one ebook that does it right, means the margins look the same as having 30pt set in page setup, and the whole page is textured. All other ebooks tried on, the css margins arent applied and the text is pushed to the edges of the page, and the regular method of setting margins in the page setup tab results in the sides not applying the texture So am looking for a better way to apply css background textures to epub files converted to pdf update: Resolved got the idea to try setting values for things like p, div, blockquote, whatever format the epub uses to set margins, and found the solution to be something along the lines of p { padding-left: 30pt; padding-right: 30pt } for anything wrapped in p, that fixes it. Also found the ebook working atm has alotof double instance blockquotes like <blockquote class="calibre_2"><blockquote class="calibre_15">bla bla bla</blockquote></blockquote> and found for those, needed the padding halved, being applied twice, so blockquote { padding-left: 15pt; padding-right: 15pt } Last edited by ni_c; 09-08-2015 at 04:07 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
svg image on top of a background png image | roger64 | ePub | 25 | 04-24-2015 11:00 AM |
CBZ -> PDF How to set image resolution | jpl98 | Conversion | 2 | 05-26-2011 07:07 AM |
"Insert Image" renames .jpg's incorrectly... but shows the correct image! | megacoupe | Sigil | 4 | 03-06-2011 08:13 PM |
epub - set authors from cmd line not correct | dapjukebox | Calibre | 2 | 07-27-2009 04:18 PM |
Pdf background darker than LRF/RTF background | LOL2005 | Sony Reader | 2 | 10-23-2007 11:00 AM |