Php 拉威尔罐头';t在叶片页面中加载pdf文件以进行绘制

Php 拉威尔罐头';t在叶片页面中加载pdf文件以进行绘制,php,laravel,laravel-5.8,Php,Laravel,Laravel 5.8,我试图在“home.blade.php”页面中显示pdf,但没有显示 pdf,但显示空白页 我将pdf文件存储在“公共”文件夹中 我尝试了以下两种不同的代码,但没有工作 <iframe src="{{URL::to('/WEBSITE-FILE')}}/test.pdf" width="100%" height="600"></iframe> <iframe src="WEBSITE-FILE/test.pdf" class="pdf-spacing-verify

我试图在“home.blade.php”页面中显示pdf,但没有显示 pdf,但显示空白页

我将pdf文件存储在“公共”文件夹中

我尝试了以下两种不同的代码,但没有工作

<iframe src="{{URL::to('/WEBSITE-FILE')}}/test.pdf" width="100%" height="600"></iframe>

<iframe src="WEBSITE-FILE/test.pdf" class="pdf-spacing-verify pdf-view-for-mainnet-verify" id="pdf_display_frame" width="100%" height="500px"></iframe>

好的,当我尝试在浏览器中显示pdf时,我认为我的代码有问题,它在google chrome浏览器中打开,但在mozilla firefox中没有打开,因此我的pdf处于下载模式,然后我将其更改为“在firefox中预览”。 请在两个浏览器中检查pdf是否处于查看模式

Firefox浏览器

Chrome浏览器

之后,请检查您的pdf文件是否可以通过URL访问

<html>
<body>
<iframe
    src="{{ url('storage/images/sample.pdf') }}"
    style="width:400px; height:500px;"
    frameborder="0"
></iframe>
<object data="{{ url('storage/images/sample.pdf') }}" type="application/pdf"   style="width:400px; height:500px;">
    <p>Alternative text - include a link <a href="{{ url('storage/images/sample.pdf') }}">to the PDF!</a></p>
</object>
<embed src= "{{ url('storage/images/sample.pdf') }}"   style="width:400px; height:500px;">
</body>
</html>

备选文本-包括链接

如果您无法通过url访问pdf,请确保存储路径正确:确保创建了符号链接


我希望这能有所帮助。

@aynber我试过了,但没有成功