PHP - 在前端显示 PDF、AI、EPS 和 SVG 文件的预览
PHP - Show the preview of PDF, AI, EPS and SVG files in the frontend
我的 Magento 站点上有一个页面,其中显示了其中的文件。
带有我的 php 代码的图像显示它们没有问题。
pdf、ai、eps 和 svg 文件不显示它们,也不允许我看到任何预览。
我该怎么办?
谢谢
P.S。我不想为此使用 Imagemagick 和 iframe
您可以使用 HTML 对象标签执行此操作:
<object data="http://www.africau.edu/images/default/sample.pdf" type="application/pdf" class="pdfview" width="700" height="600" >
<p>Alternative text - include a link <a href=" ">to the PDF!</a></p>
</object>
<img src="http://localhost/research/coding-challenge/SampleSVGImage_23kbmb.svg" />
但 .ai 和 .eps 没有预览选项。您只能将其转换为 .pdf 或图像格式
我的 Magento 站点上有一个页面,其中显示了其中的文件。 带有我的 php 代码的图像显示它们没有问题。 pdf、ai、eps 和 svg 文件不显示它们,也不允许我看到任何预览。
我该怎么办? 谢谢
P.S。我不想为此使用 Imagemagick 和 iframe
您可以使用 HTML 对象标签执行此操作:
<object data="http://www.africau.edu/images/default/sample.pdf" type="application/pdf" class="pdfview" width="700" height="600" >
<p>Alternative text - include a link <a href=" ">to the PDF!</a></p>
</object>
<img src="http://localhost/research/coding-challenge/SampleSVGImage_23kbmb.svg" />
但 .ai 和 .eps 没有预览选项。您只能将其转换为 .pdf 或图像格式