java文件線上播放實現

十五樓亮哥發表於2015-01-30

一:準備條件


(1)先安裝OpenOffice, 並且將OpenOffice的Service啟動

(2)JODConverter工具

        JODConverter是透過OpenOffice來做轉換,可以將文件轉化為pdf格式。

從官網下載工具,找到需要的所有jar檔案   http://www.artofsolving.com/opensource/jodconverter 
commons-cli-1.2.jar
commons-io-1.4.jar
jodconverter-2.2.2.jar
jodconverter-cli-2.2.2.jar
juh-3.0.1.jar
jurt-3.0.1.jar
ridl-3.0.1.jar
slf4j-api-1.5.6.jar
slf4j-jdk14-1.5.6.jar
unoil-3.0.1.jar

xstream-1.3.1.jar

如果你想使用maven,整理了相關的配置

               <!-- JODConverter需要的jar begin -->
		<dependency>
			<groupId>commons-cli</groupId>
			<artifactId>commons-cli</artifactId>
			<version>1.2</version>
		</dependency>

		<dependency>
			<groupId>com.artofsolving</groupId>
			<artifactId>jodconverter</artifactId>
			<version>2.2.1</version>
		</dependency>

		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>1.4</version>
		</dependency>

		<dependency>
			<groupId>org.openoffice</groupId>
			<artifactId>juh</artifactId>
			<version>3.0.1</version>
		</dependency>

		<dependency>
			<groupId>org.openoffice</groupId>
			<artifactId>ridl</artifactId>
			<version>3.2.1</version>
		</dependency>
		<dependency>
			<groupId>org.openoffice</groupId>
			<artifactId>unoil</artifactId>
			<version>3.0.1</version>
		</dependency>

		<dependency>
			<groupId>org.openoffice</groupId>
			<artifactId>jurt</artifactId>
			<version>3.0.1</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.5.6</version>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-jdk14</artifactId>
			<version>1.5.6</version>
		</dependency>

		<dependency>
			<groupId>com.thoughtworks.xstream</groupId>
			<artifactId>xstream</artifactId>
			<version>1.3.1</version>
		</dependency>
		<!-- JODConverter需要的jar end -->

 

(3)安裝pdf2swf.exe 

         可以將pdf文件轉化為swf檔案



(4)flexpaper_flash.js控制元件

       可以播放swf檔案


二:具體實現

       參考:http://blog.csdn.net/u013628152/article/details/42146725

相關文章