Expand my Community achievements bar.

SOLVED

Does AEM have libraries for creating hash of pdf and embedding digital certificate to pdf

Avatar

Level 3

I would like to know if AEM provides libraries for creating hash of pdf document and embedding digital certificate in pdf

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @RamaniBa ,

I checked further and it seems it is not OOB (atleast not anymore). You can still go to depfinder (localhost:4502/system/console/depfinder) and check if your version of AEM exports some version of pdfbox. If yes, then you can essentially just add the dependency in your pom files and then can use its APIs

h_kataria_0-1723735293508.png

 

 Otherwise, you can embed it in your project in the configuration section of filevault-package-maven-plugin generally located in all/pom.xml as below. 

<embedded>
  <groupId>org.apache.pdfbox</groupId>
  <artifactId>pdfbox</artifactId>
  <target>/apps/your-application-vendor-packages/container/install</target>
</embedded>

 and you will also have to add the dependency 

<dependency>
  <groupId>org.apache.pdfbox</groupId>
  <artifactId>pdfbox</artifactId>
  <version>2.0.24</version>
</dependency>

Adjust the version as per your requirement. And then you should be able to use pdfbox features.
You can do similar steps to embed some other jar if you are interested in some library other than pdfbox
Hope this helps. 

 

View solution in original post

4 Replies

Avatar

Community Advisor

You can checkout apache pdfbox to see if it fullfills your requirement.
You can embed and add the dependency and you should be able to use it. Below is the sample dependency for AEM cloud environment

 

<dependency>
	<artifactId>pdfbox</artifactId>
	<version>2.0.24</version>
	<groupId>org.apache.pdfbox</groupId>
	<scope>provided</scope>
</dependency>

 


An example on how to create visible signatures : https://eideasy.com/creating-visible-signatures-with-apache-pdfbox-v2-java-library/ 
Hope this helps.

 

Avatar

Level 3

Do you mean that I import Apache PDF box and can be used with AEM. If so can you elaborate the steps that import the Apache PDF Box libraries and how to use this library in the AEM SignatureService code

Avatar

Correct answer by
Community Advisor

Hi @RamaniBa ,

I checked further and it seems it is not OOB (atleast not anymore). You can still go to depfinder (localhost:4502/system/console/depfinder) and check if your version of AEM exports some version of pdfbox. If yes, then you can essentially just add the dependency in your pom files and then can use its APIs

h_kataria_0-1723735293508.png

 

 Otherwise, you can embed it in your project in the configuration section of filevault-package-maven-plugin generally located in all/pom.xml as below. 

<embedded>
  <groupId>org.apache.pdfbox</groupId>
  <artifactId>pdfbox</artifactId>
  <target>/apps/your-application-vendor-packages/container/install</target>
</embedded>

 and you will also have to add the dependency 

<dependency>
  <groupId>org.apache.pdfbox</groupId>
  <artifactId>pdfbox</artifactId>
  <version>2.0.24</version>
</dependency>

Adjust the version as per your requirement. And then you should be able to use pdfbox features.
You can do similar steps to embed some other jar if you are interested in some library other than pdfbox
Hope this helps.