question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Footer/Header and images

See original GitHub issue

I’m trying to include images in my header, using the option file. My config.json file looks like:

{
	"highlight_style": "monokai",
	"html_pdf_options": {
		"format": "A4",
		"border": "15mm",
		"header": {
			"height": "15mm",
			"contents": "<div style='width:100%;text-align: right; border-bottom: 1pt solid #eeeeee;'><font size='-1'>A <b>Team</b><em>A</em> document</font> <img style=\"vertical-align:middle;margin-right:10px;margin-left:10px;\" width=\"60px\" src=\"https://goo.gl/HkfCvS\"/> </div>"
		},
		"footer": {
			"height": "15mm",
			"contents": {
        "default": "<hr width='110%'><div style='float:right;'>Page {{page}}/{{pages}}</div>"
			}
		}
	}
}

As a result, I can see the picture location, but only white space instead of of picture…

Even if I remove any style option, the picture never displays.

Can we have conversion log (PhantomJS ?) ? That could help to understand the situation…

Thanks Nekloth

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
neklothcommented, May 30, 2018

Ok.

Now, I have this settings that does the job:

module.exports = {
	pdf_options: {
		format: 'A4',
		margin: '20mm 12mm 20mm 12mm',
		displayHeaderFooter: true,
		headerTemplate: `
			<style>
				.header, .footer{ font-family: "Segoe UI", Arial, freesans, sans-serif; padding: 0mm; margin: 2mm ; width: 100%; text-align: right ;}
        .header { font-size: 10px; }
        .footer {font-size: 9px;}
				.border-bottom { border-bottom: 1pt solid #eeeeee; }
        .border-top { border-top: 1pt solid #eeeeee; }
			</style>
			<div class="border-bottom header">A <b>Team</b> document <img height="20" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARAAAABcCAYAAACm5+q2AAAXGElEQVR4Ae1dC5QcVZm+OtOBwC6CwiqCCBIQkAWSqpqEkNhdt3uyQeJBgSi4uwoIihtchJgF5TGarpoJicACCkFANuGBBhcQH5DMJA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vebjGOyx/DmstaGhogADiNq1CjgQiM9aK0NDQylNvaVzkge5eDLpiGhoaSQVhan4+uL3p5IG5z90bD2etDw0NHYkgl9FEAnmJYNLdStDQ0MDYDjiJqT22BHcqc77T0NCI3zCIO8F1UTu0Q40Ksys29qGhoQGHMe4EV6M028gkQ54P+uBaRpjwP9agoaEBb1PYYgoiuYY7/uMjDWbP5L0tUJ/arn8bRGcwZmYaGhoab59kh9Jr2vWP5k6lA/6o3PWO4q7/fq3naDVoaGhoaGhoaPwP1Ihp8Bm98aYAAAAASUVORK5CYII=" /></div>
		`,
		footerTemplate: `
			<div class="border-top footer">
				Page <span class="pageNumber"></span> / <span class="totalPages"></span>
			</div>
		`,
	}
}

This will display header and footer information on the right of the page, with a bottom/top border.

And picture works well too: image

TL;DR : that looks good for me! 😃

0reactions
salmonjeancommented, Aug 14, 2019

Thanks for the tip! It works ! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add images to a header or footer - Microsoft Support
Add images to a header or footer · Go to Layout > View > Page Layout. · On the Header or Footer pop-up...
Read more >
Header And Footer Pictures, Images and Stock Photos - iStock
Search from 8961 Header And Footer stock photos, pictures and royalty-free images from iStock. Find high-quality stock photos that you won't find anywhere ......
Read more >
Header footer Images - Free Download on Freepik
Find & Download Free Graphic Resources for Header Footer. 5000+ Vectors, Stock Photos & PSD files. ✓ Free for commercial use ✓ High...
Read more >
88710 Header Footer Images, Stock Photos & Vectors
Find Header Footer stock images in HD and millions of other royalty-free stock photos, illustrations and vectors in the Shutterstock collection.
Read more >
40469 results for header and footer in images - Adobe Stock
Search from thousands of royalty-free Header And Footer stock images and video ... Download royalty-free stock photos, vectors, HD footage and more on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found