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

Leaked print header and footer appear when printing Marpit deck inside iframe #108

Closed
yhatt opened this issue Dec 17, 2018 · 0 comments · Fixed by #109
Closed

Leaked print header and footer appear when printing Marpit deck inside iframe #108

yhatt opened this issue Dec 17, 2018 · 0 comments · Fixed by #109

Comments

@yhatt
Copy link
Member

yhatt commented Dec 17, 2018

Recently we found a strange case: the unexpected print header and footer is appeared.

import Marpit from '@marp-team/marpit'
import fs from 'fs'

const marpit = new Marpit()
const { html, css } = marpit.render('# Hello')

fs.writeFileSync('deck.html', `<!DOCTYPE html><html><body><style>${css}</style>${html}</body></html>`)
<!DOCTYPE html>
<html>
  <body>
    <iframe src="deck.html" id="iframe"></iframe>
    <button onclick="document.getElementById('iframe').contentWindow.print()">Print</button>
  </body>
</html>

When you hit "Print" button in Chrome 71, print header and footer are appeared in print preview. But it would disappear if you change any print option.

A printed PDF is here.

We should be expected to hide print header and footer by default.

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

Successfully merging a pull request may close this issue.

1 participant