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 05-21-2018, 10:27 AM   #1
prkumar
Junior Member
prkumar began at the beginning.
 
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
prkumar is offline   Reply With Quote
Old 05-21-2018, 10:42 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: 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).
kovidgoyal is offline   Reply With Quote
Old 05-22-2018, 10:04 AM   #3
prkumar
Junior Member
prkumar began at the beginning.
 
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.
prkumar is offline   Reply With Quote
Old 05-22-2018, 11:12 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: 44,558
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Post the full command line you are using.
kovidgoyal is offline   Reply With Quote
Old 05-22-2018, 05:50 PM   #5
prkumar
Junior Member
prkumar began at the beginning.
 
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>"
prkumar is offline   Reply With Quote
Old 05-23-2018, 06:54 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: 44,558
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...20046f8abbf198
kovidgoyal is offline   Reply With Quote
Old 05-23-2018, 09:15 AM   #7
prkumar
Junior Member
prkumar began at the beginning.
 
Posts: 4
Karma: 10
Join Date: May 2018
Device: iBook
Great. Thanks. I will check in next release. Any tentative date?
prkumar is offline   Reply With Quote
Reply


Forum Jump

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 PDF 1 08-11-2016 05:53 AM
Did you encounter a same problem about converting PDF to text/word/image Ivymin PDF 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


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


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