MPDF-第一页的不同背景 [英] MPDF - different background for first page

查看:209
本文介绍了MPDF-第一页的不同背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MPDF从HTML代码生成PDF文件.不幸的是,首页的布局与其余页面不同.

I am using MPDF to generate PDF-files out of HTML code. Unfortunately, the layout for the first page is different from the rest of the pages.

有没有办法使首页与其他页面有不同的背景? 布局又如何呢?有没有办法将页眉和页脚设置在不同的位置,或从第二页到最后一页删除整个页眉?

Is there any way to give the first page a different background from the rest? And how about layout, is there any way to set the header and footer on a different place or remove the whole header from the second till last page?

推荐答案

<style>
@page :first {
    background: url("http://example.com/first.svg") 50% 0 repeat;
}
@page {
    background: url("http://example.com/page.svg") 50% 0 repeat;
}
...
</style>

这篇关于MPDF-第一页的不同背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆