Free Support Forum - aspose.com

java.lang.IllegalArgumentException: Parameter name: pageCount in converting word to pdf

Hello!

I use aspose.words 15.2.0 version under redhat in a application deployed on weblogic. There is a code of transforming a word document with blank pages to a pdf document.

The next exception raises during converting
Caused by: java.lang.IllegalArgumentException: Parameter name: pageCount
at com.aspose.words.Document.zzZr(Unknown Source)
at com.aspose.words.zz1L.zzY(Unknown Source)
at com.aspose.words.zz1L.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)
Example of document is attached.

Thanks in advance!

Hi Tatiana,

Thanks for your inquiry. I have tested the scenario using latest version of Aspose.Words for Java 15.5.0 at Ubuntu and have not found the shared issue. Please use Aspose.Words for Java 15.5.0.

If
you still face problem, please share following detail for testing
purposes. I will setup RedHat at my side and investigate this issue.

  • WebLogic version
  • Java version
  • Please share if you are using any PdfSaveOptions

Hello!


I’ve tried 15.5.0 version but I still have an exception
java.lang.IllegalArgumentException: Parameter name: pageCount
at
com.aspose.words.Document.zzZh(Unknown Source)
at
com.aspose.words.zz1A.zzY(Unknown Source)
at
com.aspose.words.zz1A.zzZ(Unknown Source)
at
com.aspose.words.Document.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)

source document attached

I also checked this case under Windows 7 on tomcat and the result is the same - exception.

My PdfSaveOptions is like this
PdfSaveOptions options = new PdfSaveOptions();
options.setEmbedStandardWindowsFonts(false);
options.setEmbedFullFonts(false);

Hi Tatiana,

Thanks for sharing the detail. I have tested the scenario using latest version of Aspose.Words for Java 15.5.0
and apache-tomcat-8.0.14. at Windows 7. I have not found the shared issue. Please
make sure that you are using the same document which you shared in this
forum thread. I have attached the output Pdf with this post for your kind reference.

Moreover, I suggest you please use PdfSaveOptions.FontEmbeddingMode propety to specify the font embedding mode.