Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (electron-print-preview2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
English | 中文
electron-print-preview : Simulates the print preview module in the browser.
Install
Usage
- Create electron project
npm i electron-print-preview
- Use in background.js
const {printPreview} = require("electron-print-preview");
printPreview.default.getIntance().createPdfWindow(event, {
htmlString:`<style>h1{color: #42b983}</style> <h1>hello world !</h1>`
})
Warning
- If webpack is used to pack the main process, modify the following configuration in the webpack configuration of the main process
{
externals: {
'electron-print-preview': 'require("electron-print-preview")'
}
}
vue-cli-plugin-electron-builder
config example vue-cli-plugin-electron-builder-issue
// vue.config.js
module.exports = {
publicPath: '.',
pluginOptions: {
electronBuilder: {
externals: ['electron-print-preview']
}
}
}