Java: Detecting open PowerPoint file & determining its path - java

I've been researching this for some hours now, but to no avail. The most promising library seems to be Apache POI, but I'm not quite sure (from reading its documents) that it can perform the simple task of detecting open instances of PowerPoint and determining their path.
I used to accomplish this chore in Visual Basic (yes, I know it's dreadful) by the use of this line:
Set PPTXApp = GetObject(, "Powerpoint.Application")

POI can manipulate various Microsoft Office type documents, it's not made to manipulate running apps via COM, which is what you were doing in VB.
COM interaction isn't something that's built into Java, but there are third party libraries like Jacob or COM4J that may help you.
Another SO post that may be interesting for you can be found here

Related

Java API or library to edit MS Office or Open Office files using UI

Is there a Java API or library available to edit MS office or open office files using user interface and that could be attached with a Java project?
I know about Apache POI for MS office or Java UNO API for Open Office files, but they are creating, changing file functionality by writing codes not using User Interface.
I don't think there is a a free or commercially available office solution in Java that you could embed into your Swing application. The best bet might be to embed open openoffice.
Here's a tutorial on how to do so. It's quite old, so it might not work exactly like described there, but in principle it should be possible.

FOSS java library to generate *.mobi ebooks?

Firstly there is an almost identical question but the answer is not really satisfactory.
Is there a Java or Ruby library for generating MOBI ebook documents?
The answer basically gives a link to amazon and discusses using command line tools which is not really satisfactory for a web app. I want a regular jar file w/ an api that i can invoke without any nasty process invocation.
Does anyone know of a FOSS library that provides this functionality ? I would rather simething like ITEXT that allows me to build the document and then writes the mobi file rather than something that converts an already ready PDF into the MOBI.
The best I've been able to find is a ruby library called KindleR. https://github.com/josh/kindler
I've only used it to convert basic HTML pages to mobi with pretty good success. I've never converted anything with more complicated formatting, so YMMV.

Implementing powerpoint transitions/animations using Java

I'm working on a project in Java where I need to display a powerpoint presentation complete with transitions and animations. The Apache POI library provides a nice method of viewing previews of different slides statically, but it seems that any animations or transitions need to be implemented separately which, looking at the library seems to be a fair bit of work.
I've no problem with hard work - but I'm somewhat surprised if this hasn't been done already (frantic Googling however hasn't brought up any results.) Does anyone know of a Java library for powerpoint that handles animations relatively easily?
Unless someone comes up with that PowerPoint Java library for you, you might want to check out PowerPoint Object Linking and Embedding (OLE).
You can use COM4J to have almost all the classes/interface of the namespace microsoft.office.interop.powerpoint , Its almost like your using it from C#. On the code samples from the download you have the package you need with all the interface/classes implemented for you.
Hope it helps you out :P

Mirroring websites in Java

I need to mirror some websites from my Java application. I was looking for an open source java library to do this job, but didn't find anything suitable.
Does anybody know about some java-friendly tool to retrieve entire websites, or must I stick to exec wget from my program?
Thanks a lot.
The biggest problem I found with this kind of libraries was the lack of support for css parsing, so the imported stylesheets, background images and so on get downloaded as well when mirroring the website.
wget has built in support for this (at least in recent versions), and although it's not a very clean solution to run this program from java, I'd first try it and see if it fits your needs.
I would recommend a crawler/spider. Aspider and Sperowider use Apache HttpClient lib (my favourite httplib) and crawls through the site following links. Since they are OSS you should be able to integrate it into your software. They are also currently unmaintained, but Apache HttpClient lib would be a good place to start if you want to write your own mirroring tool in java.

OpenOffice in Java

I need a Java interface to the OpenOffice document conversion which would equal to a manual (Open... and then Save As...) as well as access to the PDF generation.
The following are some example of what I want to achieve.
1) Open one type of document (fx. OpenOffice Writer document or Microsoft Office document) onto memory and save it in another supported format.
2) Open one type of document into memory and export it as PDF.
I have gone through http://api.openoffice.org but didn't get any material which can help me to get started.
I also tried JODConverter but it requires me to run OpenOffice as a service.
I wold prefer to include all the core functionality of OpenOffice in one JAR file so that that the user can use my application without installing or running openoffice on their PC.
What would be a URL/code snippet from where I can get tutorials to get started?
Also do I have to add some JAR files?
Will the application work even if I don't have OpenOffice installed on my PC?
You might want to have a look at noa-libre (Nice Office Access, formerly available at ion.ag). It's a Java API that wraps OO.o's native Java API to be easier to use. It allows you to quickly "remote control" OO.o.
Also tell me if i have to add some jars?
Yes, that is documented.
Will the application work even if i dont have open office not installed on my pc?
No, the application requires a running (!) instance of OO.o, as it essentially remote-controls OO.o. The instance can in theory run on another computer (controlled via network).
try the ODF Toolkit project . it has an API that allows you to manipulate openoffice documents without having openoffice.org installed in your client machine.
here is a good article that get you started with ODF toolkit : Integrate OpenOffice with Java without Installing OpenOffice
I once used OpenOffice for MS Word to PDF conversion. Although it was the only free solution, I wasn't quite satisfied with the resulting PDF file, specially when your document has complex bidi scripts.
For conversion, as far as I can remember, there was two possible ways. One to use OS pipes and the other was socket or something. I don't have my code right now, but the only thing you need is to search in that URL. You should first launch an OpenOffice executable file (I just followed a simple turorial in OpenOffice wiki) with some parameters, and then run your Java application, using provided Java libraries.

Categories