Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/tan9/print-server

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/tan9/print-server

  • v0.0.0-20200924002925-76760b24fe18
  • Source
  • Go
  • Socket score

Version published
Created
Source

WebSocket Print Server

Simple WebSocket server that receives PDF content and print it out using Adobe Acrobat Reader. You can use this simple implementation to silent print PDF document to your default printer from web pages.

Prerequisites

  1. Windows environment.
  2. Have Adobe Acrobat Reader installed.
  • Tested on Acrobat Reader DC 2015 and Adobe Reader X.

Interface

The server will listen on localhost:9180, you can access http://localhost:9180 to check whether the server is up or down. You can then connect to the WebSocket server listen at ws://localhost:9180/print.

Request Message

After the WebSocket connection is established successfully, you can send stringified JSON with following structure to print:

{
  "id": "CORELEATION_ID",
  "body": "BASE64_ENCODED_PDF_DOCUMENT"
}

Response Message

Server will respond with either messages:

In case of successful print:

{
  "id": "CORELEATION_ID",
  "success": true,
  "message": ""
}

Note: The return code of Foxit Reader process is alway 0. I can't found a simple way to make sure if document be printed successfully.

In case of failed to print:

{
  "id": "CORELEATION_ID",
  "success": false,
  "message": "Fail reason..."
}

Development

Compiling print-server.go

  1. Install Go as described here.
  2. Install Gorilla WebSocket by executing go get github.com/gorilla/websocket.
  3. Install kardianos/service by executing go get github.com/kardianos/service.
  4. Run go run print-server.go to start server.

Compiling print.au3

  1. Install AutoIt
  2. Compile print.au3 using Aut2Exe to compile it to executable as described here.

FAQs

Package last updated on 24 Sep 2020

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