How To Install libpdfbox-graphics2d-java on Debian 12

Learn how to install libpdfbox-graphics2d-java on Debian 12 with this tutorial. libpdfbox-graphics2d-java is Java library to embed graphics as vector drawing in a PDF

Introduction

In this tutorial we learn how to install libpdfbox-graphics2d-java on Debian 12.

What is libpdfbox-graphics2d-java

libpdfbox-graphics2d-java is:

Using this library one can use any Graphics2D API based SVG / graph / chart library to embed those graphics as vector drawing in a PDF. In combination with PDFBox PDFRenderer/PageDrawer one can also “rerender” PDF pages and change certain aspects (e.g. change the color mapping and perform an overfill) .

The following features are supported:

  • Drawing any shape using draw…() and fill…() methods from Graphics2D.
  • Drawing images. The default is to always lossless compress them. One could plugin one’s own Image -> PDImageXObject conversion if one wants to encode the images as jpeg.
  • All BasicStroke attributes.
  • Paint:
    • Color. One can specify one’s own color mapping implementation to special map the (RGB) colors to PDColor. Beside using CMYK colors one can also use spot colors.
    • GradientPaint, LinearGradientPaint and RadialGradientPaint. There are some restrictions.
    • TexturePaint.
  • Drawing text. By default all text is drawn as vector shapes, so no fonts are embedded. RTL languages are supported. It’s possible to use fonts, but this loses some features (especially RTL support) and one must provide the TTF files of the fonts if the default PDF fonts are not enough.

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

Install libpdfbox-graphics2d-java Using apt-get

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

sudo apt-get update

After updating apt database, We can install libpdfbox-graphics2d-java using apt-get by running the following command:

sudo apt-get -y install libpdfbox-graphics2d-java

Install libpdfbox-graphics2d-java Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libpdfbox-graphics2d-java using apt by running the following command:

sudo apt -y install libpdfbox-graphics2d-java

Install libpdfbox-graphics2d-java 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 libpdfbox-graphics2d-java using aptitude by running the following command:

sudo aptitude -y install libpdfbox-graphics2d-java

How To Uninstall libpdfbox-graphics2d-java on Debian 12

To uninstall only the libpdfbox-graphics2d-java package we can use the following command:

sudo apt-get remove libpdfbox-graphics2d-java

Uninstall libpdfbox-graphics2d-java And Its Dependencies

To uninstall libpdfbox-graphics2d-java and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove libpdfbox-graphics2d-java

Remove libpdfbox-graphics2d-java Configurations and Data

To remove libpdfbox-graphics2d-java configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge libpdfbox-graphics2d-java

Remove libpdfbox-graphics2d-java configuration, data, and all of its dependencies

We can use the following command to remove libpdfbox-graphics2d-java configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libpdfbox-graphics2d-java

Dependencies

libpdfbox-graphics2d-java have the following dependencies:

References

Summary

In this tutorial we learn how to install libpdfbox-graphics2d-java package on Debian 12 using different package management tools: apt, apt-get and aptitude.