New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

office-print

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

office-print

一款用于在网页中打印Office文件的软件,可以打印包括Word、PowerPoint、Excel、PDF、图片等文件。

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

office-print

build status code coverage code style styled with prettier made with lass license npm downloads

打印精灵,一款用于在网页中打印Office文件的软件,可以打印包括Word、PowerP oint、Excel、PDF、图片等文件。

Table of Contents

详细信息请访问https://www.innben.com/print了解

Install

npm:

npm install office-print --save

yarn:

yarn add office-print --save

Usage

一、打印网络excel、Word、PowerPoint、PDF

const OfficePrint = require('office-print');

let fileUrl = 'your network excel url';
fetch(fileUrl).then(response => response.arrayBuffer()).then(arrayBuffer => {
  	let file = new File([arrayBuffer], filename);
	  const officePrint = new OfficePrint();
		officePrint.print(file)
});
// script

二、打印本地电脑中的excel、Word、PowerPoint、PDF

<input type="file" id="input">
const OfficePrint = require('office-print');

const inputElement = document.getElementById("input");
inputElement.addEventListener("change", handleFiles, false);
function handleFiles() {
    const fileList = this.files; /* 现在你可以处理文件列表 */
  	fileList.forEach(file => {
			const officePrint = new OfficePrint();
			officePrint.print(file)    
    });
}
// script

三、已知本地文件路径,直接打印本地电脑中的excel、Word、PowerPoint、PDF

const OfficePrint = require('office-print');

let fileUrl = 'your local file system excel url';
const officePrint = new OfficePrint();
			officePrint.printFile(fileUrl)    

Contributors

License

Keywords

FAQs

Package last updated on 05 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc