Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

Getting Nullpointer Exception when coverting word to pdf using Java

Last post 04-30-2011, 5:11 PM by aspose.notifier. 4 replies.
Sort Posts: Previous Next
  •  07-29-2010, 1:11 PM 251148

    Getting Nullpointer Exception when coverting word to pdf using Java

    Here is my code and attached is the actual file we are trying to convert to pdf and end up with below exception. We use the jdk 1.6 and the aspose.words.jdk16.jar.

    Please advise!

    import com.aspose.words.Document;
    import com.aspose.words.License;

    import java.io.File;

    class TestAspose
    {
     public static void main(String[] args) throws Exception
     {
      //try{
                System.out.println("Hello World!");
                File licenseFile = new File("C:\\Work\\Aspose.Words.lic") ;
                License l = new License();
                l.setLicense(licenseFile.getAbsolutePath());
                //Document doc = new Document("C:\\Work\\C4\\C4_P2\\TDD\\C4_PhaseII_TDD_v14.doc");
                //doc.save("C:/Work/AsposeOutput/C4_PhaseII_TDD_v14.pdf");
                Document doc = new Document("C:\\Work\\CTS_Architecture.doc");
                doc.save("C:\\Work\\AsposeOutput\\CTS_Architecture.pdf");
                System.out.println("Done Deal!");
            //}catch (Exception e){
            //    System.out.println(e);
            //}
     }
    }

     

     

    xception in thread "main" java.lang.NullPointerException
     at asposewobfuscated.ha.<init>(PdfTilingPattern.java:28)
     at asposewobfuscated.qp.a(PdfPattern.java:38)
     at asposewobfuscated.rr.f(PdfResources.java:91)
     at asposewobfuscated.rl.a(PdfGraphicWriter.java:94)
     at asposewobfuscated.bh.a(PdfPage.java:93)
     at asposewobfuscated.jy.f(PdfRenderer.java:89)
     at asposewobfuscated.fx.a(ApsPath.java:87)
     at asposewobfuscated.ka.a(ApsCompositeNode.java:22)
     at asposewobfuscated.jg.a(ApsCanvas.java:18)
     at asposewobfuscated.ka.a(ApsCompositeNode.java:22)
     at asposewobfuscated.jg.a(ApsCanvas.java:18)
     at asposewobfuscated.ka.a(ApsCompositeNode.java:22)
     at asposewobfuscated.jg.a(ApsCanvas.java:18)
     at asposewobfuscated.jy.c(PdfRenderer.java:135)
     at asposewobfuscated.eb.a(ApsImage.java:65)
     at asposewobfuscated.ka.a(ApsCompositeNode.java:22)
     at asposewobfuscated.jg.a(ApsCanvas.java:18)
     at asposewobfuscated.ka.a(ApsCompositeNode.java:22)
     at asposewobfuscated.jg.a(ApsCanvas.java:18)
     at asposewobfuscated.ka.a(ApsCompositeNode.java:22)
     at asposewobfuscated.jg.a(ApsCanvas.java:18)
     at asposewobfuscated.ka.a(ApsCompositeNode.java:22)
     at asposewobfuscated.jg.a(ApsCanvas.java:18)
     at asposewobfuscated.ka.a(ApsCompositeNode.java:22)
     at asposewobfuscated.jg.a(ApsCanvas.java:18)
     at asposewobfuscated.ka.a(ApsCompositeNode.java:22)
     at asposewobfuscated.oh.a(ApsPage.java:82)
     at asposewobfuscated.jy.c(PdfRenderer.java:50)
     at com.aspose.words.Document.a(Document.java:1724)
     at com.aspose.words.Document.a(Document.java:1445)
     at com.aspose.words.Document.save(Document.java:902)
     at com.aspose.words.Document.save(Document.java:875)
     at TestAspose.main(TestAspose.java:18)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at com.intellij.rt.execution.application.AppMain.main(AppMain.java:110)

    Process finished with exit code 1

     
  •  07-29-2010, 1:25 PM 251151 in reply to 251148

    Re: Getting Nullpointer Exception when coverting word to pdf using Java

    Hi

     

    Thanks for your request. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed. This problem does not occur in .NET version of Aspose.Words. Currently we are working on synchronizing Java and .NET versions of Aspose.Words. Once we finish this work all functionality which is supported in, NET version will be supported in Java version. Also you should note, converting to PDF is in beta at the moment. I will notify you as soon as converting to PDF in Aspose.Words for Java is out of beta.

     

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  07-30-2010, 1:11 PM 251387 in reply to 251151

    Re: Getting Nullpointer Exception when coverting word to pdf using Java

    Hi,

    We are in the process of evaluating the products that are available in the market those converts the word documents into pdf for purchaging. Can we know more on your product about ETA of the original version (not Beta) to purchage with the fix to the current issue?

    Your response in time is highly appreciated.

    Thanks,
    Venkat

     

     
  •  07-30-2010, 2:11 PM 251395 in reply to 251387

    Re: Getting Nullpointer Exception when coverting word to pdf using Java

    Hi

     

    Thanks for your request. We are still working on synchronizing of .NET and Java version of Aspose.Words and the release date of Aspose.Words for Java has been moved to the second half of August 2010. You will be notified once it is released.

     

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  04-30-2011, 5:11 PM 300525 in reply to 251148

    Re: Getting Nullpointer Exception when coverting word to pdf using Java

    We are happy to inform you that the first auto-ported version of Aspose.Words for Java is ready. This version supports converting documents to PDF. You can get it from here.


    Best regards,
    Aspose.Words team


    (26)
     
View as RSS news feed in XML