在PHP中显示pdf文件的内容 [英] Show content of file pdf in PHP
问题描述
大家好.
我在HTML中使用框架有一些问题
我想使用Frame的"src"属性将pdf文件插入其中,以便它将在浏览器上显示pdf文件的内容(带有用于Foxfox的Foxit Reader插件)
这是我的代码:
Hi all.
I have some problems with Frame in HTML
I want to use ''src'' atribute of Frame to insert a pdf file into it sothat it will show content of pdf file on browser(with plugin Foxit Reader for firefox)
Here is my code:
<frameset rows="130,*"><frame /><frame src="data/cv1.pdf" /></frameset>
如果我以html格式保存该代码,就可以了.我可以在浏览器中看到pdf文件
现在,我想使用php重写该代码:
If I saved that code with html format, it would be ok.I can see pdf file on browser
Now I want to rewrite that code using php:
<frameset rows="130,*"><frame /><frame src=<?php echo "data/".$_GET["id"];?> />
//$_GET["id"]="cv1.pdf"
并以php格式保存.但是,当我运行此php脚本时,它只显示一个用于下载pdf文件的框.
有什么不同,我该如何解决?
and save with php format.But when I run this php script, it only show a box to download pdf file.
What is different and how can I solve it?
Thank you very much!
推荐答案
_GET ["id"];?> /> //
_GET["id"];?> /> //
_GET ["id"] ="cv1.pdf"
_GET["id"]="cv1.pdf"
并以php格式保存.但是,当我运行此php脚本时,它只显示一个用于下载pdf文件的框.
有什么不同,我该如何解决?
非常感谢!
and save with php format.But when I run this php script, it only show a box to download pdf file.
What is different and how can I solve it?
Thank you very much!
您要关闭src中的"吗?我看到您在何处回显数据/{ID},但我看不到您在何处插入尖括号
Are you closing the "" in src. I see where you echo "data/{ID} but I can''t see where you inserting the close brackets
这篇关于在PHP中显示pdf文件的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!