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

Need help; Footer is not displayed #144

Open
vaibhav15s opened this issue Apr 11, 2018 · 2 comments
Open

Need help; Footer is not displayed #144

vaibhav15s opened this issue Apr 11, 2018 · 2 comments

Comments

@vaibhav15s
Copy link

vaibhav15s commented Apr 11, 2018

Hi @westy92
I have used these options to print header and footer. But those are not displayed. Seems like the background is overwritten. (See attached image).
On page 1, the footer is not displayed, only part of left margin is displayed. While on page 4 when content is of the half page, the footer is coming properly.

footer -page-1
Footer of page 1 with full page content

footer -page-4
Footer of page 4 with half page content.

const options = {
  port: 9222, // port Chrome is listening on
 completionTrigger: new htmlPdf.CompletionTrigger.Timer(10000),
 printOptions: {
    marginTop: 0,
    marginBottom: 3,
    printBackground: true,	
    displayHeaderFooter: true,
headerTemplate: '<div style=" -webkit-print-color-adjust: exact; background-color: #40DCF4; height: 100%; width: 100%;" class="text title"></div>',

    footerTemplate: '<div style="-webkit-print-color-adjust: exact;  background-color: #4E5657;height: 50px; width: 100%; font-family: Droid Sans; font-size:10px;"><p class="text left">Copyright 2018</p><p class="text right">Page <span class="pageNumber"></span> of <span class="totalPages"></span></p></div>',
  },
};
@westy92
Copy link
Owner

westy92 commented Apr 11, 2018

Seems like a duplicate of #136.
Can you try the solution there?

@vaibhav15s
Copy link
Author

Hi @westy92
No this did not help. I tried marginBottom in html and printoptions but footer is not dispalyed properly.

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

2 participants