How To Install libjs-html2canvas on Debian 9

In this tutorial we learn how to install libjs-html2canvas on Debian 9. libjs-html2canvas is Take screenshots of webpages directly in the browser - browser library

Introduction

In this tutorial we learn how to install libjs-html2canvas on Debian 9.

What is libjs-html2canvas

libjs-html2canvas is:

html2canvas allows you to take “screenshots” of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.

It renders the current page as a canvas image, by reading the DOM and the different styles applied to the elements.

It does not require any rendering from the server, as the whole image is created on the clients browser. However, as it is heavily dependent on the browser, this library is not suitable to be used in nodejs. It doesn’t magically circumvent any browser content policy restrictions either, so rendering cross-origin content will require a proxy to get the content to the same origin.

It is still in a very experimental state, so the author doesn’t recommend using it in a production environment nor start building applications with it yet, as there will be still major changes made.

This package contains the plain JS library as well as a minified version.

There are three methods to install libjs-html2canvas on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libjs-html2canvas Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libjs-html2canvas using apt-get by running the following command:

sudo apt-get -y install libjs-html2canvas

Install libjs-html2canvas Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libjs-html2canvas using apt by running the following command:

sudo apt -y install libjs-html2canvas

Install libjs-html2canvas Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libjs-html2canvas using aptitude by running the following command:

sudo aptitude -y install libjs-html2canvas

How To Uninstall libjs-html2canvas on Debian 9

To uninstall only the libjs-html2canvas package we can use the following command:

sudo apt-get remove libjs-html2canvas

Uninstall libjs-html2canvas And Its Dependencies

To uninstall libjs-html2canvas and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove libjs-html2canvas

Remove libjs-html2canvas Configurations and Data

To remove libjs-html2canvas configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge libjs-html2canvas

Remove libjs-html2canvas configuration, data, and all of its dependencies

We can use the following command to remove libjs-html2canvas configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libjs-html2canvas

Dependencies

libjs-html2canvas have the following dependencies:

References

Summary

In this tutorial we learn how to install libjs-html2canvas package on Debian 9 using different package management tools: apt, apt-get and aptitude.