版本:2.2.1
示例:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Flexpaper例子</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="${ctx}/FlexPaper/js/jquery.min.js"></script>
<script type="text/javascript" src="${ctx}/FlexPaper/js/flexpaper.js"></script>
<script type="text/javascript" src="${ctx}/FlexPaper/js/flexpaper_handlers.js"></script>
</head>
<body>
<div id="documentViewer" class="flexpaper_viewer"
style="position:absolute;left:10px;top:10px;width:80%;height:80%"></div>
<script type="text/javascript">
function getContentPath() {
var pathName = document.location.pathname;
var index = pathName.substr(1).indexOf("/");
var path = pathName.substr(0, index + 1);
return path;
}
var fp = $('#documentViewer').FlexPaperViewer(
{config: {
SwfFile: getContentPath() + '/readme.swf',
Scale: 0.6,
ZoomTransition: 'easeOut',
ZoomTime: 0.5,
ZoomInterval: 0.2,
FitPageOnLoad: true,
FitWidthOnLoad: true,
FullScreenAsMaxWindow: true,
ProgressiveLoading: true,
MinZoomSize: 0.2,
MaxZoomSize: 5,
SearchMatchAll: false,
InitViewMode: 'Portrait',
ViewModeToolsVisible: true,
ZoomToolsVisible: true,
NavToolsVisible: true,
CursorToolsVisible: true,
SearchToolsVisible: true,
localeChain: 'zh_CN',
jsDirectory: getContentPath() + "/FlexPaper/js/", /*设置FlexPaper的js文件目录,包含FlexPaperVier.swf文件,否则默认在flex目录下.*/
cssDirectory: getContentPath() + "/FlexPaper/css/"
}}
);
</script>
</body>
</html>
如果不能显示,注意设置
jsDirectory和cssDirectory参数。
官网所给出的详细参数:
Parameters
The following parameters can be used in FlexPaper
|
SwfFile(String)
|
The flash document FlexPaper should open |
|
JSONFile(String)
|
The json document FlexPaper should open. Mark the page number with {page} if you are loading FlexPaper in split mode (e.g. Paper.pdf_{page}.js).This only applies
to FlexPaper with AdaptiveUI enabled.
|
|
IMGFiles(String)
|
The pages as images FlexPaper should open. Mark page number with {page} (e.g. Paper.pdf_{page}.png}).This only applies to FlexPaper with AdaptiveUI enabled.
|
|
Scale(Number)
|
The initial zoom factor that should be used. Should be a number above 0 (1=100%) |
|
ZoomTransition(String)
|
The zoom transition that should be used when zooming in FlexPaper. It uses the same Transition modes as the Tweener. The default value is easeOut. Some examples: easenone, easeout, linear,
easeoutquad |
|
ZoomTime(Number)
|
The time it should take for the zoom to reach the new zoom factor. Should be 0 or greater. |
|
ZoomInterval(Number)
|
The interval which the zoom slider should be using. Basically how big the "step" should be between each zoom factor. The default value is 0.1. Should be a positive number. |
|
FitPageOnLoad(Boolean)
|
Fits the page on initial load. Same effect as using the fit-page button in the toolbar. |
|
FitWidthOnLoad(Boolean)
|
Fits the width on initial load. Same effect as using the fit-width button in the toolbar. |
|
localeChain(String)
|
Sets the locale (language) to use. The following languages are currently supported:
en_US (English)
fr_FR (French)
zh_CN (Chinese, Simple)
es_ES (Spanish)
pt_BR (Brazilian Portugese)
ru_RU (Russian)
fi_FN (Finnish)
de_DE (German)
nl_NL (Netherlands)
tr_TR (Turkish)
se_SE (Swedish)
pt_PT (Portugese)
el_EL (Greek)
dn_DN (Danish)
cz_CS (Czech)
it_IT (Italian)
pl_PL (Polish)
pv_FN (Finnish)
hu_HU (Hungarian)
|
|
FullScreenAsMaxWindow(Boolean)
|
With this set to true, clicking on fullscreen will open a new browser window with FlexPaper maximized instead of using true fullscreen. This is a preferred setting when using FlexPaper as
flash standalone as the security limitations of the Flash player disables (for security reasons) most of the input controls in true fullscreen. |
|
ProgressiveLoading(Boolean)
|
Will load and display the document progressively when set to true as opposed to downloading the complete document before displaying the pages. Documents need to be converted to at least
Flash version 9 for this to work (-T 9 flag using PDF2SWF).Please observe that this parameter has no effect in FlexPaper Zine. Please use split page loading for large documents in FlexPaper Zine.
|
|
MaxZoomSize(Number)
|
Sets the maximum allowed zoom level |
|
MinZoomSize(Number)
|
Sets the minimum allowed zoom level |
|
SearchMatchAll(Boolean)
|
When set to true, the viewer highlights all matches when performing searches in a document. |
|
InitViewMode(String)
|
Sets the start-up view mode. For example "Portrait" or "TwoPage". |
|
PrintPaperAsBitmap(Boolean)
|
When set to true, the viewer will print the document as a bitmap as opposed to vectorized |
|
StartAtPage(Number)
|
Instructs the viewer to start at a specific page |
|
ViewModeToolsVisible(Boolean)
|
Shows or hides view modes from the tool bar |
|
ZoomToolsVisible(Boolean)
|
Shows or hides zoom tools from the tool bar |
|
NavToolsVisible(Boolean)
|
Shows or hides nav tools from the tool bar |
|
CursorToolsVisible(Boolean)
|
Shows or hides cursor tools from the tool bar |
|
SearchToolsVisible(Boolean)
|
Shows or hides search tools from the tool bar |
|
jsDirectory(String)
|
Sets the javascript directory to supplied location.This only applies to FlexPaper with AdaptiveUI enabled.
|
|
cssDirectory(String)
|
Sets the css directory to supplied location.This only applies to FlexPaper with AdaptiveUI enabled.
|
|
localeDirectory(String)
|
Sets the locale directory to supplied location.This only applies to FlexPaper with AdaptiveUI enabled.
|
The parameters are passed using flashvars or by setting properties on the flexpaper component inside flex, depending on your choice of usage. The code block below shows an example of how the parameters can be passed using the pre-compiled flash version
$('#documentViewer').FlexPaperViewer(
{ config : {
SwfFile : "Paper.swf",
IMGFiles : "Paper.pdf_{page}.png",
JSONFile : "Paper.pdf.js",
PDFFile : "Paper.pdf",
Scale : 0.6,
ZoomTransition : "easeOut",
ZoomTime : 0.5,
ZoomInterval : 0.1,
FitPageOnLoad : false,
FitWidthOnLoad : false,
FullScreenAsMaxWindow : true,
ProgressiveLoading : true,
MinZoomSize : 0.2,
MaxZoomSize : 5,
SearchMatchAll : false,
InitViewMode : 'Portrait',
ViewModeToolsVisible : true,
ZoomToolsVisible : true,
NavToolsVisible : true,
CursorToolsVisible : true,
SearchToolsVisible : true,
localeChain : "en_US"
}});
分享到:
相关推荐
最经做文档在线阅读(类似百度文库那种的),将pdf文件转换为swf,然后通过flexpaper展现出来。此源码部分主要是如何通过flexpaper将swf文件展现出来的实现,有用到网友的一些方法,在此一并感谢。 通过在改写编译...
仿百度文库 文档转pdf在转swf,flexpaper查看swf。转换用服务实现。
这个文件就是经过源文件修改过后的文件,已经去除了右键、水印、logo等不必要的东西,方便了我们在web项目中集成开发。只需下载放到项目中,把flexpaper.js中的src改为这个文件名即可使用。
FlexPaper.swf破解 1.4 无logo、水印、禁止打印、可旋转;可单页、双页、多页预览、旋转、缩放、全屏、搜索,同时去除了水印和打印功能;已测试,有完整示例,注释。
轻松通过flexpaper实现在线阅读pdf的源码和示例代码。
该压缩包中包含了flexpaper.js+flexpaper_handlers.js+FlexPaperViewer.swf+viewFile.jsp 其中flexpaper.js+flexpaper_handlers.js+FlexPaperViewer.swf为控件 viewFile.jsp为在线展示swf代码示例
以flexpaper显示swf文件,FlexPaper_1.4.7_flash.zip可以控制是否打印
flexpaper,可以将 pdf,img,png等格式转换得到的swf文件在线浏览。介绍一个简单的工具,用来将pdf,img,png等格式转换得到的swf文件。叫swftools。google下,官网下载一个,即可轻松转换。 上传的文件解压后,把...
项目开发过程中实现文档在线浏览,用到的flexpaper相关文件。
1.项目是用flash builder打开。 2.配置及研究参考博客:http://www.cnblogs.com/yimiao/archive/2012/01/05/2312852.html 3.使用FlexPaperViewer.swf文件可直接将bin-debug下面的flexpaper.swf文件复制改名。
FlexPaper 用于swf 文件的预览,其中包含js插件和swf播放器。swf播放器经过修改,已经去掉logo,而且支持禁用打印功能。
FlexPaper是一个开源轻量级的在浏览器上显示各种文档的组件,被设计用来与PDF2SWF一起使用, 使在Flex中显示PDF成为可能,而这个过程并无需PDF软件环境的支持。它可以被当做Flex的库来使用。 另外你也可以通过将...
解压可以直接运行,包含完整的 swftools 和 flexpaper_flash 中的js及swf。 在线文库效果 ………………
功能介绍: 最近有个项目需要用到类似百度文库以及豆丁的在线浏览组件, ... 源码使用flexpaper读取swf文件,在页面上显示内容, pdf2swf 转换工具的代码在文档中 注意: 开发环境为Visual Studio 2010
PDF转化成SWF,利用jsp显示进行显示SWF文件。
用FlexPaper实现在线预览,里面有demo。
flexpaper源码,去掉了logo,去掉了about按钮。可以用Flash builder直接打开,进行二次开发,生成的flexPaper.swf改名为FlexPaperViewer.swf后就可以直接导入从flexPaper网站下载的例子中使用
最近看了一点flex以及flexpaper的知识,通过我上传的代码,整合一下,可以直接在页面浏览生成的swf文件
显示 PDF 文件,将 PDF 文件转换成 SWF,再用 Adobe Flash 插件播放。另外,如果是 Word 文档,那么客户可以先利用 Office 插件或其他三方工具将 Word 文档转换成 PDF,再上传,也可以利用 Office COM 组件编写代码...
本人刚做了个项目,实现功能Linux,window)openOffice+pdf2swf+flexpaper(类百度文库) :