feat: add Thai language support and corresponding font for watermarking (#3819)

# Description of Changes
This pull request adds support for Thai language in the watermark
functionality.
### Backend updates:

*
[`stirling-pdf/src/main/java/stirling/software/SPDF/controller/api/security/WatermarkController.java`](diffhunk://#diff-73e8448c42af57bb0549146473b5e7edc063533694813dfda7214e51005a90daR173-R175):
Added a new case for "thai" in the `addTextWatermark` method to use the
`NotoSansThai-Regular.ttf` font for Thai text.

### Frontend updates:

*
[`stirling-pdf/src/main/resources/templates/security/add-watermark.html`](diffhunk://#diff-dc75a6b50ba2a29c6cb17f0cfa65e4ffac88102d5834ea40fc9d9b3b4d00f8f3R41):
Added a new option for Thai language (`ไทย`) in the language dropdown
menu for watermark customization.


![image](https://github.com/user-attachments/assets/9ad3bf7f-bcc6-4f10-818e-d3e7467ab6c0)

### Sample PDF:


![image](https://github.com/user-attachments/assets/d8b569e3-9dcb-42b3-9699-67ffa8043bd3)


[dummy_watermarked.pdf](https://github.com/user-attachments/files/20903700/dummy_watermarked.pdf)


Closes #3810

---

## Checklist

### General

- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [x] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [x] I have performed a self-review of my own code
- [x] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

- [x] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [x] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
This commit is contained in:
Balázs Szücs 2025-06-25 19:53:01 +02:00 committed by GitHub
parent 1e17242023
commit 212d4d0dcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 0 deletions

View File

@ -170,6 +170,9 @@ public class WatermarkController {
case "chinese":
resourceDir = "static/fonts/SimSun.ttf";
break;
case "thai":
resourceDir = "static/fonts/NotoSansThai-Regular.ttf";
break;
case "roman":
default:
resourceDir = "static/fonts/NotoSans-Regular.ttf";

View File

@ -38,6 +38,7 @@
<option value="japanese">日本語</option>
<option value="korean">한국어</option>
<option value="chinese">简体中文</option>
<option value="thai">ไทย</option>
</select>
</div>
<div id="watermarkTextGroup" class="mb-3">