Flex: Use flexpaper to display PDF documents

Source: Internet
Author: User

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

  1. Download and decompress the compiled flexpaper (Note: Compile is the FLEX of SwF converted from the compiled display PDF, which references the flexpaper component)
  2. 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.

  3. Copy the created SWF and unzip 2swf to the same directory.
  4. 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>

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.