Does AEM have libraries for creating hash of pdf and embedding digital certificate to pdf | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by h_kataria

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

 

 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. 

 

2 replies

h_kataria
Community Advisor
Community Advisor
August 14, 2024

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.

 

RamaniBaAuthor
Level 2
August 15, 2024

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

h_kataria
Community Advisor
h_katariaCommunity AdvisorAccepted solution
Community Advisor
August 15, 2024

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

 

 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.