Ability to layer watermark behind line items?

Howdy folks. Still getting the hang of the software. I have a feeling it’s overkill for a two person shop and only one person is using it, but there you go, lol.

I’m fooling around with the Proposals part of the CRM, and the watermark is a nice touch. I have it saying “QUOTE ONLY” in nice big red letters. However, it puts it over the line items, so it blocks out some of the text on the items. Is there a way to move the watermark “behind” the regular text?

Thanks!

I think the problem is that the watermark is written at the very end of the PDF creation in the function “pdf_pagefoot” with the call of the function “_pagefoot(…)”.

Calling the function "pdf_watermark(…) after PDF creation with “$pdf->AddPage()” would help in my opinion.

1 Like

Hi @justauser
Assuming you use the default cyan template, you will have to modify _pagefoot function from

	protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
	{
		$showdetails = getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
		return pdf_pagefoot($pdf, $outputlangs, 'PROPOSAL_FREE_TEXT', $this->emetteur=0, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark);
	}
to
	protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
	{
		$showdetails = getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
		$pdf->SetAlpha(0.5);
		return pdf_pagefoot($pdf, $outputlangs, 'PROPOSAL_FREE_TEXT', $this->emetteur=0, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark);
		$pdf->SetAlpha(1);
	}
2 Likes

That did it! Thanks very much @DG-Rilling and @sonikf!