【发布时间】:2021-05-20 02:20:24
【问题描述】:
我需要删除 PDF 的最后一页上的水印,但我无法在页眉中检测到最后一页是的,我可以在页脚中执行此操作。
protected $last_page_flag = false;
public function Close() {
$this->last_page_flag = true;
parent::Close();
}
public function Footer(){
if ($this->last_page_flag ){
//this work fine
}
}
//But I can't detect the last page in the header, which is where I put the watermark.
public function Header(){
$img_file = K_PATH_IMAGES.'marca_agua.jpg';
$this->Image($img_file, 12, 80, 185, 180, '', '', '', false, 300, '', false, false, 0);
$this->setPageMark();
//if I do
if ($this->last_page_flag ){
//Do nothing...
}
}
我的 pdf 有动态页数,我需要删除最后一页的水印。如何检测它是否是页眉中的最后一页?
或者如何在标题以外的部分插入水印?
谢谢!我真的对这个问题感到绝望,因为这是我交付工作的最后一件事,而且我已经尝试了两天没有解决方案。
【问题讨论】: