Flexpaper is an open-source lightweight document display component designed to be used together with ipv2swf to display PDF files in flex. It can be used as a flex library.
I. Prepare your documents using ipv2swf
First, convert the PDF file to SwF. This step can be automatically completed using the open-source swftools.
1. Download and install swftools. The latest version is 0.9.
2. If the conversion is switched to SwF, you can use the command line. For example, convert paper3.swf to paper3.swf.
C:/swftools/ipv2swf paper3.pdf-O paper3.swf
2. Use the compiled flexpaper flash version to browse your documents
- Download and decompress the compiled flexpaper (Note: Compile is the FLEX of SwF converted from the compiled display PDF, which references the flexpaper component)
- The zip file contains an example file called flexpaperviewer.html, which shows you the basic parameter JS Code that needs to be passed to flexpaper.
VaR Params = {swffile: "paper.swf", scale: 0.6} swfobject. embedswf ("flexpaperviewer.swf", "CB", "500", "500", "9.0.0", "JS/swfobject/expressinstall.swf", Params ); // The swffile parameter is the file you want to display. scale is the number between 0 and 1, indicating the displayed amplification parameter.
- Copy the created SWF and unzip 2swf to the same directory.
- Make sure you understand flexpaperviewer.swf.
Iii. Snapshots)
1. Download flexpaper SWC and add it to your flex project libs.
2. Copy the swfcreated by using ipv2swfto your bin-debugdirectory, such as paper3.swf, and add the flexpaper component to your flex code.
XML code, add mxml in SRC: <? XML version = "1.0" encoding = "UTF-8"?> <Br/> <mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml" <br/> layout = "absolute" <br/> width = "800" Height = "500" <br/> xmlns: flexpaper = "com. devaldi. controls. flexpaper. * "> </P> <p> <flexpaper: flexpaperviewer width = "800" Height = "500" <br/> scale = "1" swffile = "paper3.swf"/> </P> <p> </MX: Application>