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

feat: allow customization of print page header and footer #19688

Merged
merged 3 commits into from Aug 9, 2019

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Aug 8, 2019

Description of Change

Refs: #17523

This PR allows users to customize print settings further by setting a custom header and footer by adding the following to print setting options:

  * `headerFooterInfo` Object (optional)
    * `header` String - String to be printed as page header.
    * `footer` String - String to be printed as page footer.

Tested to work with the following:

win.webContents.print({
   copies: 2,
   headerFooterInfo: {
      header: 'ALL HAIL BLINI CAT',
      footer: 'https://imgur.com/gallery/jQecn'
   }
}, (success, reason) => {
   console.log(`printing ${success ? 'did' : 'did not'} succeed: ${reason}`)
})

and an html page containing one link to this image

cc @deepak1556 @brenca @jkleinsc

Checklist

Release Notes

Notes: Added options to enable customization of print page headers and footers.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Aug 8, 2019
@codebytere codebytere added the semver/minor backwards-compatible functionality label Aug 8, 2019
Copy link
Contributor

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good but I think we can simplify the parameters

docs/api/web-contents.md Outdated Show resolved Hide resolved
Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with build issue fixed.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 9, 2019
@codebytere codebytere merged commit 7861e9f into master Aug 9, 2019
@release-clerk
Copy link

release-clerk bot commented Aug 9, 2019

Release Notes Persisted

Added options to enable customization of print page headers and footers.

@codebytere codebytere deleted the few-more-print-stgs branch August 9, 2019 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/printing semver/minor backwards-compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants