I'm working on the implementation of html to pdf generation, where i have done below pom config,
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-core</artifactId>
<version>9.1.20</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf-openpdf</artifactId>
<version>9.1.20</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf-itext5</artifactId>
<version>9.1.20</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf-osgi</artifactId>
<version>9.1.2</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-core</artifactId>
<version>9.1.20</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf-openpdf</artifactId>
<version>9.1.20</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf</artifactId>
<version>9.1.20</version>
</dependency>
and in plugin I have added this line
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<executions>
<execution>
<id>bnd-process</id>
<goals>
<goal>bnd-process</goal>
</goals>
<configuration>
<bnd><![CDATA[
Export-Package:
com.itextpdf;version="5.5.6",\
com.itextpdf.text;version="5.5.6",\
com.itextpdf.text.pdf;version="5.5.6",\
com.lowagie;version="2.1.7",\
org.xhtmlrenderer;version="9.1.20",\
org.xhtmlrenderer.pdf.ITextRenderer.*;version="9.1.20",\
The build is fine and the bundle is active.
In my code I am able to get the apis of ITextRenderer.
org.xhtmlrenderer.pdf.ITextRenderer iTextRenderer = new org.xhtmlrenderer.pdf.ITextRenderer();
But on Runtime I am getting this exception in error.log.
java.lang.ClassNotFoundException: org.xhtmlrenderer.pdf.ITextRenderer
could you please suggest anyone ?
Views
Replies
Total Likes
Hi @vkarthick,
Did you try following things?
Hello @salamswapnil ,
Try embedding these 3rd party jar file along with the bundle. You can follow this article on how to embed the 3rd party jars in maven build.
https://myaemlearnings.blogspot.com/2021/08/embedding-third-party-dependencyosgi.html
Hello Sudeer,
its already embedded in all/pom.xml.
And its working fine in on prem AEM and java 1.8, the problem arose in AEMaaCS. not sure is it becasue of java 11??
@salamswapnil @Sudheer_Sundalam ,
The resources folder not able to access from dependency.
i'm gettting below error,
WARNING: Flying Saucer: No configuration files found in classpath using URL: resources/conf/xhtmlrenderer.conf, resorting to hard-coded fallback properties.
org.xhtmlrenderer.exception WARNING:: Can't load default CSS from /resources/css/XhtmlNamespaceHandler.css.This file must be on your CLASSPATH.
if i keep this resource folder under core module it is working fine.
does anyone face this issue???
@vkarthick Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes