简体   繁体   English

TYPO3 9.5 显示pdf文件

[英]TYPO3 9.5 show pdf file

My installation is TYPO3 9.5.4 plus bootstrap_package 10.0.4.我的安装是 TYPO3 9.5.4 加上 bootstrap_package 10.0.4。 I want to display a PDF file.我想显示一个 PDF 文件。 I have included a content element type text & media to a page and connected with the PDF file.我已将内容元素类型文本和媒体包含到页面中并与 PDF 文件连接。 The backend shows the correct pre-view of the file.后端显示文件的正确预览。 However, the frontend only shows the header line of the content element, not the PDF file (as picture).但是,前端只显示内容元素的标题行,而不显示 PDF 文件(如图)。 It worked under version 8.7.xx (at that time without bootstrap_package).它在 8.7.xx 版本下工作(当时没有 bootstrap_package)。 Any hints how to solve this issue?任何提示如何解决这个问题?

Maybe your installation has problems with reading PDF as image (please do the image checks).也许您的安装在将 PDF 读取为图像时存在问题(请进行图像检查)。 Anyway there are some PDF which can't be read because of their strange format.无论如何,有一些 PDF 由于格式奇怪而无法阅读。

As you have a backend preview image I assume the PDF is readable as image.由于您有后端预览图像,因此我认为 PDF 可以作为图像读取。 And the preview image might exist since TYPO3 8. The FE rendering is done from current TYPO3 9 and maybe the graphic manipulation configuration is wrong.并且预览图可能从TYPO3 8开始存在。FE渲染是从当前的TYPO3 9完成的,可能图形处理配置错误。

You have to expand the file:您必须展开文件:

typo3conf/ext/bootstrap_package/Resources/Private/Partials/ContentElements/Media/Type.html

You need a new case for PDF files (Type 5):您需要一个新的 PDF 文件案例(类型 5):

<f:case value="5">
    <f:render partial="Media/Type/Image" arguments="{file: file, data: data, settings: settings, variants: variants}" />
</f:case>

You can copy the file in your sitepackage and expand您可以复制站点包中的文件并展开

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM