We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

NullPointerException on Resource.getFonts


We’ve seen an occurence of a NullPointerException when instantiating a TextBoxField. Here is the stack trace (I removed our application stack):

com.aspose.pdf.Resources.getFonts(Unknown Source)
               	com.aspose.pdf.Annotation.getAppearance(Unknown Source)
                    	com.aspose.pdf.WidgetAnnotation.m1(Unknown Source)
                    	com.aspose.pdf.WidgetAnnotation.m1(Unknown Source)
                	com.aspose.pdf.Field.updateAppearances(Unknown Source)
                        	com.aspose.pdf.TextBoxField.m1(Unknown Source)
                               	com.aspose.pdf.Field.m1(Unknown Source)
                          	com.aspose.pdf.Annotation.m1(Unknown Source)
                      	com.aspose.pdf.Annotation.<init>(Unknown Source)
                	com.aspose.pdf.WidgetAnnotation.<init>(Unknown Source)
                           	com.aspose.pdf.Field.<init>(Unknown Source)
                    	com.aspose.pdf.TextBoxField.<init>(Unknown Source)

I haven’t seen this reproduced, but wondered if you had any idea what could be causing this?
We are using Aspose for PDF 11.7.0 (JAVA SDK)
Running on Ubuntu 18.04


Thanks for contacting support.

I am afraid we cannot specify the reason of this exception unless we are able to reproduce it in our environment. Please note that you are using quite old version of the API and it is recommended to use latest version always because, it contains more fixes and improvements.

You may please download Aspose.PDF for Java 18.9 and use it in your application and in case you face any issue like above, you may please share some sample code snippet and source file (if any) so that we can try to replicate the error in our environment and address it accordingly.