JSPM

electron-print-preview2

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q17653F
    • License ISC

    English | [中文](README-CN.md)

    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

      NPM

      Usage

      1. Create electron project
      2. npm i electron-print-preview
      3. 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.config.js
      module.exports = {
        publicPath: '.',
        pluginOptions: {
          electronBuilder: {
            externals: ['electron-print-preview']
          }
        }
      }