Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/91.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
阅读php嵌入的pdf_Php_Html_Pdf_Embed - Fatal编程技术网

阅读php嵌入的pdf

阅读php嵌入的pdf,php,html,pdf,embed,Php,Html,Pdf,Embed,我正在用php开发一个网站,我想在我的网站上显示一个PDF文件。我发现这个代码: $file = 'Digital.pdf'; $filename = 'Digital.pdf'; header('Content-type: application/pdf'); header('Content-Disposition: inline; filename="'.$filename.'"'); header('Content-Transfer-Encoding: binary'); heade

我正在用php开发一个网站,我想在我的网站上显示一个PDF文件。我发现这个代码:

$file = 'Digital.pdf';
$filename = 'Digital.pdf';
header('Content-type: application/pdf');
header('Content-Disposition: inline;    filename="'.$filename.'"');
header('Content-Transfer-Encoding: binary');
header('Accept-Ranges: bytes');
@readfile($file);
当我使用这段代码时,我有一个来自IDMShow的消息框来下载文件。不仅是这段代码,我在使用iframe时也遇到了同样的问题。如何解决这个问题

用这个

<iframe src="./my/folder/path/<?php echo $file ?>"></iframe>

使用
。当我使用iframe标签时,它会帮助你。我有相同的问题。它会在行中加载pdf。不,我有一个IDM的消息框可供下载。该文件不显示在浏览器中。