DomPDF {PAGE_NUM}不在第一页上 [英] DomPDF {PAGE_NUM} not on first page

查看:175
本文介绍了DomPDF {PAGE_NUM}不在第一页上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用domPDF来生成PDF文档。激活dompdf_config.inc.php和dompdf_config.custom.inc.php中的内联PHP后,我添加了以下代码以显示页面Numbers:

 < script type =text / php> 
$ pdf-> page_text(50,20,Seite {PAGE_NUM},Font_Metrics :: get_font(sans-serif),10,array(0,0,0));
< / script>

现在这个效果很好,但是sady,我无法以某种方式声明,这应该不会在第一页上完成。



是否有任何选择可以这样做?

感谢您的支持帮助和时间

解决方案

我也有这个问题。



I设法通过在第一页的分页上方添加一个白色矩形来解决它。



使用位置:绝对 CSS属性允许你只在第一页放置东西。



创建一个白色的矩形div,添加绝对属性并将其放在你想隐藏的位置上。这将隐藏分页,因为矩形是白色的,它也是不可见的。



如果有人有更好的解决方案,我也会接受它!

>

I'm using domPDF to generate a PDF-Documentation. After activating the inline PHP in the dompdf_config.inc.php and dompdf_config.custom.inc.php I've added the following code to display the page Numbers:

<script type="text/php">
    $pdf->page_text(50, 20, "Seite {PAGE_NUM}", Font_Metrics::get_font("sans-serif"), 10, array(0,0,0));
</script>

Now this works quite well, but sady, I'm not able to somehow declare, that this should not be done on the first page.

Are there any options to do so?

Thank you for your help and time

解决方案

I had this problem too.

I managed to solve it by adding a white rectangle above the pagination of the first page.

Using the position: absolute CSS property allows you to place stuff on the first page only.

Create a white rectangle div, add the absolute property and position it above what you want to hide. This will hide the pagination and as the rectangle is white, it will be invisible too.

If someone has a better solution, I'll take it too !

这篇关于DomPDF {PAGE_NUM}不在第一页上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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