Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footer/Header and images #13

Closed
nekloth opened this issue May 28, 2018 · 10 comments
Closed

Footer/Header and images #13

nekloth opened this issue May 28, 2018 · 10 comments
Labels

Comments

@nekloth
Copy link

nekloth commented May 28, 2018

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

@simonhaenisch
Copy link
Owner

There is an open issue about that: marcbachmann/node-html-pdf#12

I'm almost done changing from phantomjs to headless chromium, and that will allow a --devtools flag to reveal the browser window and inspect the document instead of saving to PDF. It will introduce a few changes though, and one breaking one is that the pdf config will be different, but it will allow a headerTemplate and footerTemplate (see puppeteer docs), which will hopefully support images.

One other breaking change will be that only files within the markdown file's directory (and subdirectories) will be able to be referenced (a limitation/security feature in chromium, it throws "Not allowed to load local resource" when using the file:// protocol), but that shouldn't be an issue?

@nekloth
Copy link
Author

nekloth commented May 28, 2018

Ok, great ! Thank you !

Hum ... the limitation can be an issue for me right now as I'm trying to keep assets in the same folder (header picture is the company logo), different from the MD folder

@simonhaenisch
Copy link
Owner

Ok, I'll think of a solution for that... maybe it's easy to add an --assetsDir option to set an additional directory that will be served (which would need to be referenced under a different path though, e.g. prefixed with assets/). An alternative workaround till I get around doing that would be to host those files on a service like Zeit's now or reference them from your website (but would require an internet connection).

@nekloth
Copy link
Author

nekloth commented May 28, 2018

Parameter is fine for me. Hosting file on external service is not (but my only need should not drive you !).

simonhaenisch added a commit that referenced this issue May 28, 2018
@simonhaenisch
Copy link
Owner

simonhaenisch commented May 29, 2018

I just pushed 2.0. Please see the updated readme section and Puppeteer docs for how to use headers/footers now.I played around with it and it's still a little buggy regarding styling (the main document styles don't get applied to it and the initial font size is super tiny), but works ok.

Also please note that the pdf options key has been renamed to --pdf-options/pdf_options (because we're not using html-pdf anymore).

Btw you can also use a config.js instead of a .json (if you want to use template strings for the header/footer options):

module.exports = {
  pdf_options: {
    format: 'A4',
    margin: {
      top: '15mm',
      bottom: '15mm',
      left: '15mm',
      right: '15mm'
    },
    displayHeaderFooter: true,
    headerTemplate: `
      <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>"
    `
  }
}

@simonhaenisch
Copy link
Owner

simonhaenisch commented May 29, 2018

Update: Just tried referencing an image in the header template and sadly it does not work except with data URLs, e.g. <img src="data:image/png;base64,{encoded-image}"> (there are services like b64.io to help).

At least it stays within the config that way, but with larger images it gets quite cluttered :/ What you could do is use a .js config file like I mentioned above, npm install a base64 image converter and inline the conversion into the config. Only other solution for now might be to use a DOM element with a certain id and inject that onto every page (similar to what phantomjs did), but I won't have time to implement that currently (and don't really need it myself).

Some related upstream issues regarding styling and images: puppeteer/puppeteer#1822, puppeteer/puppeteer#1853, puppeteer/puppeteer#2388, puppeteer/puppeteer#2604.

@nekloth
Copy link
Author

nekloth commented May 30, 2018

Thanks for the details.

I made some tests using version 2.1.0, using an external js file for config.

I have trouble with the style applied to header/footer : size is ridiulously small! Do you know which style is applied?

module.exports = {
	pdf_options: {
		format: 'A4',
		margin: {
		  top: '15mm',
		  bottom: '17mm',
		  left: '12mm',
		  right: '12mm'
		},
		displayHeaderFooter: true,
		headerTemplate: `
			<div style='width:100%;text-align: right; border-bottom: 1pt solid #eeeeee;'>A <b>Team</b>document </div>
		`,
		footerTemplate: `
			<hr width='110%'><div style='float:right;'>Page {{page}}/{{pages}}</div>
		`
	}
}

In addition to that, Page {{page}}/{{pages}} is not interpreted anymore.

I tried IMG with external file and you are right it does work. I did not try the base64 yet, but if it does work, that is fine for me (I won't integrate large picture in header/footer, just a small company/team logo).

Nekloth

@simonhaenisch
Copy link
Owner

Try setting the font size explicitly, e. g. by inlining a <style/> tag into the header template (will also be applied to the footer). Instead of {{page}}/{{pages}} use elements with class pageNumber/totalPages now (there is also date, title and url).

This should work:

module.exports = {
	pdf_options: {
		format: 'A4',
		margin: '15mm 12mm 17mm',
		displayHeaderFooter: true,
		headerTemplate: `
			<style>
				div { font-family: system-ui; font-size: 11px; }
				.border-bottom { border-bottom: 1pt solid #eeeeee; }
			</style>
			<div class="border-bottom">A <b>Team</b> document</div>
		`,
		footerTemplate: `
			<hr width='110%'>
			<div>
				Page <span class="pageNumber"></span>/<span class="totalPages"></span>
			</div>
		`,
	}
}

However I was struggling to get certain rules like text-align: right or float: right to work. margin works though, e. g. adding margin: 0 auto to the div styles centers it. There seems to be a scaling issue with the header and footer, because margin-left: 10mm in the header/footer doesn't align with 10mm page margin.

@nekloth
Copy link
Author

nekloth commented 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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AJYg4BlRSYfvECcy/vPTENDI7nIzd94GFV4iKbORqb1Q6QIBzyiyHHDrK7qHkxDQyPZyLj+jVKtDiE6sjHdTsZxz3Z8l7UGNDR01QUlVclBZy9iOBSiipF6tuDLizEk6OiW6JsZwGdirQENDQ1I0cP6eogb/lHb8Rfbru8gckBEwx1vebjGOyx/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! :)

@salmonjean
Copy link

Thanks for the tip! It works ! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants