Http://www.cnblogs.com/wuhenke/archive/2010/03/16/1686885.html
It really took a lot of effort to think about the pdf-to-SWF, and then browsing the features online. And then I found a Web site that implemented similar features: http://www.doc88.com/and http://www.docin.com/Although they did better than I did at first, they were the company's strength and relied on the kind of profit model.
My own also in the gradual improvement and improvement, the following is the final version of my project:
Always want to share my code and experience after the project is over. The day before yesterday happened to see a foreign netizen, the function of encapsulation into SWC, the realization of technical routes are the same, now you can learn, very convenient to achieve their own PDF online browsing function. (The function is good, but needs to be improved!) as follows:)
Website address:
http://flexpaper.devaldi.com/index.php
Introduction Reprint:
Introduction
Flexpaper is a open source light weight document viewer component designed to work together with libraries such as PDF2SW F, making it possible to display the PDF files in Adobe Flex and other Flash based applications.
Making your document Ready
To make it possible for your users to view your PDF documents without using Acrobat Reader, documents first needs to be co nverted to the SWF file format. There is a range of available converters, both commercial and free. The following example uses the Open Source Tool swftools and can be automated if needed.
- Download and install Swftools. All builds is available for download.
- Convert your PDF to SWF. This is preferrably do from the command prompt. Make sure your set your options (edit->options) to "No viewer" if is converting your PDF using the UI from Swftools Before exporting your PDF to SWF. This example converts a PDF file called "Paper3.pdf" to the output file "paper3.swf":
c:\swftools\pdf2swf.exe paper3.pdf- o paper3.swf Please see the wiki for more details about the conversion and the Paramete RS that is currently recommended.
Viewing your document using the pre compiled Flash version
The pre-compiled version of Flexpaper is more useful if you just want to use flexpaper on any of the Your Web pages.
- Download and extract the pre-compiled version of Flexpaper. All builds is available for download.
- The zip file contains a sample file called "flexpaperviewer.html" which shows you the basic parameters your need to pass to Flexpaper (Swffile and scale). Please see the wiki in Google Code for a complete list of available parameters.
- Copy the SWF created with pdf2swf to the same directory as your extracted files
- Upload everything to your Web site and navigate to flexpaperviewer.html in your favorite browser. If you have hand would like to run the application from a local directory rather than from a Web server and then the Application have to be added as trusted first. You can do that Atadobe ' s Web site.
Using Flexpaper in Adobe Flex
Using the viewer in Adobe Flex are as easy a using the Flash version.
- Download the Flexpaper SWC from Google Code and add the Flexpaper library to your Flex project.
- Copy the SWF created with pdf2swf to your Bin-debug directory and add the Flexpaper component to your flex application As in the following example (update the Swffile property on the component to point to your SWF file):
<mx:ap Plication xmlns:mx= "Http://www.adobe.com/2006/mxml" layout= "absolute" width= "100%" height= "100%" xmlns:fp= " Com.devaldi.controls.flexpaper.* ">
<fp:flexpaperviewer width= "520" height= "" scale= "0.6" swffile= "paper3.swf"/> </mx:Application>
The pioneer of this control library is introduced in China:
http://wangcheng.javaeye.com/blog/549074
Reprint its blog content:
Flex: Displaying PDF documents using Flexpaper
Flexpaper is an open source lightweight document display component designed to be used with pdf2swf, making it possible to display PDFs in Flex. It can be used as a library for flex.
I. Use PDF2SWF to prepare your documents
The first step is to convert the PDF to SWF, which can be done automatically using the open source Swftools
1. Download the installation Swftools, the latest version is 0.9
2. Convert PDF to SWF, via command line, e.g. convert Paper3.pdf to paper3.swf
C:\SWFTools\pdf2swf Paper3.pdf-o paper3.swf
Two. Browse your document using the Flash version of the compiled Flexpaper
- Download and extract the compiled Flexpaper
- The zip file contains an example file called flexpaperviewer.html, which shows you the basic parameters that need to be passed to Flexpaper
- var params = {
- Swffile: "paper.swf",
- scale:0.6
- }
- swfobject.embedSWF ("flexpaperviewer.swf","CB","$","$","9.0.0","js/swfobject/ Expressinstall.swf ", params);
- The Swffile parameter is the file you want to display, and the scale is the number between 0-1, which indicates the magnification parameter displayed
- Copy the SWF and pdf2swf you created into the same directory that you extracted
- Make sure you've added flexpaperviewer.swf
Three. Using Flexpaper in Flex
1. Download the Flexpaper SWC and add it to your flex project Libs
2. Copy the swf you created with pdf2swf to your Bin-debug directory, such as paper3.swf, add the Flexpaper component to your flex code
- <? XML version="1.0" encoding="Utf-8" ?>
- <mx:application xmlns:mx="http://www.adobe.com/2006/mxml"
- Layout="Absolute"
- Width=" $" height="$"
- xmlns:flexpaper="com.devaldi.controls.flexpaper.*">
- <flexpaper:flexpaperviewer Width=" $" height="$"
- Scale ="1" swffile="paper3.swf" />
- </mx:application>
Original http://www.devaldi.com/?page_id=260
Swftools http://www.swftools.org/download.html
Flexpaper http://code.google.com/p/flexpaper/
Also attached to my recommended reference site:
Http://wiki.swftools.org/index.php/Main_Page#SWF_API_Documentation
http://wiki.swftools.org/index.php/Pdf2swf
Http://wiki.swftools.org/index.php/How_do_I_create_a_AVM2_compatible_SWF%3F
Http://wiki.swftools.org/index.php/How_do_I_highlight_text_in_the_SWF%3F
Flexpaper_1.2.1.swc--flex Online display PDF document (using Flexpaper) sentiment