bithost-gmbh/pdfviewhelpers

这是一个TYPO3 CMS扩展,提供各种Fluid ViewHelper来生成PDF文档。

v3.0.0 2023-12-18 14:56 UTC

README

TYPO3 TYPO3 Build Status Packagist Downloads Donate

TYPO3 CMS 扩展 pdfviewhelpers

简介

这是一个TYPO3 CMS扩展,提供各种Fluid ViewHelper来生成PDF文档。使用此扩展的ViewHelper,您可以将任何Fluid模板转换为PDF文档。扩展pdfviewhelpers使用TCPDFFPDI进行PDF生成。

关键特性

  • 渲染文本和列表的ViewHelper
  • 渲染图像的ViewHelper(支持FAL和图像处理)
  • 重复渲染页眉和页脚的ViewHelper
  • 渲染HTML/富文本内容的ViewHelper
  • 避免页面中断的ViewHelper
  • 创建多列布局的ViewHelper
  • 创建内容表的ViewHelper
  • 将现有PDF文档加载为模板
  • 轻松定义和应用不同的文本类型
  • 通过编写自己的ViewHelper进行完全自定义
  • 支持批量创建PDF
  • 支持的输出目标:字符串、内联、下载和文件
  • 在前端和后端都可使用
  • 丰富的基于继承的TypoScript设置
  • 丰富的API文档,包含大量示例

支持开发

通过扩展pdfviewhelpers,我们试图减轻创建PDF文档的痛苦。我们旨在通过不断改进扩展和快速响应错误报告,提供最佳服务。我们完全免费,主要是因为我们热爱编码和分享。然而,我们仍然是凡人,有人的需求,如食物、住所和啤酒。所以,如果您觉得这个扩展对您有用,并为您和您的业务节省了一些宝贵的时间,请考虑捐款以支持其维护和进一步开发。

PayPal

链接

示例

Fluid模板

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      xmlns:pdf="http://typo3.org/ns/Bithost/Pdfviewhelpers/ViewHelpers"
      xsi:schemaLocation="http://typo3.org/ns/Bithost/Pdfviewhelpers/ViewHelpers https://pdfviewhelpers.bithost.ch/schema/3.0.xsd"
      data-namespace-typo3-fluid="true">
    
<pdf:document outputDestination="inline" title="Bithost Example">
    <pdf:header>
        <pdf:image src="EXT:pdfviewhelpers/Resources/Public/Examples/BasicUsage/logo.png" width="40" />
        <pdf:text alignment="right" color="#8C8C8C" paragraphSpacing="0" posY="15">
            Bithost GmbH
            Milchbuckstrasse 83
            CH-8057 Zürich
    
            hallo@bithost.ch
            044 585 28 20
    
            www.bithost.ch
        </pdf:text>
    </pdf:header>
    <pdf:footer>
        <pdf:graphics.line style="{color: '#8C8C8C'}" />
        <pdf:text color="#8C8C8C">Page {pdf:getPageNumberAlias()}</pdf:text>
        <pdf:text alignment="right" color="#8C8C8C" posY="-13.5">EXT:pdfviewhelpers - Basic usage example</pdf:text>
    </pdf:footer>
    
    <pdf:page>
        <pdf:text posY="50" padding="{bottom: 4}" color="#8C8C8C">
            Zurich, <f:format.date format="d.m.Y" >now</f:format.date>
        </pdf:text>
        <pdf:headline>Welcome to the extension pdfviewhelpers</pdf:headline>
        <pdf:text>Lorem ipsum [..] diam voluptua:</pdf:text>
        <pdf:headline>Some more information</pdf:headline>
    
        <pdf:multiColumn>
            <pdf:column width="55%">
                <pdf:text>
                    Lorem ipsum [..] voluptua:
                </pdf:text>
                <pdf:list listElements="{0: 'Full Stack Application Development', 1: 'Modernizing, Refactoring [..]'}" />
                <pdf:text>
                    Lorem ipsum [..] sit amet.
                </pdf:text>
            </pdf:column>
            <pdf:column width="45%" padding="{left: 2}">
                <pdf:image src="EXT:pdfviewhelpers/Resources/Public/Examples/BasicUsage/Bithost.jpg" link="https://bithost.ch/" />
                <pdf:text padding="{top: 1}" color="#8C8C8C">Esteban Gehring, Markus Mächler</pdf:text>
            </pdf:column>
        </pdf:multiColumn>
    
        <pdf:text>Lorem ipsum [..] sit amet.</pdf:text>
        <pdf:text>Lorem ipsum [..] sit amet.</pdf:text>
    </pdf:page>
</pdf:document>

</html>

PDF输出

Example PDF output