Free Support Forum - aspose.com

Performance issue in Aspose.word java

Hi Aspose Team,
I’m facing performance issues in converting the empty docx file to pdf(It takes 18 sec to convert).
I’m using the Trial version of the Aspose.Words java.
The below is code used to convert
com.aspose.words.Document doc = new com.aspose.words.Document(file.getAbsolutePath());
doc.save(outputPath + FilenameUtils.getBaseName(file.getAbsolutePath())+".pdf");
Kindly look into the issue as soon as poosible as we are about to finalize on the paid version of the same

Hi Aspose Team,
I’m having some performance issue in Aspose.word. I’m facing issues while converting .docx file to .pdf file.
I’m using trial version of the jar ,Is this the issue because of the trial version of the jar?
The below is code i’m using to Convert the code,
com.aspose.words.Document doc = new com.aspose.words.Document(file.getAbsolutePath());
doc.save(outputPath + FilenameUtils.getBaseName(file.getAbsolutePath())+".pdf");

Sample file used to convert is empty Docx file. Its taking approximately 18sec to convert.

@ravi_malathkar

Thanks for your inquiry. We have tested the scenario using the latest version of Aspose.Words for Java 18.9 and have not found the shared issue. Please use Aspose.Words for Java 18.9.

I’m facing issues while using 18.9 version
Exception in thread “main” java.lang.UnsatisfiedLinkError: com.aspose.words.WindowsNativeCall.readRegistryStringValues(ILjava/lang/String;)Ljava/util/Map;
at com.aspose.words.WindowsNativeCall.readRegistryStringValues(Native Method)
at asposewobfuscated.zz9P.zzN(Unknown Source)
at asposewobfuscated.zzBP.zzU(Unknown Source)
at asposewobfuscated.zzBQ.zzQL(Unknown Source)
at asposewobfuscated.zzRD.zzZ(Unknown Source)
at asposewobfuscated.zzRX.zzQO(Unknown Source)
at asposewobfuscated.zzRX.zzS(Unknown Source)
at asposewobfuscated.zzRX.zzT(Unknown Source)
at com.aspose.words.FontSettings.zzT(Unknown Source)
at com.aspose.words.zz98.zzR(Unknown Source)
at com.aspose.words.zz98.zzQ(Unknown Source)
at com.aspose.words.zz00.zzYK(Unknown Source)
at com.aspose.words.zz90$zzZ.zzZW(Unknown Source)
at asposewobfuscated.zzCH.moveNext(Unknown Source)
at com.aspose.words.zz90.zzZ(Unknown Source)
at com.aspose.words.zzZ0F.zzZls(Unknown Source)
at com.aspose.words.zzZ0F.zzX(Unknown Source)
at com.aspose.words.zz90.(Unknown Source)
at com.aspose.words.zzYXP.zzZ(Unknown Source)
at com.aspose.words.zz8Z.moveNext(Unknown Source)
at com.aspose.words.zzZMT.zzZ(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.Document.zzXu(Unknown Source)
at com.aspose.words.Document.getPageCount(Unknown Source)
at com.aspose.words.zz0G.zzZ(Unknown Source)
at com.aspose.words.zzZH5.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at abn.amro.reterive.Utils.DocumentConvertor.docToPDF(DocumentConvertor.java:63)
at abn.amro.reterive.Utils.DocumentConvertor.Convertor(DocumentConvertor.java:37)
at abn.amro.reterive.service.ServiceName.main(ServiceName.java:17)

java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.(File.java:423)
at asposewobfuscated.zz2E.zzzM(Unknown Source)
at asposewobfuscated.zz2E.zzzN(Unknown Source)
at com.aspose.words.WindowsNativeCall.(Unknown Source)
at asposewobfuscated.zz9P.(Unknown Source)

@ravi_malathkar

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please create a simple Java application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.
  • Please share the operating system detail and Java version that you are using.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

The below is the standalone code used, and have attached the sample input file used.
OS:- Windows 7
Java version:-JavaSE 1.8
testdocSample.zip (9.6 KB)

import com.aspose.words.Document;

public class DocToPdf {

public static void main(String[] args) throws Exception {
	Document doc = new Document("E:/test/teamSprint/Test/testdocSample.docx");
	doc.save("E:/test/teamSprint/Test/t.pdf");
}

}

Error Log:-java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.(File.java:423)
at asposewobfuscated.zz2E.zzzM(Unknown Source)
at asposewobfuscated.zz2E.zzzN(Unknown Source)
at com.aspose.words.WindowsNativeCall.(Unknown Source)
at asposewobfuscated.zz9P.(Unknown Source)
at asposewobfuscated.zzBP.zzU(Unknown Source)
at asposewobfuscated.zzBQ.zzQL(Unknown Source)
at asposewobfuscated.zzRD.zzZ(Unknown Source)
at asposewobfuscated.zzRX.zzQO(Unknown Source)
at asposewobfuscated.zzRX.zzS(Unknown Source)
at asposewobfuscated.zzRX.zzT(Unknown Source)
at com.aspose.words.FontSettings.zzT(Unknown Source)
at com.aspose.words.zz98.zzR(Unknown Source)
at com.aspose.words.zz98.zzQ(Unknown Source)
at com.aspose.words.zz00.zzYK(Unknown Source)
at com.aspose.words.zz90$zzZ.zzZW(Unknown Source)
at asposewobfuscated.zzCH.moveNext(Unknown Source)
at com.aspose.words.zz90.zzZ(Unknown Source)
at com.aspose.words.zzZ0F.zzZls(Unknown Source)
at com.aspose.words.zzZ0F.zzX(Unknown Source)
at com.aspose.words.zz90.(Unknown Source)
at com.aspose.words.zzYXP.zzZ(Unknown Source)
at com.aspose.words.zz8Z.moveNext(Unknown Source)
at com.aspose.words.zzZMT.zzZ(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.Document.zzXu(Unknown Source)
at com.aspose.words.Document.getPageCount(Unknown Source)
at com.aspose.words.zz0G.zzZ(Unknown Source)
at com.aspose.words.zzZH5.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at abn.amro.reterive.Main.DocToPdf.main(DocToPdf.java:9)
Exception in thread “main” java.lang.UnsatisfiedLinkError: com.aspose.words.WindowsNativeCall.readRegistryStringValues(ILjava/lang/String;)Ljava/util/Map;
at com.aspose.words.WindowsNativeCall.readRegistryStringValues(Native Method)
at asposewobfuscated.zz9P.zzN(Unknown Source)
at asposewobfuscated.zzBP.zzU(Unknown Source)
at asposewobfuscated.zzBQ.zzQL(Unknown Source)
at asposewobfuscated.zzRD.zzZ(Unknown Source)
at asposewobfuscated.zzRX.zzQO(Unknown Source)
at asposewobfuscated.zzRX.zzS(Unknown Source)
at asposewobfuscated.zzRX.zzT(Unknown Source)
at com.aspose.words.FontSettings.zzT(Unknown Source)
at com.aspose.words.zz98.zzR(Unknown Source)
at com.aspose.words.zz98.zzQ(Unknown Source)
at com.aspose.words.zz00.zzYK(Unknown Source)
at com.aspose.words.zz90$zzZ.zzZW(Unknown Source)
at asposewobfuscated.zzCH.moveNext(Unknown Source)
at com.aspose.words.zz90.zzZ(Unknown Source)
at com.aspose.words.zzZ0F.zzZls(Unknown Source)
at com.aspose.words.zzZ0F.zzX(Unknown Source)
at com.aspose.words.zz90.(Unknown Source)
at com.aspose.words.zzYXP.zzZ(Unknown Source)
at com.aspose.words.zz8Z.moveNext(Unknown Source)
at com.aspose.words.zzZMT.zzZ(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.Document.zzXu(Unknown Source)
at com.aspose.words.Document.getPageCount(Unknown Source)
at com.aspose.words.zz0G.zzZ(Unknown Source)
at com.aspose.words.zzZH5.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at abn.amro.reterive.Main.DocToPdf.main(DocToPdf.java:9)

@ravi_malathkar

It looks to be a class loader bug of some JVMs. We had recently changed our old good working code for compatibility with Java 10 and Java 11. But this new code, that we added for compatibility, does not work on some buggy JVMs ( it seems they do not release some resources automatically ).

The good news is that we have recently fixed this issue i.e. WORDSJAVA-1891. Your thread has been linked to this issue. The fix of this issue will be integrated in next 18.10 release of Aspose.Words for Java. We will inform you via this thread as soon as 18.10 release will be published in next few days.

You may please retest your scenario on your end after when Aspose.Words for Java 18.10 is released in next few days.

The issues you have found earlier (filed as WORDSJAVA-1891) have been fixed in this Aspose.Words for .NET 18.10 update and this Aspose.Words for Java 18.10 update.