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

@illgrenoble/visa-print-server

v1.1.3

Published

A print server to transfer print jobs from a VISA instance to a print client via websocket

Downloads

5

Readme

VISA Print Server

npm version

The VISA Print Server is used to transfer PDF documents via websocket to a VISA Print Client which opens a print dialog on the host computer of the VISA user.

The transfer is triggered by a request from the VISA CUPS Driver when a user prints a document in an instance. It clients are available it will send chunked data to all that have printing enabled.

The VISA Print Client, an angular module integrated into the VISA front end, receives the PDF data and informs the user/opens a print dialog.

An authentication proxy is used to ensure that only the owner of an instance can connect to the VISA Print Server and receive print requests.

The user then selects a local printer to print the document or saves the PDF as a local file.

Building and running

The server can be built and run from source as follows:

npm install
npm start

You can also run it directly from the npm pacakge:

npm i -g @illgrenoble/visa-print-server
visa-print-server

Configuration

The following environment variables can be set to configure the VISA Print Server:

|Environment variable|default value|description| |---|---|---| |VISA_PRINT_SERVER_HOST|localhost|Host on which the web server listens to| |VISA_PRINT_SERVER_PORT|8091|The web server port| |VISA_PRINT_SERVER_AUTH_TOKEN| |An authorisation token that (when set) must be added to the request header x-auth-token| |VISA_PRINT_SERVER_WEBSOCKET_MAX_DATA|16384|Maximum chunk size that is sent via the websocket|

The environment variables can be stored in a .env file.

Demo

A demo is available to quickly test the connection between a client and a server, the transfer of a PDF file via websocket and the opening of the print dialog in the client.

To start the server locally run the following commands in a terminal:

npm i -g @illgrenoble/visa-print-server
visa-print-server

This will start up the VISA Print Server on localhost:8091 without authentication enabled.

In another terminal, use the following commands to build and run the client:

git clone https://github.com/ILLGrenoble/visa-print-client.git
cd visa-print-client
npm install
npm run build:lib
npm start

The client will automatically connect to the websocket server on localhost and enable the printing queue. Open a browser window at http://localhost:4200 (you should only see a grey window). In a debug console you should see that the websocket is connected and printing enabled.

To test the transfer of a PDF file, from another terminal perform the following command:

curl -X POST http://localhost:8091/api/printer --data-urlencode "path=<path_to_a_pdf>" --data-urlencode "jobId=1"

Change path_to_a_pdf to the absolute path of a PDF file on your computer. The print dialog should open on the client app with the PDF available for printing.