我正在努力为生成的PDF创建重复背景。wkhtmltopdf所有页面上的重复背景图像
我有我试图
.main_container{
background: url({{ resourceDir ~ 'img/certificate_margin.jpg' }}) 0 0;
padding-top:15px;
z-index: 99;
background-size: cover;
width:658px;
height:975px;
}
但第一页显示之后只有我自动生成和证书设计有应重复的所有网页框架的证书......
获取内容和白页。 有没有人设法解决这个问题一些如何?或者甚至有可能做到这一点?
我的配置文件:
knp_snappy:
pdf:
enabled: true
binary: "%wkhtmltopdf_binary_path%"
options:
page-size: A4
dpi: 150
image-dpi: 150
encoding: utf-8
和生成代码:
$unsignedPdfContent = $this->snappy->getOutputFromHtml(
$this->templating->render(
$this->getTemplate(), [
'certificate' => $this->certificate,
'resourceDir' => __DIR__.'/../Resources/public/'
]
)
);