mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-04-19 11:11:18 +00:00
Compare commits
7 Commits
4f3388de6d
...
47bd87fba9
Author | SHA1 | Date | |
---|---|---|---|
![]() |
47bd87fba9 | ||
![]() |
de9e3edf5c | ||
![]() |
1e0e942d93 | ||
![]() |
6da84338dc | ||
![]() |
1c27944329 | ||
![]() |
84c778aa6c | ||
![]() |
6ec8aea201 |
@ -134,7 +134,7 @@ Stirling-PDF currently supports 39 languages!
|
||||
| Hungarian (Magyar) (hu_HU) |  |
|
||||
| Indonesian (Bahasa Indonesia) (id_ID) |  |
|
||||
| Irish (Gaeilge) (ga_IE) |  |
|
||||
| Italian (Italiano) (it_IT) |  |
|
||||
| Italian (Italiano) (it_IT) |  |
|
||||
| Japanese (日本語) (ja_JP) |  |
|
||||
| Korean (한국어) (ko_KR) |  |
|
||||
| Norwegian (Norsk) (no_NB) |  |
|
||||
|
@ -516,7 +516,7 @@ dependencies {
|
||||
implementation "org.bouncycastle:bcprov-jdk18on:$bouncycastleVersion"
|
||||
implementation "org.bouncycastle:bcpkix-jdk18on:$bouncycastleVersion"
|
||||
implementation "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion"
|
||||
implementation "io.micrometer:micrometer-core:1.14.5"
|
||||
implementation "io.micrometer:micrometer-core:1.14.6"
|
||||
implementation group: "com.google.zxing", name: "core", version: "3.5.3"
|
||||
// https://mvnrepository.com/artifact/org.commonmark/commonmark
|
||||
implementation "org.commonmark:commonmark:0.24.0"
|
||||
|
@ -515,13 +515,13 @@ home.showJS.title=Afficher le JavaScript
|
||||
home.showJS.desc=Recherche et affiche tout JavaScript injecté dans un PDF.
|
||||
showJS.tags=JS
|
||||
|
||||
home.autoRedact.title=Censure automatique
|
||||
home.autoRedact.desc=Censurer automatiquement les informations sensibles d'un PDF.
|
||||
autoRedact.tags=caviarder,rédiger,censurer,redact,auto
|
||||
home.autoRedact.title=Caviardage automatique
|
||||
home.autoRedact.desc=Caviardez automatiquement les informations sensibles d'un PDF.
|
||||
autoRedact.tags=caviarder,redact,auto
|
||||
|
||||
home.redact.title=Censure manuelle
|
||||
home.redact.desc=Censurer un PDF en fonction de texte sélectionné, formes dessinées et/ou des pages sélectionnées.
|
||||
redact.tags=Redact,Hide,black out,black,marker,hidden,manual,caviarder,rédiger,censurer
|
||||
home.redact.title=Caviardage manuel
|
||||
home.redact.desc=Caviarder un PDF en fonction de texte sélectionné, formes dessinées et/ou des pages sélectionnées.
|
||||
redact.tags=Caviarder,Redact,Hide,black out,black,marker,hidden,manual
|
||||
|
||||
home.tableExtraxt.title=PDF en CSV
|
||||
home.tableExtraxt.desc=Extrait les tableaux d'un PDF et les transforme en CSV.
|
||||
@ -621,31 +621,31 @@ autoRedact.convertPDFToImageLabel=Convertir un PDF en PDF-Image (utilisé pour s
|
||||
autoRedact.submitButton=Caviarder
|
||||
|
||||
#redact
|
||||
redact.title=Rédaction manuelle
|
||||
redact.header=Rédaction manuelle
|
||||
redact.submit=Rédiger
|
||||
redact.textBasedRedaction=Rédaction en fonction de texte
|
||||
redact.pageBasedRedaction=Rédaction en fonction de pages
|
||||
redact.title=Caviardage manuel
|
||||
redact.header=Caviardage manuel
|
||||
redact.submit=Caviarder
|
||||
redact.textBasedRedaction=Caviarder du texte
|
||||
redact.pageBasedRedaction=Caviarder des pages
|
||||
redact.convertPDFToImageLabel=Convertir en PDF-Image (pour supprimer le texte derrière le rectangle)
|
||||
redact.pageRedactionNumbers.title=Pages
|
||||
redact.pageRedactionNumbers.placeholder=(ex: 1,2,8 ou 4,7,12-16 ou 2n-1)
|
||||
redact.redactionColor.title=Couleur
|
||||
redact.export=Exporter
|
||||
redact.upload=Téléverser
|
||||
redact.boxRedaction=Dessiner le rectangle à rédiger
|
||||
redact.boxRedaction=Tracer le rectangle à caviarder
|
||||
redact.zoom=Zoom
|
||||
redact.zoomIn=Zoom avant
|
||||
redact.zoomOut=Zoom arrière
|
||||
redact.nextPage=Page suivante
|
||||
redact.previousPage=Page précédente
|
||||
redact.toggleSidebar=Toggle Sidebar
|
||||
redact.toggleSidebar=Montrer la barre latérale
|
||||
redact.showThumbnails=Afficher les miniatures
|
||||
redact.showDocumentOutline=Montrer les contours du document (double-click pour agrandir/réduire tous les éléments)
|
||||
redact.showAttatchments=Montrer les éléments attachés
|
||||
redact.showLayers=Montrer les calques (double-click pour réinitialiser tous les calques à l'état par défaut)
|
||||
redact.colourPicker=Sélection de couleur
|
||||
redact.findCurrentOutlineItem=Trouver l'élément de contour courrant
|
||||
redact.applyChanges=Apply Changes
|
||||
redact.applyChanges=Appliquer les changements
|
||||
|
||||
#showJS
|
||||
showJS.title=Afficher le JavaScript
|
||||
|
@ -553,7 +553,7 @@
|
||||
{
|
||||
"moduleName": "io.micrometer:micrometer-core",
|
||||
"moduleUrl": "https://github.com/micrometer-metrics/micrometer",
|
||||
"moduleVersion": "1.14.5",
|
||||
"moduleVersion": "1.14.6",
|
||||
"moduleLicense": "The Apache Software License, Version 2.0",
|
||||
"moduleLicenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.txt"
|
||||
},
|
||||
|
@ -26,7 +26,6 @@ window.addEventListener("keydown", (event) => {
|
||||
|
||||
function undoDraw() {
|
||||
const data = signaturePad.toData();
|
||||
|
||||
if (data && data.length > 0) {
|
||||
const removed = data.pop();
|
||||
undoData.push(removed);
|
||||
@ -35,7 +34,6 @@ function undoDraw() {
|
||||
}
|
||||
|
||||
function redoDraw() {
|
||||
|
||||
if (undoData.length > 0) {
|
||||
const data = signaturePad.toData();
|
||||
data.push(undoData.pop());
|
||||
@ -52,24 +50,18 @@ function addDraggableFromPad() {
|
||||
}
|
||||
|
||||
function getCroppedCanvasDataUrl(canvas) {
|
||||
let originalCtx = canvas.getContext('2d');
|
||||
let originalCtx = canvas.getContext('2d', { willReadFrequently: true });
|
||||
let originalWidth = canvas.width;
|
||||
let originalHeight = canvas.height;
|
||||
let imageData = originalCtx.getImageData(0, 0, originalWidth, originalHeight);
|
||||
|
||||
let minX = originalWidth + 1,
|
||||
maxX = -1,
|
||||
minY = originalHeight + 1,
|
||||
maxY = -1,
|
||||
x = 0,
|
||||
y = 0,
|
||||
currentPixelColorValueIndex;
|
||||
let minX = originalWidth + 1, maxX = -1, minY = originalHeight + 1, maxY = -1;
|
||||
|
||||
for (y = 0; y < originalHeight; y++) {
|
||||
for (x = 0; x < originalWidth; x++) {
|
||||
currentPixelColorValueIndex = (y * originalWidth + x) * 4;
|
||||
let currentPixelAlphaValue = imageData.data[currentPixelColorValueIndex + 3];
|
||||
if (currentPixelAlphaValue > 0) {
|
||||
for (let y = 0; y < originalHeight; y++) {
|
||||
for (let x = 0; x < originalWidth; x++) {
|
||||
let idx = (y * originalWidth + x) * 4;
|
||||
let alpha = imageData.data[idx + 3];
|
||||
if (alpha > 0) {
|
||||
if (minX > x) minX = x;
|
||||
if (maxX < x) maxX = x;
|
||||
if (minY > y) minY = y;
|
||||
@ -81,14 +73,14 @@ function getCroppedCanvasDataUrl(canvas) {
|
||||
let croppedWidth = maxX - minX;
|
||||
let croppedHeight = maxY - minY;
|
||||
if (croppedWidth < 0 || croppedHeight < 0) return null;
|
||||
let cuttedImageData = originalCtx.getImageData(minX, minY, croppedWidth, croppedHeight);
|
||||
let cutImageData = originalCtx.getImageData(minX, minY, croppedWidth, croppedHeight);
|
||||
|
||||
let croppedCanvas = document.createElement('canvas'),
|
||||
croppedCtx = croppedCanvas.getContext('2d');
|
||||
let croppedCanvas = document.createElement('canvas');
|
||||
let croppedCtx = croppedCanvas.getContext('2d');
|
||||
|
||||
croppedCanvas.width = croppedWidth;
|
||||
croppedCanvas.height = croppedHeight;
|
||||
croppedCtx.putImageData(cuttedImageData, 0, 0);
|
||||
croppedCtx.putImageData(cutImageData, 0, 0);
|
||||
|
||||
return croppedCanvas.toDataURL();
|
||||
}
|
||||
@ -114,10 +106,20 @@ function resizeCanvas() {
|
||||
signaturePad.clear();
|
||||
}
|
||||
|
||||
new IntersectionObserver((entries, observer) => {
|
||||
const debounce = (fn, delay = 100) => {
|
||||
let timer;
|
||||
return (...args) => {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => fn(...args), delay);
|
||||
};
|
||||
};
|
||||
|
||||
const debouncedResize = debounce(resizeCanvas, 200);
|
||||
|
||||
new IntersectionObserver((entries) => {
|
||||
if (entries.some((entry) => entry.intersectionRatio > 0)) {
|
||||
resizeCanvas();
|
||||
debouncedResize();
|
||||
}
|
||||
}).observe(signaturePadCanvas);
|
||||
|
||||
new ResizeObserver(resizeCanvas).observe(signaturePadCanvas);
|
||||
new ResizeObserver(debouncedResize).observe(signaturePadCanvas);
|
||||
|
@ -43,13 +43,13 @@
|
||||
</div>
|
||||
<script type="module" th:src="@{'/pdfjs-legacy/pdf.mjs'}"></script>
|
||||
<div class="tab-group show-on-file-selected">
|
||||
<div class="tab-container" th:title="#{sign.upload}" th:data-title="#{sign.upload}">
|
||||
<div class="tab-container"th:data-title="#{sign.upload}">
|
||||
<div
|
||||
th:replace="~{fragments/common :: fileSelector(name='image-upload', disableMultipleFiles=false, multipleInputsForSingleRequest=true, accept='image/*', inputText=#{imgPrompt})}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-container drawing-pad-container" th:title="#{sign.draw}" th:data-title="#{sign.draw}">
|
||||
<div class="tab-container drawing-pad-container" th:data-title="#{sign.draw}">
|
||||
<canvas id="drawing-pad-canvas"></canvas>
|
||||
<br>
|
||||
<button id="clear-signature" class="btn btn-outline-danger mt-2" onclick="signaturePad.clear()"
|
||||
@ -62,7 +62,7 @@
|
||||
onclick="redoDraw()"></button>
|
||||
</div>
|
||||
|
||||
<div class="tab-container" th:title="#{sign.saved}" th:data-title="#{sign.saved}">
|
||||
<div class="tab-container" th:data-title="#{sign.saved}">
|
||||
<div class="saved-signatures-section" th:if="${not #lists.isEmpty(signatures)}">
|
||||
|
||||
<!-- Preview Modal -->
|
||||
@ -134,7 +134,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-container" th:title="#{sign.text}" th:data-title="#{sign.text}">
|
||||
<div class="tab-container" th:data-title="#{sign.text}">
|
||||
<label class="form-check-label" for="sigText" th:text="#{text}"></label>
|
||||
<textarea class="form-control" id="sigText" name="sigText" rows="3"></textarea>
|
||||
<label th:text="#{font}"></label>
|
||||
|
Loading…
x
Reference in New Issue
Block a user