For evaluating your tool, we have configure the PDF watermarking functionality.
At runtime, we are getting some following error.
Please support for the same

SEVERE [http-nio-8080-exec-5] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [Spring MVC Dispatcher Servlet] in context with path [/applicationname] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/aspose/pdf/facades/PdfFileStamp] with root cause
java.lang.ClassNotFoundException: com.aspose.pdf.facades.PdfFileStamp
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(



Please send us your source PDF document and the complete code. We will investigate your scenario in our environment, and share our findings with you. Your response is awaited.


public static void insertWatermarkPdf(String path, String fileName, String watermarkText) {

	PdfFileStamp fileStamp = new PdfFileStamp();


	FormattedText formattedText = new FormattedText(watermarkText, java.awt.Color.GRAY, java.awt.Color.WHITE, FontStyle.Helvetica, EncodingType.Winansi, false, 50);


	Stamp stamp = new Stamp();
	stamp.setOrigin((fileStamp.getPageWidth()-630)/2, (fileStamp.getPageHeight()-630)/2);
}<a class="attachment" href="/uploads/discourse_instance3/16170">angularjs_tutorial.pdf</a> (1.7 MB)



We have tested your scenario with the latest version 18.5 of Aspose.PDF for Java API, and could generate the output PDF without any error. This is the output PDF: Output.pdf (1.7 MB). Please make sure that you have added the reference of Aspose.PDF for Java API in your application project, and also try with the latest version 18.5.


This code is working fine by executing main method. But when we run the same using Tomcat application server (with Spring MVC framework) it’s giving error, which I have mentioned at first time in forum.
Please check the same as per given mentioned scenario.



We have tested your scenario in our Tomcat environment with the latest version 18.6 of Aspose.PDF for Java API, and the code works fine. This is the output PDF: angularjs_Output18.6.pdf (1.7 MB). Please create a small project application, which reproduces this error in your environment, and then send us a ZIP of this project. We will investigate your scenario in our environment, and share our findings with you.


Please find the attached source related to (4.4 MB)



Thank you for sharing requested data.

Would you please mention the steps to reproduce the problem you are facing in your environment. Please also mention which among attached files contains the code snippet related to Aspose.PDF API so that we may proceed to help you out.