mercredi 1 juillet 2015

fails to convert ppt into pdf using jacob.jar

I use jacob 1.17-M2, I set java.library.path to c:\windows\system32 and I've put jacob-1.17-M2-x64.dll into c:\window\system32 before. My box is Windows 2008 R2 Enterprise.

    System.setProperty( "java.library.path", "c:\\windows\\system32" );
    log.info(System.getProperty("java.library.path"));
    ActiveXComponent app = new ActiveXComponent("PowerPoint.Application");
    //app.setProperty("Visible", msofalse);
    Dispatch ppts = app.getProperty("Presentations").toDispatch();      
    Dispatch ppt = Dispatch.call(ppts,
                                "Open",
                                inputFile,
                                true,//ReadOnly
                                true,//Untitled
                                false//WithWindow
                                ).toDispatch();     
    Dispatch.call(ppt,
                "SaveAs",
                pdfFile,
                ppSaveAsPDF 
                );              
    Dispatch.call(ppt, "Close");        
    app.invoke("Quit");

this cannot works in tomcat windows installer Distribution, but can work in tomcat zip Distribution. What's the problem?

Aucun commentaire:

Enregistrer un commentaire