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?
-
- /*
- * Created on 2010-11-17
- *
- * To change the template for this generated file go to
- * Window-preferences-phpeclipse-php-code Templates
- */
- //Get the directory where the files are located
- $dir =dirname (__file__);
- //delete test files
- @unlink ( $dir."\\test.swf");
- //using the pdf2swf conversion command
- $command = "d:/swftools/pdf2swf.exe-t \" ". $dir."\\test.pdf\"-o \ "". $dir."\\test.swf\"-S flashversion=9 ";
- //Create Shell object
- $WshShell = new COM ("Wscript.Shell");
- //execute cmd command
- $oExec = $WshShell->run ("cmd/c". $command, 0, true);
- ?>
Java Example
[Java]View Plaincopyprint?
- <%
- /*
- * Created on 2010-11-17
- */
- //Get the directory where the files are located
- String Path=request.getrealpath ("/");
- //using the pdf2swf conversion command
- String command= "d:/swftools/pdf2swf.exe-t \" "+path+"\\test.pdf\ "-o \" "+path+" \\test.swf\ "-s Flashversion=9 ";
- //execute cmd command
- Runtime.getruntime (). EXEC ("cmd/c" +command);
- %>
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?
-
- "position:absolute;left:10px;top:10px;" >
- "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 ...