Aspose.Words 4.0.0 PDF Generation bug

I am creating a very simple document and am able to save it out as a word document, when I save it out as a PDF document I get an exception inside the Aspose code. Here is what I am doing:

    if (extension.equalsIgnoreCase("doc"))
        response.setContentType("application/msword");, SaveFormat.DOC);
        PdfOptions options = new PdfOptions();
        document.saveToPdf(0, document.getPageCount(), response.getOutputStream(), options);

catch (Exception e)
    return "Problem exporting word document: " + e.getMessage();

Is this something that should work? The exception that is is thrown is as follows. I wonder does the exception give any clues into what I might need to do to workaround this unfortunate issue? It is entirely possible that I do not have all of the fonts required. How do I determine which fonts the document will need? I know I am using Helvetica for sure.

java.lang.IllegalStateException: End of file reached.
at asposewobfuscated.rm.lM( 114)
at asposewobfuscated.rm.iW( 39)
at asposewobfuscated.qx.UL( 351)
at asposewobfuscated.qx.iy( 200)
at asposewobfuscated.qx.iF( 775)
at asposewobfuscated.qx.UW( 752)
at asposewobfuscated.qx.iz( 321)
at asposewobfuscated.qx.B( 117)
at asposewobfuscated.qx.A( 42)
at asposewobfuscated.oa.hc( 24)
at com.aspose.words.xb.Hd( 231)
at com.aspose.words.sf.rr( 730)
at com.aspose.words.sf.getWidth( 593)
at com.aspose.words.zq.Jy( 88)
at com.aspose.words.zq.Jx( 30)
at 281)
at com.aspose.words.dr.a( 278)
at com.aspose.words.dr.a( 59)
at 190)
at com.aspose.words.da.a( 48)
at com.aspose.words.agu.V( 104)
at com.aspose.words.ay.V( 154)
at com.aspose.words.ahj.nG( 55)
at com.aspose.words.ql.nG( 88)
at 368)
at 37)
at com.aspose.words.aji.b( 40)
at 757)
at com.aspose.words.ql.nG( 88)
at 124)
at com.aspose.words.yz.a( 33)
at com.aspose.words.Document.updatePageLayout( 1637)
at com.aspose.words.Document.Iu( 1590)
at com.aspose.words.Document.getPageCount( 1618)
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( 290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter( 206)
at 508)
at 199)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( 235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter( 206)
at 139)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( 235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter( 206)
at org.apache.catalina.core.StandardWrapperValve.invoke( 233)
at org.apache.catalina.core.StandardContextValve.invoke( 191)
at org.apache.catalina.core.StandardHostValve.invoke( 128)
at org.apache.catalina.valves.ErrorReportValve.invoke( 102)
at org.apache.catalina.core.StandardEngineValve.invoke( 109)
at org.apache.catalina.connector.CoyoteAdapter.service( 286)
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at$ 447)


Thanks for your request. Could you please attach your document here for testing? I will check it on my side and provide you more information.
As I can see, you perform converting to PDF in Linux environment. Am I right?
Also, the was problems with saving PDFs to stream in this version of Aspose.Words for Java (note this feature is in beta). So please try saving the output PDF to file and let me know how it goes on your side.
Best regards.