Skip to content
/ nprint Public

NPrint is a pure javascript web print library without browser plugins. NPrint是一个纯javascript的WEB打印库,使用它不需要安装任何浏览器插件。

License

Notifications You must be signed in to change notification settings

6tail/nprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPrint License

NPrint is a pure javascript web print library without browser plugins.

简体中文

Example

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Print Demo</title>
  </head>
  <body>
    <script src="nprint.js"></script>
    <script>
      //create a print document
      var doc = NPrint.createDocument();

      //set paper type
      doc.getPaper().setType('A4');

      //add a print page
      var page = doc.addPage();

      //add 100mm*26mm region at page center to fill text 'Hello World!',text size 10mm,text align CENTER
      page.addText().setWidth(100).setHeight(26).setAnchor(NPrint.ANCHOR.CENTER).setContent('Hello World!').setSize(10).setAlign(NPrint.ALIGN.CENTER);

      //preview
      doc.preview();

      //print
      //doc.print();
    </script>
  </body>
</html>

Output:

sample

Documentation

Please visit https://6tail.cn/nprint/api.html

About

NPrint is a pure javascript web print library without browser plugins. NPrint是一个纯javascript的WEB打印库,使用它不需要安装任何浏览器插件。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published