2023-02-03 21:26:35 +01:00
|
|
|
<!DOCTYPE html>
|
2023-04-03 00:59:22 +02:00
|
|
|
<html th:lang="${#locale.toString()}" th:lang-direction="#{language.direction}" xmlns:th="http://www.thymeleaf.org">
|
2023-02-03 21:26:35 +01:00
|
|
|
|
2023-02-05 13:54:48 +01:00
|
|
|
<th:block th:insert="~{fragments/common :: head(title=#{watermark.title})}"></th:block>
|
2023-02-03 21:26:35 +01:00
|
|
|
|
2023-02-11 15:27:15 +01:00
|
|
|
<body>
|
|
|
|
<div id="page-container">
|
|
|
|
<div id="content-wrap">
|
|
|
|
<div th:insert="~{fragments/navbar.html :: navbar}"></div>
|
|
|
|
<br> <br>
|
|
|
|
<div class="container">
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<h2 th:text="#{watermark.header}"></h2>
|
2023-02-03 21:26:35 +01:00
|
|
|
|
2023-02-11 15:27:15 +01:00
|
|
|
<form method="post" enctype="multipart/form-data" action="add-watermark">
|
|
|
|
<div class="form-group">
|
|
|
|
<label th:text="#{watermark.selectText.1}"></label>
|
2023-03-25 23:16:26 +01:00
|
|
|
<div th:replace="~{fragments/common :: fileSelector(name='fileInput', multiple=false, accept='application/pdf')}"></div>
|
2023-02-11 15:27:15 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="watermarkText" th:text="#{watermark.selectText.2}"></label>
|
|
|
|
<input type="text" id="watermarkText" name="watermarkText" class="form-control" placeholder="Stirling-PDF" required />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="fontSize" th:text="#{watermark.selectText.3}"></label>
|
|
|
|
<input type="text" id="fontSize" name="fontSize" class="form-control" value="30" />
|
|
|
|
</div>
|
2023-03-24 14:30:26 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="opacity" th:text="#{watermark.selectText.7}"></label>
|
|
|
|
<input type="text" id="opacity" name="opacityText" class="form-control" value="50" onblur="updateopacityValue()" />
|
|
|
|
<input type="hidden" id="opacityReal" name="opacity" value="0.5">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
const opacityInput = document.getElementById('opacity');
|
|
|
|
const opacityRealInput = document.getElementById('opacityReal');
|
|
|
|
|
|
|
|
const updateopacityValue = () => {
|
|
|
|
let percentageValue = parseFloat(opacityInput.value.replace('%', ''));
|
|
|
|
if (isNaN(percentageValue)) {
|
|
|
|
percentageValue = 0;
|
|
|
|
}
|
|
|
|
percentageValue = Math.min(Math.max(percentageValue, 0), 100);
|
|
|
|
opacityInput.value = `${percentageValue}`;
|
|
|
|
opacityRealInput.value = (percentageValue / 100).toFixed(2);
|
|
|
|
};
|
|
|
|
|
|
|
|
const appendPercentageSymbol = () => {
|
|
|
|
if (!opacityInput.value.endsWith('%')) {
|
|
|
|
opacityInput.value += '%';
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
opacityInput.addEventListener('focus', () => {
|
|
|
|
opacityInput.value = opacityInput.value.replace('%', '');
|
|
|
|
});
|
|
|
|
opacityInput.addEventListener('blur', () => {
|
|
|
|
updateopacityValue();
|
|
|
|
appendPercentageSymbol();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Set initial values
|
|
|
|
updateopacityValue();
|
|
|
|
appendPercentageSymbol();
|
|
|
|
</script>
|
2023-02-11 15:27:15 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="rotation" th:text="#{watermark.selectText.4}"></label>
|
|
|
|
<input type="text" id="rotation" name="rotation" class="form-control" value="45" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="widthSpacer" th:text="#{watermark.selectText.5}"></label>
|
|
|
|
<input type="text" id="widthSpacer" name="widthSpacer" class="form-control" value="50" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="heightSpacer" th:text="#{watermark.selectText.6}"></label>
|
|
|
|
<input type="text" id="heightSpacer" name="heightSpacer" class="form-control" value="50" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group text-center">
|
2023-04-02 12:51:07 +02:00
|
|
|
<input type="submit" id="submitBtn" th:value="#{watermark.submit}" class="btn btn-primary" />
|
2023-02-11 15:27:15 +01:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div th:insert="~{fragments/footer.html :: footer}"></div>
|
|
|
|
</div>
|
2023-02-03 21:26:35 +01:00
|
|
|
</body>
|
|
|
|
</html>
|