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

Problem putting image into footer #38

Closed
kahwooi opened this issue Jan 2, 2015 · 3 comments
Closed

Problem putting image into footer #38

kahwooi opened this issue Jan 2, 2015 · 3 comments

Comments

@kahwooi
Copy link

kahwooi commented Jan 2, 2015

I wanted to put a QR image in every page, but it does not show.

Can I insert an image into footer or header?

@pofider
Copy link
Contributor

pofider commented Jan 2, 2015

Header is printed to pdf in a synchronous way. This mean any async request like getting image will not finish in time. This is current limitation of phantom.js

Solution:
Add the same image to template content and hide it with style display:none. Then you can add it to the header and it will show up because it is already cached and no asynchronous request is needed. This is required to do for both image referenced with url as well for Data URI scheme base64 image.

@pofider
Copy link
Contributor

pofider commented Apr 19, 2015

Added documentation for this into http://jsreport.net/learn/phantom-pdf

@pofider pofider closed this as completed Apr 19, 2015
@Raymond-Does
Copy link

Perhaps useful, when you enter svg data instead of a ref to an image like: <svg width="100" height="100"> <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" /> </svg> it will work. I know an svg is not a bitmap but in some cases it might be an option.

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

No branches or pull requests

3 participants