Similar to Baidu Library pdf2swf+flexpaper to solve the effect of PDF online reading, pdf2swfflexpaper_php tutorial

Source: Internet
Author: User
Tags php example vars

Similar to Baidu Library pdf2swf+flexpaper to solve the effect of PDF online reading, Pdf2swfflexpaper


1: Tool Preparation
Swftools.exe Download
Http://www.swftools.org/download.html
Install to D drive
Swftools provides a series of tools to turn various files into SWF:
Font2swf.exe
Gif2swf.exe
Jpeg2swf.exe
Pdf2swf.exe
Png2swf.exe
Wav2swf.exe
Here we only use Pdf2swf.exe

Flexpaper Download
http://code.google.com/p/flexpaper/
Here we use the Flash version of the compiled Flexpaper

2: Sample language, here are two development environments I use to do examples
PHP Example
Generate SWF file from pdf

[PHP]View Plaincopyprint?
  1. /*
  2. * Created on 2010-11-17
  3. *
  4. * To change the template for this generated file go to
  5. * Window-preferences-phpeclipse-php-code Templates
  6. */
  7. //Get the directory where the files are located
  8. $dir =dirname (__file__);
  9. //delete test files
  10. @unlink ( $dir."\\test.swf");
  11. //using the pdf2swf conversion command
  12. $command = "d:/swftools/pdf2swf.exe-t \" ". $dir."\\test.pdf\"-o \ "". $dir."\\test.swf\"-S flashversion=9 ";
  13. //Create Shell object
  14. $WshShell = new COM ("Wscript.Shell");
  15. //execute cmd command
  16. $oExec = $WshShell->run ("cmd/c". $command, 0, true);
  17. ?>

Java Example

[Java]View Plaincopyprint?
    1. <%
    2. /*
    3. * Created on 2010-11-17
    4. */
    5. //Get the directory where the files are located
    6. String Path=request.getrealpath ("/");
    7. //using the pdf2swf conversion command
    8. String command= "d:/swftools/pdf2swf.exe-t \" "+path+"\\test.pdf\ "-o \" "+path+" \\test.swf\ "-s Flashversion=9 ";
    9. //execute cmd command
    10. Runtime.getruntime (). EXEC ("cmd/c" +command);
    11. %>


The above is Php,java to convert PDF to SWF mode, that shows, so we will use to Flexpaper, the following is the use of Flexpaper
Using Flexpaper to show SWF

[JavaScript]View Plaincopyprint?
    1. "position:absolute;left:10px;top:10px;" >
    2. "Flashcontent" >


In this way we can convert the PDF to the appropriate SWF file and display it via Flexpaper to prevent users from downloading, or copy.

pdf2swf detailed parameter description, Internet Baidu or Google can be found, but the best attention to specify the flashversion is 9, to prevent some unexpected errors.
Not all PDFs in pdf2swf can be converted, and encrypted PDF pdf2swf cannot be converted


For a detailed description of the Flexpaper parameters, please refer to Http://code.google.com/p/flexpaper/wiki/Parameters

Flexpaper Common API Http://code.google.com/p/flexpaper/wiki/API

If the garbled problem may be the character set, there are a lot of related solutions on the Web to query "I did not encounter the character set blocking problem."

There are also pictures in the PDF that may be converted to SWF after the image is not very clear.

Documents such as Word,wps,txt can also be converted in this manner, but the tool is not necessarily swftools

Uploaded flexpaper attachments already contain flexpaper in the relevant files without re-downloading, just download swftools, and install.
The flexpaper attachment contains pdf2swf.jsp and pdf2swf.php two files and Flexpaper related components that can be run in a Java or PHP environment.


: pdf2swf convert only one page of PDF document, not shown in Flexpaper

Version issue, recommended unloading load

Java+flexpaper+swftools imitation Baidu Library document online preview system design and implementation

With Flexpaper This plugin display, first turn word into PDF and then convert PDF to swf file, upload it can be played with Flexpaper. Note that the server system is not the same, so the spacer is not the same, I hope that your ideas help

http://www.bkjia.com/PHPjc/894770.html www.bkjia.com true http://www.bkjia.com/PHPjc/894770.html techarticle similar to Baidu Library pdf2swf+flexpaper to solve the effect of PDF online reading, Pdf2swfflexpaper 1: Tool preparation Swftools.exe Download http://www.swftools.org/ Download.html installation to D-plate Swftoo ...

  • 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.