05-21-2018, 10:27 AM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: May 2018
Device: iBook
|
How to add image logo to the header when converting to pdf
Calibre does a very good job of converting ePUB to pdf. One thing I am still not able to achieve is to add an image (like a logo) to the header.
Is it supported? I tried something like: --pdf-header-template "<table><tr><td width='30%'><img src='EPUB/img/logo.png'/></td><td width='40%' align='center'>Some Title</td><td width='30%' align='right'>Jan 21, 2018</td></tr></table>" Tried various path in src attribute if img tag but to no avail. Is there any plan to add this in case it is not supported yet? Thanks |
05-21-2018, 10:42 AM | #2 |
creator of calibre
Posts: 44,558
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can use any arbitrary HTML you like, however you cannot use paths, instead use a data URL (google how to create and use them).
|
05-22-2018, 10:04 AM | #3 |
Junior Member
Posts: 4
Karma: 10
Join Date: May 2018
Device: iBook
|
Thanks for your reply Kovid.
But it did not work with dataURL as well. I used following img tag <img src='data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOy DZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQ AosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIg UhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB 0UjIQA7'/> Please let me know if I am missing anything. |
05-22-2018, 11:12 AM | #4 |
creator of calibre
Posts: 44,558
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Post the full command line you are using.
|
05-22-2018, 05:50 PM | #5 |
Junior Member
Posts: 4
Karma: 10
Join Date: May 2018
Device: iBook
|
"C:\Program Files\Calibre2\ebook-convert.exe" test.epub .pdf --pdf-footer-template "<p style='text-align:center; text-indent: 0;'>_PAGENUM_</p>" --pdf-header-template "<table width='100%'><tr><td width='40%' align='center'>Name Here</td><td width='30%' align='center'><img src='data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOy DZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQ AosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIg UhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB 0UjIQA7'/></td><td width='30%' align='center'>Jan 18, 2018</td></tr></table>"
|
05-23-2018, 06:54 AM | #6 |
creator of calibre
Posts: 44,558
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
05-23-2018, 09:15 AM | #7 |
Junior Member
Posts: 4
Karma: 10
Join Date: May 2018
Device: iBook
|
Great. Thanks. I will check in next release. Any tentative date?
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to just add a cover page in a pdf file without converting it? | bob_bookworm | Conversion | 9 | 04-23-2022 07:16 AM |
In a tough spot, need to add gutter (inner margin) while converting epub->pdf | Terikan | 1 | 08-11-2016 05:53 AM | |
Did you encounter a same problem about converting PDF to text/word/image | Ivymin | 3 | 11-29-2011 09:45 PM | |
add image to pdf | moomintroll | Library Management | 1 | 07-25-2011 09:39 PM |
converting epub to pdf: can't get the front page image in | Nicoo | Calibre | 3 | 12-05-2009 09:18 AM |