Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Dependency conflict - Apache PDFBox

Avatar

Level 2

I am working on a use case in which I want to embed an image inside a PDF file. After that, I need to send it as a servelet response. 
I am using PDFBox library from Apache to do so. But, I am not able to resolve the dependencies. 

POM: 

<!-- Apache PDFBox Dependencies -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>fontbox</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.3.2</version>
</dependency>

error: 

HARPREETSI5_0-1728374062110.png


In the image, the version which is mentioned in the bundles is 3.0.4 which does not exist. 

 

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion
3 Replies

Avatar

Correct answer by
Community Advisor and Adobe Champion

Hi,

 

You need to wrap those dependencies as part of your bundle so they are deployed and available at runtime. Please check these threads:

https://aemconcepts.com/aem-osgi/use-3rd-party-api-or-jar-or-dependency-in-aem/ 

https://medium.com/aem-architect-developer-business-practitioner/understanding-dependencies-in-aem-m... 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/including-3rd-party-aem-pa...

 

Hope this helps

 



Esteban Bustamante

Avatar

Administrator

@HARPREETSI5 Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni

Avatar

Level 2

Hello @HARPREETSI5 

Have you implemented finally pdfbox.io? We have problems to deploy it on AEM Cloud, on local SDK it compiles and bundle is started, but on Cloud it is impossible.

Regards,