我的需求是在a页面展示远程服务器上的pdf文件,代码如下:
<?php$fileName = "abcd.pdf";header("Content-Type: application/pdf");header('Content-Disposition: inline; filename*="utf8\'\''.$fileName.'"');ob_start();readfile("http://www.xxx.com/pdf/xyz.pdf");$content = ob_get_contents();ob_end_clean(); echo $content; 读取速度慢,可以后台读取缓存在本地
没有pdf阅读器比较麻烦
把inline;改成outline;
全网最新最细最实用WPS零基础入门到精通全套教程!带你真正掌握WPS办公! 内含Excel基础操作、函数设计、数据透视表等
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号