我正在努力爲生成的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/'
]
)
);