diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index e5f6695c929..92b538c5824 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -814,17 +814,24 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) $watermark_x = $w / 2; $watermark_y = $h / 3; $pdf->SetFont('', 'B', 40); - $pdf->SetTextColor(255, 192, 203); + $pdf->SetTextColor(255, 0, 0); //rotate $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm', cos($watermark_angle), sin($watermark_angle), -sin($watermark_angle), cos($watermark_angle), $watermark_x * $k, ($h - $watermark_y) * $k, -$watermark_x * $k, -($h - $watermark_y) * $k)); //print watermark $pdf->SetXY($watermark_x_pos, $watermark_y_pos); + + // set alpha to semi-transparency + $pdf->SetAlpha(0.3); $pdf->Cell($w - 20, 25, $outputlangs->convToOutputCharset($text), "", 2, "C", 0); + //antirotate $pdf->_out('Q'); $pdf->SetXY($savx, $savy); + + // Restore alpha + $pdf->SetAlpha(1); }