npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

electron-vue-printer

v1.3.3

Published

An electron-vue plugin, silent print pictures。electron-vue可静默打印图片插件。

Downloads

25

Readme

Features

  • Silent print
  • Ultra small
  • Simple usage
  • No other dependencies

Hint

  • Version number: v3.1.13、 v7.3.2、 v8.5.0、 v9.2.1 perfectly usable.The corresponding minor version number should be the same.
  • Version number: v5.0.13、 v6.1.12 is available, but only the default printer can be used.The corresponding minor version number should be the same.
  • Version v4 has various problems, so support is dropped.

Installation

npm install electron-vue-printer -S
or
yarn add electron-vue-printer -S

Usage

index.vue -->
<template>
  <div class="index">
    <electron-vue-printer
      ref="electronVuePrinter"
      :silent="false"
      @webview-ready="webviewReady"
    ></electron-vue-printer>
  </div>
</template>

<script>
  import electronVuePrinter from 'electron-vue-printer'

  export default {
    name: "index",
    components: {
      electronVuePrinter
    },
    methods: {
      webviewReady() {
        this.$refs.electronVuePrinter.print('https://cdn.pixabay.com/photo/2017/06/10/07/29/printer-2389244_960_720.png');
      },
    },
  }
</script>

| Configuration | Type |Default| Description | ------------- | ----- | ----- | ----------- | | options | object | | options.offsetX: number. Left the offset,default 0. | | | | | options.offsetY: number. Top the offset,default 0. | | | | | options.imageWidth: number. Width of picture. | | | | | options.imageHeight: number. Height of picture. | | rotateType | number | 0 | Image rotation direction. 0: normal;1: Clockwise;2: Counterclockwise;3: Upside down. | | imgStyle | string | | Customize image styles.Width and height can override options.imageWidth and options.imageHeight.Transform will cause rotateType to become invalid. | | show | boolean| false | Whether to display preview.For debugging. | | silent | boolean| false | Whether to enable silent printing. |

| Events | Description | -------------- | ----------- | | dom-ready(webview) | The webview for the user to render the printed content is ready,And return the dom of the webview. | | get-printer-list(data: Array) | Return printer list data.Maybe setPrinterName method can use it. | | webview-render-begin | Print content starts to render. | | webview-render-finish | The printed content is rendered. | | start-printing(state: Boolean) | Start printing, and return whether to start printing normally. |

Methods

  • print([src,base64]:String) - Set print picture src(The absolute path of the local picture or the address of the online picture) or base64 to trigger print automatically.
  • setPrinterName(name:String, callBack(err)) - Set the printer device name.If you don't want to use the default printer, you can use it.If err in callBack is not empty, it means the setting failed.

License

MIT