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

PDF Header and Footer not embedded because of line-breaks in template strings #1718

Closed
kozi opened this issue Feb 17, 2017 · 0 comments
Closed

Comments

@kozi
Copy link

kozi commented Feb 17, 2017

What is the current behavior?

The created PDF Header/Footer were not embedded!
Created pdf_header.html and pdf_footer.html in _layout/ebook/

  • CLI version: 2.3.0
  • GitBook version: 3.2.2
  • OS: Windows 10 (Using the Windows Powershell)

What is the expected behavior?

The created header and footer should occur in the resulting PDF.

Solution

I could solve the problem by removing the line-breaks in the generated template strings.
~/.gitbook/versions/3.2.2/lib/output/ebook/getConvertOptions.js 65ff

https://github.com/GitbookIO/gitbook/blob/3.2.2/lib/output/ebook/getConvertOptions.js#L65

'--pdf-header-template':    headerTpl.replace(/(\r\n|\n|\r)/gm,""),
'--pdf-footer-template':    footerTpl.replace(/(\r\n|\n|\r)/gm,"")
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