eyoucms手机端如何在线预览pdf文件攻略
1,项目根目录引入system文件夹
2,在模板进行调用如下:
{eyou:notempty name='$eyou.field.fujian' /}
<script language="javascript" src="/system/static/js/dynclicks.js"></script>
<script language="javascript" src="/system/static/js/NewsvoteDWR.js"></script>
<script language="javascript" src="/system/static/js/engine.js"></script>
<script language="javascript" src="/system/static/js/newscontent.js"></script>
<script language="javascript" src="/system/static/js/ajax.js"></script>
<script language="javascript" src="/system/static/js/jquery-latest.min.js"></script>
<p style="text-indent: 0">
<script>var vsb_pdf_image_data = [{eyou:diyfield type='imgs' id='pdfduotu' name='$eyou.field.pdfduotu'}"{$pdfduotu.image_url}",{/eyou:diyfield}];showVsbpdfIframe("{$eyou.field.fujian}","100%","600","0","border:1px solid #DDDDDD",vsb_pdf_image_data);</script></p>
<p><br></p>
{/eyou:notempty}
手机端模板调用如下:
{eyou:notempty name='$eyou.field.fujian' /}
<script language="javascript" src="/system/static/js/dynclicks.js"></script>
<script language="javascript" src="/system/static/js/NewsvoteDWR.js"></script>
<script language="javascript" src="/system/static/js/engine.js"></script>
<script language="javascript" src="/system/static/js/newscontent.js"></script>
<script language="javascript" src="/system/static/js/ajax.js"></script>
<script language="javascript" src="/system/static/js/jquery-latest.min.js"></script>
<p style="text-indent: 0">
<script>var vsb_pdf_image_data = [{eyou:diyfield type='imgs' id='pdfduotu' name='$eyou.field.pdfduotu'}"{$pdfduotu.image_url}",{/eyou:diyfield}];</script></p>
<p><br></p>
<?php
$url = $eyou['field']['fujian'];
$escapedUrl = rawurlencode($url);
?>
<iframe src="/system/resource/pdfjs/viewer.html?file=<?php echo $escapedUrl;?>" width="100%" height="600" style="border:1px solid #DDDDDD"></iframe>
{/eyou:notempty}
3.至此已结束,完美实现解决。