DOMPDF页面背景(或替代?) [英] DOMPDF Page background (or alternatives?)

查看:332
本文介绍了DOMPDF页面背景(或替代?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将一些动态内容导出为一小段页面格式的PDF文件。

I am trying to export some dynamic content into a PDF file with a small bit of page formatting.

我想让PDF页面有一个小填充边框,然后在边框内部,每个页面右上方会出现一个小公司徽标。

I'd like to have the PDF pages have a small padding with a border and then inside that border, a small company logo should appear up the top right on each page.

现在的问题是,因为内容是动态的,每页的页数和内容可以变化。这意味着我无法手动创建一个边框和一个图像在里面的DIV,因为内容可能是更多或更少的页面,取决于导出的内容。

Now the issue is that because the content is dynamic, the number of pages and content per page can vary. This means I can't manually create a DIV with a border and an image inside because the content could be more or less pages depending on what gets exported.

试图找到一种方法为每个PDF页面创建一个页面背景,然后在此背景中,我将绘制边框和标志,然后将所有内容叠加在此客户背景上。

I'm trying to find a way to create a 'page background' for each PDF page and then in this background I would then draw up the borders and the logo and then have all the content superimposed on this customer background.

这是不是可能与DOMPDF?

Is this even at all possible with DOMPDF? Or are there any alternatives that may provide a little more customisation like this?

推荐答案

jfoucher的方法可能是你需要的,但如果你需要更多的定制,您需要在每个页面上使用HTML内容和/或标志,还可以使用SVN中继的DOMPDF,并使用固定位置,例如CSS position fixed示例此处

jfoucher's method could be what you need, but if you need an HTML content and/or a logo on each page, you could also use DOMPDF from the SVN trunk, and use fixed positionning, like if the "CSS position fixed" example here.

这篇关于DOMPDF页面背景(或替代?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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