Skip to content

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

@kozi

Description

@kozi

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,"")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions