Java Implementation Attachment Preview (Openoffice+swftools+flexpaper) (solve JSP read the overall file problem) __js

Source: Internet
Author: User
first attached I refer to the article, based on the flexpaper version of 1.5, I am using the 2.1.9, so after the description: loading Chinese filename has been supported code Download

1. Overview

Main principle

1. Through the Third-party tools OpenOffice, Word, Excel, PPT, TXT and other files into PDF files

2. Convert PDF files to SWF format files via Swftools

3. Show on the page through Flexpaper document components

2. installation package Download

1.openoffice is an open, free word processing software under Apache.

Download Address: Apache oppenoffice website Download version -3.4.1

2.SWFTools is a set of tools for handling Flash SWF files, which we use to convert PDF files into SWF files!

Download address: swftools website Download Swftools-2013-04-09-1007.exe

3.FlexPaper is an open source lightweight component that displays various documents on the browser

Download address: Flexpaper website download version 1.5.1

4.JODConverter A Java OpenDocument file converter, where we use only its jar packs

Download Address: Jodcconverter download

3. installation files

1. Install the downloaded file (except Jodconverter), the disk characters with your own set. Note that after the OpenOffice installation is complete, when we use it, we need to open its service. At times we need to open in a way that commands:

Open the DOS window, enter the OpenOffice installation letter, and enter the following code to start the service:

Soffice-headless-accept= "SOCKET,HOST=127.0.0.1,PORT=8100;URP;"-nofirststartwizard

Note the '-' in front of the last command, but don't write wrong. Service does not come, the project is not going to go on OH.

The website launches the service screenshot as follows:

Local screenshot:


3. The development process

1. New project, will flexpaper file in the JS folder (including the Flexpaper_flash_debug.js,flexpaper_flash.js,jquery.js, these three JS files are mainly preview swf file plug-ins) Copy to the root directory of the site; Copy the flexpaperviewer.swf to the root of the Web site (which is primarily used to play a SWF file in a Web page), and the directory structure is as follows:

Note: You need to create a upload folder

2. Create fileupload.jsp

<%@ page language= "java"  contenttype= "Text/html; charset=utf-8"         pageencoding= "UTF-8"%>   <! doctype html public  "-//w3c//dtd html 4.01 transitional//en"   "http:// Www.w3.org/TR/html4/loose.dtd ">  

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.