Flexpaper_1.2.1.swc--flex Online display PDF document (using Flexpaper) sentiment

Source: Internet
Author: User

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.

    1. Download and install Swftools. All builds is available for download.
    2. 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.

    1. Download and extract the pre-compiled version of Flexpaper. All builds is available for download.
    2. 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.
    3. Copy the SWF created with pdf2swf to the same directory as your extracted files
    4. 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.

    1. Download the Flexpaper SWC from Google Code and add the Flexpaper library to your Flex project.
    2. 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

    1. Download and extract the compiled Flexpaper
    2. The zip file contains an example file called flexpaperviewer.html, which shows you the basic parameters that need to be passed to Flexpaper
      1. var params = {
      2. Swffile: "paper.swf",
      3. scale:0.6
      4. }
      5. swfobject.embedSWF ("flexpaperviewer.swf","CB","$","$","9.0.0","js/swfobject/   Expressinstall.swf ", params);
      6. 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
    3. Copy the SWF and pdf2swf you created into the same directory that you extracted
    4. 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

  1. <? XML version="1.0" encoding="Utf-8" ?>
  2. <mx:application xmlns:mx="http://www.adobe.com/2006/mxml"
  3. Layout="Absolute"
  4. Width=" $" height="$"
  5. xmlns:flexpaper="com.devaldi.controls.flexpaper.*">
  6. <flexpaper:flexpaperviewer Width=" $" height="$"
  7. Scale ="1" swffile="paper3.swf" />
  8. </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

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.