最近伴随着百度文库,豆丁文库的流行 感觉到它方便美观,又能保护版权,
深受客户的喜爱,因此决定研究一下
其中主要的思路还是将PDF文件转换成swf,然后使用播放器进行显示
原理还是比较简单
下面是具体的实现
1采用的技术都是开源工具
1 在该下载地址下载
pdf2swf
直接双击安装
2 下载开源免费工具FlexPaper
直接解压即可
3 下载安装PHP,官方建议不低于5.3
我的版本是:
H:\php>php.exe --version
PHP 5.3.8 (cli) (built: Aug 23 2011 11:50:20)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
3下面进行配置修改
解压后的flexpaper中含有文件
H:\flexpaper\php\config\config.ini.win.php
; DO NOT REMOVE THIS LINE
[requirements]
test_pdf2swf = true
test_pdf2json = false
[general]
allowcache = true
splitmode = false
path.pdf = "H:\flexpaper\pdf"
path.swf = "H:\flexpaper\docs"
4 修改后将你的PHP文件夹发布到apache 的文件夹下,然后直接访问
Index.php
会显示
FlexPaper Configuration: Server Requirements
Test Result
PHP version 5 or higher 5.3.8
Safe mode disabled Yes
PHP can write to the config file Yes
显示均满足条件
点击 ---》 ON TO STEP 2 →
显示
FlexPaper Configuration: Recommended Components
Test Result
exec() enabled Yes
Max upload size > 10 mb No
SWFTools support Yes
FlexPaper will work on this server, but its features will be limited as described below.
Your max upload size for your server is restricted to less than 10 megabytes. You can still use FlexPaper but will be unable to upload large files through the admin interface. To allow larger files, please increase 'upload_max_filesize' and 'post_max_size' in your php.ini file. For more information on this please see the PHP documentation
因此你需要修改php.ini配置文件,
; Maximum allowed size for uploaded files.
;
upload_max_filesize = 10M
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
然后你需要做的就是客户化你的东东了
FlexPaper: Configuration
FlexPaper: Configuration
Admin Username The admin username you want to use for the admin publishing interface.
Admin Password The admin password you want to use for the admin publishing interface.
PDF Storage Directory
This directory should reside outside of your web application root folder to protect your documents.
Working Directory
This directory should reside outside of your web application root folder to protect your documents.
Split mode publishing? No Yes
If you generally publish large PDF documents then running split mode is recommended.
License Key If using the commercial version, this is the key you recieved from our commercial download area.
然后你就直接登录,上传转化的你的文件
稍后,你将看到你想要发布文件列表
使用upload上传文件,然后点击,就可以你看到结果
更为详细的稳定可以参考 FLEXPAPER的二次开发
记得去年作业一个项目,structs 1的框架,客户的体验还是比较好的,
我主要是工作就是使用java实现了后台的转化与现实
由于是ZF项目,文件已PDF,word格式文件居多,首先是整体批量转化,在后台实现,批处理
然后用户在重新上传的时候,在一个单独转换一个文件。
但是由于待遇比较差,感觉不是很爽,昨天晚上想起自己做过,因此
用本博文以记录之~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
阅读(2081) | 评论(0) | 转发(0) |