New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable to change color of watermark text #1866
Comments
Here is a possible solution, please add it to next patch/version. @finwe 1. Need to define the variable:var $watermark_color; 2. Set default in _construct:$this->watermark_color = 0; 3. Create setter functionfunction setWatermarkColor($watermark_color = 0){ 4. Use variable in line 10484$this->SetTColor($this->colorConverter->convert($this->watermark_color, $this->PDFAXwarnings)); |
@v1har Why don't you propose a pull request directly? But rather than stomping more and more public properties to the Mpdf class, why not introduce a method
with the |
@finwe I am not a pro user of github so I thought it's easier to tell you the idea so you can implement / add pull request. I just tried to help because I need this functionality too. :) |
Please describe the new functionality as best as you can.
The watermark text color cannot be changed with a variable when a pdf is created. Currently, the only way to change it is to directly edit src/Mpdf.php line 10598, such as:
$this->SetTColor($this->colorConverter->convert(0, $this->PDFAXwarnings));
To:
$this->SetTColor($this->colorConverter->convert('red', $this->PDFAXwarnings));
Being able to change the color with a variable would be very helpful
The text was updated successfully, but these errors were encountered: