diff --git a/distribution/doc/release-notes/3.1.0.md b/distribution/doc/release-notes/3.1.0.md index 6b49901f..18a2fcae 100644 --- a/distribution/doc/release-notes/3.1.0.md +++ b/distribution/doc/release-notes/3.1.0.md @@ -10,4 +10,5 @@ Packaging-focused release: the fat jar is gone and every supported platform ship - **Default hash algorithm is now SHA-256** (was SHA-1) for signing that relies on the implicit default. An explicit or saved `hash.algorithm` is untouched, and SHA-1 stays selectable for the OpenPDF engine. - **CLI signatures now append by default**, matching the GUI. Use the new `--overwrite` flag to replace existing signatures; the legacy `--append` / `-a` flag is kept as a no-op. - **Signed Windows installers** — the Windows MSI installers are Authenticode-signed via SignPath, so they install without an unknown-publisher warning. Pre-release builds ship unsigned. +- **Configurable default output suffix** — the `_signed` marker appended to the output file name can now be changed with the new `output.suffix` key in `advanced.properties`, so non-English users can localize it (e.g. `_firmado`). It feeds both GUIs and the default for the CLI `-os` / `--out-suffix` option. - **Checksums for every artifact** — a `jsignpdf--SHA256SUMS.txt` file now covers all published release assets. diff --git a/engines/api/src/main/java/net/sf/jsignpdf/BasicSignerOptions.java b/engines/api/src/main/java/net/sf/jsignpdf/BasicSignerOptions.java index 3357dda7..8d583f2f 100644 --- a/engines/api/src/main/java/net/sf/jsignpdf/BasicSignerOptions.java +++ b/engines/api/src/main/java/net/sf/jsignpdf/BasicSignerOptions.java @@ -427,7 +427,8 @@ public String getOutFile() { } /** - * Returns output file name if filled or input file name with default output suffix ("_signed") + * Returns output file name if filled or input file name with the configured default output suffix + * (the {@code output.suffix} advanced-config key; bundled default {@code "_signed"}). * * @return */ @@ -444,7 +445,7 @@ public String getOutFileX() { tmpExtension = tmpNameBase.substring(tmpBaseLen); tmpNameBase = tmpNameBase.substring(0, tmpBaseLen); } - tmpOut = tmpNameBase + Constants.DEFAULT_OUT_SUFFIX + tmpExtension; + tmpOut = tmpNameBase + AppConfig.defaultOutSuffix() + tmpExtension; } } return tmpOut; diff --git a/engines/api/src/main/java/net/sf/jsignpdf/utils/AppConfig.java b/engines/api/src/main/java/net/sf/jsignpdf/utils/AppConfig.java index cfd10c5c..0ae8a7c2 100644 --- a/engines/api/src/main/java/net/sf/jsignpdf/utils/AppConfig.java +++ b/engines/api/src/main/java/net/sf/jsignpdf/utils/AppConfig.java @@ -50,6 +50,15 @@ public static String defaultTsaHashAlg() { return cfg().getNotEmptyProperty("tsa.hashAlgorithm", "SHA-256"); } + /** + * Suffix appended to the input file name to build the default output file name (the GUI suggestion and the + * fallback for the CLI {@code -osuffix} option), or {@value Constants#DEFAULT_OUT_SUFFIX} when unset. Lets users + * localize the {@code _signed} marker (e.g. {@code _signe}, {@code _firmado}, {@code _unterschrieben}). + */ + public static String defaultOutSuffix() { + return cfg().getNotEmptyProperty("output.suffix", Constants.DEFAULT_OUT_SUFFIX); + } + public static boolean checkValidity() { return cfg().getAsBool("certificate.checkValidity", true); } diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/conf/advanced.default.properties b/engines/api/src/main/resources/net/sf/jsignpdf/conf/advanced.default.properties index 2a37cef5..96730d3f 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/conf/advanced.default.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/conf/advanced.default.properties @@ -52,6 +52,12 @@ pdf2image.libraries=jpedal,pdfbox,openpdf # (used when the signer options don't override it). tsa.hashAlgorithm=SHA-256 +# Suffix appended to the input file name to derive the default output file +# name (e.g. mydocument.pdf -> mydocument_signed.pdf). Used as the GUI +# suggestion and the fallback for the CLI -osuffix option. Set this to +# localize the marker (e.g. _signe, _firmado, _unterschrieben). +output.suffix=_signed + # DSS signing engine (PAdES). These knobs only matter when the 'dss' engine # is selected and the requested PAdES level is LT/LTA (which embed revocation # data). B and T work fully offline and ignore them. diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages.properties index 86873ff4..940cb70f 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages.properties @@ -237,7 +237,9 @@ hlp.ocsp=enable OCSP certificate validation hlp.ocspServerUrl=default OCSP server URL, which will be used in case the signing certificate doesn't contain this information hlp.outPath=folder in which the signed documents will be stored. Default value is current folder. hlp.outPrefix=prefix for signed file. Default value is empty prefix. -hlp.outSuffix=suffix for signed filename. Default value is "_signed". (e.g. sign process on file mydocument.pdf will create new file mydocument_signed.pdf) +# Translators: {0} is the configured default suffix. This value is processed by java.text.MessageFormat, +# so any literal apostrophe must be doubled ('') or it (and the text after it) will be dropped. +hlp.outSuffix=suffix for signed filename. Default value is "{0}" (configurable with the output.suffix key in advanced.properties). E.g. sign process on file mydocument.pdf will create new file mydocument{0}.pdf hlp.ownerpwd=owner password for encrypted documents (used when -e option is given). Use '-' to read from stdin (requires --enable-stdin-passwords). hlp.page=page with visible signature. Default value is 1 (first page). If the provided page number is out of bounds, then the last page is used. hlp.posLLX=lower left corner position on X-axis of a visible signature (negative value is subtracted from page width) diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_cs.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_cs.properties index 3520f3b8..90ffe677 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_cs.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_cs.properties @@ -223,7 +223,7 @@ hlp.ocsp=povoluje OCSP validaci certifikátu hlp.ocspServerUrl=adresa OCSP serveru, která bude použita v případě, že certifikát tuto informaci neobsahuje hlp.outPath=adresář do kterého budou umístěny podepsaná PDF. Výchozím nastavením je současný adresář. hlp.outPrefix=prefix podepsaného souboru. Výchozí hodnota je prázdný prefix. -hlp.outSuffix=suffix (přípona) podepsaného souboru. Výchozí hodnota je "_signed". Např. při podepsání souboru dokument.pdf bude vytvořen soubor dokument_signed.pdf +hlp.outSuffix=suffix (přípona) podepsaného souboru. Výchozí hodnota je "{0}". Např. při podepsání souboru dokument.pdf bude vytvořen soubor dokument{0}.pdf hlp.ownerpwd=heslo vlastníka (owner password) použité je-li zapnuté kódování podepsaného dokumentu (-e). Použijte '-' pro čtení ze standardního vstupu (vyžaduje --enable-stdin-passwords). hlp.page=stránka na kterou bude umístěn viditelný podpis. Výchozí hodnota je 1 (první stránka) hlp.posLLX=pozice na ose X levého dolního rohu viditelného podpisu (při použití záporné hodnoty je hodnota odečtena od šiřky stránky) diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_de.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_de.properties index a8a532fb..a157d52c 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_de.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_de.properties @@ -230,7 +230,7 @@ hlp.bgScale=Vergrößerungsverhältnis für das Hintergrundbild der sichtbaren U hlp.disableAcro6Layers=deaktiviert die Acrobat 6 Ebeneneinstellungen, was bedeutet, dass alle Signaturebenen erstellt werden. Acrobat 6.0 und höher empfiehlt, nur n2- und n4-Ebenen zu erstellen. hlp.enableStdinPasswords=erlaubt das Lesen von Passwortwerten von der Standardeingabe. Wenn gesetzt, bedeutet der Wert '-' einer Passwortoption: eine Zeile von stdin lesen (oder auf einer Konsole abfragen). Mehrere Passwortoptionen dürfen '-' verwenden und werden in fester Reihenfolge gelesen: --keystore-password, --key-password, --owner-password, --user-password, --tsa-cert-password, --tsa-password. hlp.encCert=Pfad zur Zertifikatsdatei, die zum Verschlüsseln der Ausgabe-PDF verwendet werden soll (wenn -encryption CERTIFICATE gesetzt ist) -hlp.outSuffix=Suffix für den signierten Dateinamen. Standardwert ist "_signed" (z. B. wird beim Signieren der Datei mydocument.pdf die neue Datei mydocument_signed.pdf erstellt) +hlp.outSuffix=Suffix für den signierten Dateinamen. Standardwert ist "{0}" (z. B. wird beim Signieren der Datei mydocument.pdf die neue Datei mydocument{0}.pdf erstellt) hlp.tsaHashAlg=Hash-Algorithmus, der für die Anfrage an den Zeitstempel-Server (TSA) verwendet wird; der Standardwert ist {0} hlp.outPrefix=Präfix für die signierte Datei. Standardwert ist ein leeres Präfix. hlp.page=Seite mit sichtbarer Signatur. Standardwert ist 1 (erste Seite). Wenn die angegebene Seitenzahl außerhalb des zulässigen Bereichs liegt, wird die letzte Seite verwendet. diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_el.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_el.properties index ecb13a38..ab2431b0 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_el.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_el.properties @@ -226,7 +226,7 @@ hlp.ocsp=ενεργοποίησε επαλήθευση πιστοποιητικ hlp.ocspServerUrl=προκαθορισμένη διεύθυνση URL OCSP εξυπηρετητή, η οποία θα χρησιμοποιείται σε περίπτωση που το πιστοποιητικό υπογραφής δεν περιέχει αυτή την πληροφορία hlp.outPath=φάκελος στον οποίο τα υπογεγραμμένα έγγραφα θα αποθηκεύονται. Προκαθορισμένη τιμή είναι ο τρέχον κατάλογος. hlp.outPrefix=πρόθεμα για υπογεγραμμένα αρχεία. Προκαθορισμένη τιμή είναι το κενό πρόθεμα. -hlp.outSuffix=επίθεμα για υπογεγραμμένα αρχεία. Προκαθορισμένη τιμή είναι "_signed". (π.χ. η υπογραφή του αρχείου mydocument.pdf θα δημιουργήσει ένα νέο αρχείο με το όνομα mydocument_signed.pdf) +hlp.outSuffix=επίθεμα για υπογεγραμμένα αρχεία. Προκαθορισμένη τιμή είναι "{0}". (π.χ. η υπογραφή του αρχείου mydocument.pdf θα δημιουργήσει ένα νέο αρχείο με το όνομα mydocument{0}.pdf) hlp.ownerpwd=κωδικός κατόχου για κρυπτογραφημένα αρχεία (χρησιμοποιείται όταν η επιλογή -e έχει δοθεί). Χρησιμοποιήστε '-' για ανάγνωση από την τυπική είσοδο (απαιτεί --enable-stdin-passwords). hlp.page=σελίδα με ορατή υπογραφή. Η προεπιλεγμένη τιμή είναι 1 (πρώτ σελίδα) hlp.posLLX=θέση της κάτω αριστερά γωνίας στον άξονα Χ μιας ορατής υπογραφής diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_es.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_es.properties index 376142f1..6fbb5a67 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_es.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_es.properties @@ -279,7 +279,7 @@ gui.vs.bgImgScale.label=Escalado de la imagen de fondo hlp.tsaCertPasswd=contraseña utilizada para abrir el archivo PKCS#12 (véase la opción« -tscf») que contiene la clave privada. Use «-» para leer desde la entrada estándar (requiere --enable-stdin-passwords). gui.vs.bgImgScale.tooltip=Escribe un valor positivo para multiplicar el tamaño de la imagen con el valor.\nEscribe un valor cero para rellenar todo el fondo (estirándolo).\nEscribe un valor negativo para ajustar las dimensiones sin distorsiones. gui.vs.l2TextFontSize.label=Tamaño de la letra de firma -hlp.outSuffix=sufijo para el nombre del archivo firmado. El valor predeterminado es «_signed». (por ejemplo, el proceso de firma en el archivo «midocumento.pdf» creará un nuevo archivo «midocumento_signed.pdf») +hlp.outSuffix=sufijo para el nombre del archivo firmado. El valor predeterminado es «{0}». (por ejemplo, el proceso de firma en el archivo «midocumento.pdf» creará un nuevo archivo «midocumento{0}.pdf») hlp.page=página con firma visible. El valor predeterminado es 1 (la primera página). Si el número de página proporcionado queda fuera de los límites se utiliza la última página. hlp.bgPath=ruta de la imagen de fondo para las firmas visibles hlp.bgScale=Escala de la imagen de fondo para las firmas visibles. Inserte un valor positivo para multiplicar el tamaño de la imagen con el valor. Inserte un valor cero para llenar todo el fondo con él (estirar). Inserte un valor negativo para ajustar al máximo el tamaño de la imagen. diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_fr.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_fr.properties index 6cfdc89e..56301f34 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_fr.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_fr.properties @@ -209,7 +209,7 @@ hlp.ocsp=Autoriser la validation de certificat par interrogation des serveurs OC hlp.ocspServerUrl=Autoriser la validation de certificat par interrogation des serveurs OCSP (équivalent à une liste de révocation). hlp.outPath=Répertoire contenant les documents signés hlp.outPrefix=Préfixe des documents signés. Par défaut aucun préfix n'est requis. -hlp.outSuffix=Suffixe ou extension des documents signés. La valeur par défaut est "_signed" (c.a.d la signature du fichier "MonDocument.pdf" sera nommée MonDocument_signed.pdf" +hlp.outSuffix=Suffixe pour le nom du fichier signé. La valeur par défaut est "{0}" (c.-à-d. la signature du fichier MonDocument.pdf créera le nouveau fichier MonDocument{0}.pdf) hlp.ownerpwd=Mot de passe pour le chiffrement de documents. Utilisez « - » pour lire depuis l'entrée standard (nécessite --enable-stdin-passwords). hlp.page=Page d'insertion de l'attache de signature. La page par défaut est la première page. hlp.posLLX=Abscisse du coin inférieur gauche de l'attache de signature inserrée dans le document PDF. diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hr.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hr.properties index d7fd37cf..a11b0d22 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hr.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hr.properties @@ -278,7 +278,7 @@ hlp.keyPwd=lozinka ključa u spremištu ključeva. U većini slučajeva ne mora hlp.ksFile=postavlja KeyStore datoteku – kao vrijednost koristi putanju do datoteke s privatnim ključevima (.p12, .pfx, .jks, …). Neka spremišta ključeva nemaju u datoteci spremljene ključeve (npr. Windows spremište ključeva – WINDOWS-MY). U tom slučaju nemoj koristiti ovu opciju. hlp.ksPwd=lozinka u KeyStore. Koristi '-' za čitanje sa standardnog ulaza (zahtijeva --enable-stdin-passwords). hlp.ksType=postavlja KeyStore vrstu (možeš navesti moguće vrijednosti za ovu opciju -lkt argument) -hlp.outSuffix=sufiks za potpisano ime datoteke. Zadana vrijednost je „_signed”. (npr. postupak potpisivanja datoteke „mydocument.pdf” stvorit će novu datoteku „mydocument_signed.pdf”) +hlp.outSuffix=sufiks za potpisano ime datoteke. Zadana vrijednost je „{0}”. (npr. postupak potpisivanja datoteke „mydocument.pdf” stvorit će novu datoteku „mydocument{0}.pdf”) hlp.page=stranica s vidljivim potpisom. Standardna vrijednost je 1 (prva stranica). Ako je navedeni broj stranice veći od ukupnog broja stranica, koristi se zadnja stranica. hlp.keyIndex=nulti indeks ključa, koji bi se trebao koristiti za potpisivanje dokumenta. Ako ova opcija niti alias nisu zadani, koristi se prvi ključ (index=0) u spremištu ključeva. (Prikaži popis aliasa ključeva koristeći -lk). Ova opcija ima niži prioritet od aliasa. hlp.reason=razlog potpisa. Standardno je prazan. diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hu.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hu.properties index 35c74783..d5ae2752 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hu.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hu.properties @@ -360,7 +360,7 @@ hlp.ocsp=OCSP tanúsítvány érvényesítés engedélyezése hlp.ocspServerUrl=alapértelmezett OCSP szerver URL, amely akkor lesz használva, ha az aláíró tanúsítvány nem tartalmazza ezt az információt hlp.outPath=az a mappa, amelybe az aláírt dokumentumok mentésre kerülnek. Alapértelmezett érték az aktuális mappa. hlp.outPrefix=előtag az aláírt fájlhoz. Alapértelmezett érték az üres előtag. -hlp.outSuffix=utótag az aláírt fájlnévhez. Alapértelmezett érték: "_signed". (pl. a mydocument.pdf fájl aláírása létrehozza a mydocument_signed.pdf fájlt) +hlp.outSuffix=utótag az aláírt fájlnévhez. Alapértelmezett érték: "{0}". (pl. a mydocument.pdf fájl aláírása létrehozza a mydocument{0}.pdf fájlt) hlp.ownerpwd=tulajdonosi jelszó titkosított dokumentumokhoz (a -e opció megadása esetén használatos). A '-' használatával a jelszó a szabványos bemenetről olvasható be (szükséges: --enable-stdin-passwords). hlp.page=az oldal a látható aláírással. Alapértelmezett érték 1 (első oldal). Ha a megadott oldalszám kívül esik a tartományon, az utolsó oldal lesz használva. hlp.posLLX=a látható aláírás bal alsó sarkának pozíciója az X tengelyen (negatív érték az oldalszélességből lesz kivonva) diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hy.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hy.properties index 72fc60f5..8f938f12 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hy.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_hy.properties @@ -345,7 +345,7 @@ hlp.ocsp=միացնել OCSP վկայագրի վավերացումը hlp.ocspServerUrl=կանխադրված OCSP սերվերի URL, որը կօգտագործվի այն դեպքում, երբ ստորագրման վկայագիրը չի պարունակում այս տեղեկատվությունը hlp.outPath=պանակ, որում կպահվեն ստորագրված փաստաթղթերը։ Կանխադրված արժեքն ընթացիկ պանակն է։ hlp.outPrefix=ստորագրված ֆայլի նախածանցը։ Կանխադրված արժեքը դատարկ նախածանց է։ -hlp.outSuffix=ստորագրված ֆայլի անվան վերջածանցը։ Կանխադրված արժեքն է "_signed"։ (օր․՝ mydocument.pdf ֆայլի ստորագրումը կստեղծի նոր ֆայլ mydocument_signed.pdf անունով) +hlp.outSuffix=ստորագրված ֆայլի անվան վերջածանցը։ Կանխադրված արժեքն է "{0}"։ (օր․՝ mydocument.pdf ֆայլի ստորագրումը կստեղծի նոր ֆայլ mydocument{0}.pdf անունով) hlp.ownerpwd=սեփականատիրոջ գաղտնաբառը գաղտնագրված փաստաթղթերի համար (օգտագործվում է, երբ տրված է -e տարբերակը)։ Օգտագործեք '-' գաղտնաբառը ստանդարտ մուտքից կարդալու համար (պահանջում է --enable-stdin-passwords): hlp.page=տեսանելի ստորագրությամբ էջը։ Կանխադրված արժեքն է 1 (առաջին էջ)։ Եթե տրամադրված էջի համարը սահմաններից դուրս է, ապա օգտագործվում է վերջին էջը։ hlp.posLLX=տեսանելի ստորագրության ներքևի ձախ անկյան դիրքը X առանցքի վրա (բացասական արժեքը հանվում է էջի լայնությունից) diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_it.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_it.properties index 4477738d..973c18f7 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_it.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_it.properties @@ -358,7 +358,7 @@ hlp.ocsp=abilita la validazione del certificato tramite OCSP hlp.ocspServerUrl=URL predefinito del server OCSP, che verrà utilizzato qualora il certificato di firma non contenga questa informazione hlp.outPath=cartella in cui verranno salvati i documenti firmati. Il valore predefinito è la cartella corrente. hlp.outPrefix=prefisso per il file firmato. Il valore predefinito è prefisso vuoto. -hlp.outSuffix=suffisso per il nome del file firmato. Il valore predefinito è "_signed". (es. la firma del file mydocument.pdf creerà il nuovo file mydocument_signed.pdf) +hlp.outSuffix=suffisso per il nome del file firmato. Il valore predefinito è "{0}". (es. la firma del file mydocument.pdf creerà il nuovo file mydocument{0}.pdf) hlp.ownerpwd=password del proprietario per i documenti crittografati (utilizzata quando è specificata l'opzione -e). Usa '-' per leggere dallo standard input (richiede --enable-stdin-passwords). hlp.page=pagina con la firma visibile. Il valore predefinito è 1 (prima pagina). Se il numero di pagina fornito è fuori intervallo, viene utilizzata l'ultima pagina. hlp.posLLX=posizione dell'angolo inferiore sinistro sull'asse X di una firma visibile (un valore negativo viene sottratto dalla larghezza della pagina) diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ja.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ja.properties index 4b745f29..4dd60850 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ja.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ja.properties @@ -348,7 +348,7 @@ hlp.ocsp=OCSPによる証明書検証を有効にします hlp.ocspServerUrl=署名証明書にこの情報が含まれていない場合に使用されるデフォルトの OCSP サーバー URL hlp.outPath=署名済み文書を保存するフォルダ。デフォルト値は現在のフォルダです。 hlp.outPrefix=署名済みファイルのプレフィックス。デフォルト値は空のプレフィックスです。 -hlp.outSuffix=署名済みファイル名のサフィックス。デフォルト値は "_signed" です。(例: mydocument.pdf への署名処理では mydocument_signed.pdf という新しいファイルが作成されます) +hlp.outSuffix=署名済みファイル名のサフィックス。デフォルト値は "{0}" です。(例: mydocument.pdf への署名処理では mydocument{0}.pdf という新しいファイルが作成されます) hlp.ownerpwd=暗号化された文書の所有者パスワード(-e オプション指定時に使用)。'-' を指定すると標準入力から読み込みます (--enable-stdin-passwords が必要)。 hlp.page=可視署名を表示するページ。デフォルト値は 1(最初のページ)です。指定されたページ番号が範囲外の場合は最後のページが使用されます。 hlp.posLLX=可視署名の左下隅のX軸位置(負の値はページ幅から減算されます) diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_nb-NO.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_nb-NO.properties index e93c9875..2ff9e14a 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_nb-NO.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_nb-NO.properties @@ -357,7 +357,7 @@ hlp.ocsp=aktiver OCSP-sertifikatvalidering hlp.ocspServerUrl=standard OCSP-server-URL, som brukes hvis signeringssertifikatet ikke inneholder denne informasjonen hlp.outPath=mappe der de signerte dokumentene lagres. Standardverdi er gjeldende mappe. hlp.outPrefix=prefiks for signert fil. Standardverdi er tomt prefiks. -hlp.outSuffix=suffiks for signert filnavn. Standardverdi er "_signed". (f.eks. signering av filen mydocument.pdf oppretter den nye filen mydocument_signed.pdf) +hlp.outSuffix=suffiks for signert filnavn. Standardverdi er "{0}". (f.eks. signering av filen mydocument.pdf oppretter den nye filen mydocument{0}.pdf) hlp.ownerpwd=eierpassord for krypterte dokumenter (brukes når -e-alternativet er oppgitt). Bruk '-' for å lese fra standard input (krever --enable-stdin-passwords). hlp.page=side med synlig signatur. Standardverdi er 1 (første side). Hvis det oppgitte sidetallet er utenfor rekkevidde, brukes siste side. hlp.posLLX=posisjonen til nedre venstre hjørne på X-aksen for en synlig signatur (negativ verdi trekkes fra sidebredden) diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_pl.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_pl.properties index 15a4e6d5..07a48d9a 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_pl.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_pl.properties @@ -366,7 +366,7 @@ hlp.ocsp=włącz walidację certyfikatu przez OCSP hlp.ocspServerUrl=domyślny adres URL serwera OCSP, który zostanie użyty w przypadku, gdy certyfikat podpisujący nie zawiera tej informacji hlp.outPath=folder, w którym będą zapisywane podpisane dokumenty. Wartość domyślna to bieżący folder. hlp.outPrefix=prefiks podpisanego pliku. Wartość domyślna to pusty prefiks. -hlp.outSuffix=sufiks nazwy podpisanego pliku. Wartość domyślna to "_signed". (np. podpisanie pliku mydocument.pdf utworzy nowy plik mydocument_signed.pdf) +hlp.outSuffix=sufiks nazwy podpisanego pliku. Wartość domyślna to "{0}". (np. podpisanie pliku mydocument.pdf utworzy nowy plik mydocument{0}.pdf) hlp.ownerpwd=hasło właściciela dla zaszyfrowanych dokumentów (używane gdy podano opcję -e). Użyj '-' aby odczytać hasło ze standardowego wejścia (wymaga --enable-stdin-passwords). hlp.page=strona z widocznym podpisem. Wartość domyślna to 1 (pierwsza strona). Jeśli podany numer strony jest poza zakresem, używana jest ostatnia strona. hlp.posLLX=położenie lewego dolnego rogu na osi X widocznego podpisu (wartość ujemna jest odejmowana od szerokości strony) diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_pt.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_pt.properties index 3a391e42..67af1344 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_pt.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_pt.properties @@ -217,7 +217,7 @@ hlp.location=localização de uma assinatura (por exemplo, Washington DC). Vazio hlp.ocspServerUrl=URL do servidor OCSP padrão, que será usado caso o certificado de assinatura não contenha essas informações hlp.visible=permite assinatura visível extcsp.iohost=Não é possível conectar ao servidor de assinatura - erro de conexão: {0} -hlp.outSuffix=sufixo para nome de ficheiro assinado. O valor padrão é "_signed". (por exemplo, processo de assinatura no ficheiro mydocument.pdf criará um novo ficheiro mydocument_signed.pdf) +hlp.outSuffix=sufixo para nome de ficheiro assinado. O valor padrão é "{0}". (por exemplo, processo de assinatura no ficheiro mydocument.pdf criará um novo ficheiro mydocument{0}.pdf) hlp.proxyType=tipo de proxy para conexões de internet. O valor padrão é {0}. Os valores possíveis são {1} hlp.posLLY=posição do canto esquerdo inferior no eixo Y de uma assinatura visível(valor negativo é subtraído da largura da página) serverAuthn.certificate=Certificado do cliente diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ru.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ru.properties index b0b21daa..4641f068 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ru.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ru.properties @@ -348,7 +348,7 @@ hlp.ocsp=включить проверку сертификата по OCSP hlp.ocspServerUrl=URL OCSP-сервера по умолчанию, который будет использоваться, если сертификат для подписи не содержит этой информации hlp.outPath=папка, в которой будут сохраняться подписанные документы. Значение по умолчанию — текущая папка. hlp.outPrefix=префикс для подписанного файла. Значение по умолчанию — пустой префикс. -hlp.outSuffix=суффикс для имени подписанного файла. Значение по умолчанию "_signed". (например, подписание файла mydocument.pdf создаст новый файл mydocument_signed.pdf) +hlp.outSuffix=суффикс для имени подписанного файла. Значение по умолчанию "{0}". (например, подписание файла mydocument.pdf создаст новый файл mydocument{0}.pdf) hlp.ownerpwd=пароль владельца для зашифрованных документов (используется, когда задана опция -e). Используйте '-' для чтения пароля со стандартного ввода (требуется --enable-stdin-passwords). hlp.page=страница с видимой подписью. Значение по умолчанию 1 (первая страница). Если указанный номер страницы выходит за пределы, используется последняя страница. hlp.posLLX=позиция нижнего левого угла по оси X для видимой подписи (отрицательное значение вычитается из ширины страницы) diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_sk.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_sk.properties index 7225490e..986d57af 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_sk.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_sk.properties @@ -73,7 +73,7 @@ hlp.ksPwd=heslo do KeyStore. Použite '-' na načítanie zo štandardného vstup console.loadKeystore=Nahrávam úložisko kľúčov: {0} hlp.tsaCertFile=cesta k súboru úložiska kľúčov, ktorý obsahuje súkromný kľúč používaný na autentifikáciu voči serveru TSA, ak sa používa metóda autentifikácie CERTIFICATE gui.visibleSignatureSettings.button=Nastavenia -hlp.outSuffix=prípona pre podpísaný názov súboru. Predvolená hodnota je "_signed". (napr. proces podpísania súboru mydocument.pdf vytvorí nový súbor mydocument_signed.pdf) +hlp.outSuffix=prípona pre podpísaný názov súboru. Predvolená hodnota je "{0}". (napr. proces podpísania súboru mydocument.pdf vytvorí nový súbor mydocument{0}.pdf) gui.rights.screenReaders.checkbox=Čítačky obrazovky gui.tsa.ocspEnabled.checkbox=Povoliť OCSP console.crlinfo.foundCrlUri=Nájdené CRL URL v distribučnom bode: {0} diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ta.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ta.properties index 11239dbe..7f0d02dd 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ta.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_ta.properties @@ -196,7 +196,7 @@ hlp.bgPath=புலப்படும் கையொப்பங்களு hlp.bgScale=புலப்படும் கையொப்பங்களுக்கான பின்னணி பட அளவு. மதிப்புடன் பட அளவைப் பெருக்க நேர்மறை மதிப்பைச் செருகவும். முழு பின்னணியையும் நிரப்ப சுழிய மதிப்பைச் செருகவும் (நீட்டவும்). சிறந்த பொருத்தம் மறுஅளவிடுவதற்கு எதிர்மறை மதிப்பைச் செருகவும். hlp.certLevel=சான்றிதழ் நிலை. இயல்புநிலை மதிப்பு_செர்டிஃபைட் இல்லை. கிடைக்கக்கூடிய மதிப்புகள் {0} hlp.loadPropertiesFile=கொடுக்கப்பட்ட கோப்பிலிருந்து பண்புகளை ஏற்றுகிறது. பயனர் வீட்டு கோப்பகத்தில் GUI ஆல் உருவாக்கப்பட்ட இயல்புநிலை சொத்து கோப்பை நகலெடுப்பதன் மூலம் கோப்பை உருவாக்க முடியும். -hlp.outSuffix=கையொப்பமிடப்பட்ட கோப்பு பெயருக்கான பின்னொட்டு. இயல்புநிலை மதிப்பு "_ குறியிடப்பட்டது". . +hlp.outSuffix=கையொப்பமிடப்பட்ட கோப்பு பெயருக்கான பின்னொட்டு. இயல்புநிலை மதிப்பு "{0}". hlp.ownerpwd=மறைகுறியாக்கப்பட்ட ஆவணங்களுக்கான உரிமையாளர் கடவுச்சொல் (-e விருப்பம் வழங்கப்படும் போது பயன்படுத்தப்படுகிறது). stdin இலிருந்து படிக்க '-' ஐப் பயன்படுத்தவும் (--enable-stdin-passwords தேவை). hlp.page=புலப்படும் கையொப்பத்துடன் பக்கம். இயல்புநிலை மதிப்பு 1 (முதல் பக்கம்). வழங்கப்பட்ட பக்க எண் எல்லைக்கு அப்பாற்பட்டதாக இருந்தால், கடைசி பக்கம் பயன்படுத்தப்படுகிறது. hlp.location=கையொப்பத்தின் இடம் (I.N. வாசிங்டன் டி.சி). இயல்பாக காலியாக உள்ளது. diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_zh_CN.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_zh_CN.properties index ab7d8141..11ab5011 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_zh_CN.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_zh_CN.properties @@ -213,7 +213,7 @@ hlp.ocsp=启用 OCSP 证书验证 hlp.ocspServerUrl=默认 OCSP 服务器 URL,当签名证书不包含此信息时将使用该地址 hlp.outPath=存储已签名文档的文件夹。默认值为当前文件夹。 hlp.outPrefix=已签名文件的前缀。默认值为空前缀。 -hlp.outSuffix=已签名文件的后缀。默认值为“_signed”。(例如:对 mydocument.pdf 进行签名将创建新文件 mydocument_signed.pdf) +hlp.outSuffix=已签名文件的后缀。默认值为“{0}”。(例如:对 mydocument.pdf 进行签名将创建新文件 mydocument{0}.pdf) hlp.ownerpwd=加密文档的所有者密码(在指定 -e 选项时使用)。使用 '-' 从标准输入读取密码(需要 --enable-stdin-passwords)。 hlp.page=显示可视化签名的页面。默认值为 1(第一页)。如果提供的页码超出范围,则使用最后一页。 hlp.posLLX=可视化签名左下角在 X 轴上的位置(负值表示从页面宽度减去) diff --git a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_zh_TW.properties b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_zh_TW.properties index aa953312..ba3f4ad4 100644 --- a/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_zh_TW.properties +++ b/engines/api/src/main/resources/net/sf/jsignpdf/translations/messages_zh_TW.properties @@ -213,7 +213,7 @@ hlp.ocsp=啟用OCSP憑證驗證 hlp.ocspServerUrl=預設OCSP伺服器URL,將在無法從憑證取得此資訊時使用 hlp.outPath=將儲存簽署文件的資料夾。預設值為目前資料夾。 hlp.outPrefix=已簽署文件的前綴。預設值為空前綴。 -hlp.outSuffix=已簽署文件的後綴。預設值為"_signed"。(如:輸入檔案為mydocument.pdf則輸出檔案將會建立為mydocument_signed.pdf) +hlp.outSuffix=已簽署文件的後綴。預設值為"{0}"。(如:輸入檔案為mydocument.pdf則輸出檔案將會建立為mydocument{0}.pdf) hlp.ownerpwd=加密文檔的擁有者密碼 (當給定 -e 參數時使用)。使用 '-' 從標準輸入讀取密碼(需要 --enable-stdin-passwords)。 hlp.page=顯示可見簽章的頁面。 預設值為 1 (第一頁)。如果頁面數字超出文檔的所有最後一頁,將使用(放置)於最後一頁。 hlp.posLLX=可見簽署的左下角X座標 (從頁寬減去負值) diff --git a/jsignpdf/src/main/java/net/sf/jsignpdf/SignPdfForm.java b/jsignpdf/src/main/java/net/sf/jsignpdf/SignPdfForm.java index 36b058b8..ad438f99 100644 --- a/jsignpdf/src/main/java/net/sf/jsignpdf/SignPdfForm.java +++ b/jsignpdf/src/main/java/net/sf/jsignpdf/SignPdfForm.java @@ -27,6 +27,7 @@ import net.sf.jsignpdf.types.HashAlgorithm; import net.sf.jsignpdf.types.PDFEncryption; import net.sf.jsignpdf.types.PrintRight; +import net.sf.jsignpdf.utils.AppConfig; import net.sf.jsignpdf.utils.GuiUtils; import net.sf.jsignpdf.utils.KeyStoreUtils; import net.sf.jsignpdf.utils.PKCS11Utils; @@ -410,7 +411,7 @@ private void fillOutputPdfName() { justName = justName.substring(0, dotPosition); } - File signedPDF = new File(f.getParentFile(), justName + "_signed.pdf"); + File signedPDF = new File(f.getParentFile(), justName + AppConfig.defaultOutSuffix() + ".pdf"); tfOutPdfFile.setText(signedPDF.getPath()); } diff --git a/jsignpdf/src/main/java/net/sf/jsignpdf/SignerOptionsFromCmdLine.java b/jsignpdf/src/main/java/net/sf/jsignpdf/SignerOptionsFromCmdLine.java index d1d0b8fc..d8a595b9 100644 --- a/jsignpdf/src/main/java/net/sf/jsignpdf/SignerOptionsFromCmdLine.java +++ b/jsignpdf/src/main/java/net/sf/jsignpdf/SignerOptionsFromCmdLine.java @@ -43,7 +43,7 @@ public class SignerOptionsFromCmdLine extends BasicSignerOptions { static final Options OPTS = new Options(); private String outPrefix; - private String outSuffix = Constants.DEFAULT_OUT_SUFFIX; + private String outSuffix = AppConfig.defaultOutSuffix(); private String outPath; private String[] files; @@ -136,6 +136,10 @@ public void loadCmdLine() throws ParseException { setOutPrefix(line.getOptionValue(ARG_OPREFIX)); if (line.hasOption(ARG_OSUFFIX)) setOutSuffix(line.getOptionValue(ARG_OSUFFIX)); + else + // Re-resolve here so the configured output.suffix is honored even though the field initializer captured + // its value at construction time (i.e. before any advanced-config override was applied). + setOutSuffix(AppConfig.defaultOutSuffix()); if (line.hasOption(ARG_SIGNER_NAME)) setSignerName(line.getOptionValue(ARG_SIGNER_NAME)); if (line.hasOption(ARG_REASON)) @@ -387,7 +391,8 @@ private Map parseAdvancedOverrides(CommandLine line) throws Pars .withArgName("path").create(ARG_OUTPATH)); OPTS.addOption(OptionBuilder.withLongOpt(ARG_OPREFIX_LONG).withDescription(RES.get("hlp.outPrefix")).hasArg() .withArgName("prefix").create(ARG_OPREFIX)); - OPTS.addOption(OptionBuilder.withLongOpt(ARG_OSUFFIX_LONG).withDescription(RES.get("hlp.outSuffix")).hasArg() + OPTS.addOption(OptionBuilder.withLongOpt(ARG_OSUFFIX_LONG) + .withDescription(RES.get("hlp.outSuffix", AppConfig.defaultOutSuffix())).hasArg() .withArgName("suffix").create(ARG_OSUFFIX)); OPTS.addOption(OptionBuilder.withLongOpt(ARG_SIGNER_NAME_LONG).withDescription(RES.get("hlp.signerName")).hasArg() .withArgName("signer").create(ARG_SIGNER_NAME)); diff --git a/jsignpdf/src/main/java/net/sf/jsignpdf/fx/view/MainWindowController.java b/jsignpdf/src/main/java/net/sf/jsignpdf/fx/view/MainWindowController.java index ae3a14d2..3a00bfa2 100644 --- a/jsignpdf/src/main/java/net/sf/jsignpdf/fx/view/MainWindowController.java +++ b/jsignpdf/src/main/java/net/sf/jsignpdf/fx/view/MainWindowController.java @@ -831,7 +831,7 @@ private static String suggestedOutFileFor(File inputFile) { nameBase = inFile.substring(0, inFile.length() - 4); suffix = inFile.substring(inFile.length() - 4); } - return nameBase + Constants.DEFAULT_OUT_SUFFIX + suffix; + return nameBase + AppConfig.defaultOutSuffix() + suffix; } @@ -1082,7 +1082,7 @@ private void onSign() { nameBase = inFile.substring(0, inFile.length() - 4); suffix = inFile.substring(inFile.length() - 4); } - options.setOutFile(nameBase + Constants.DEFAULT_OUT_SUFFIX + suffix); + options.setOutFile(nameBase + AppConfig.defaultOutSuffix() + suffix); } // Start signing diff --git a/jsignpdf/src/test/java/net/sf/jsignpdf/SignerOptionsFromCmdLineTest.java b/jsignpdf/src/test/java/net/sf/jsignpdf/SignerOptionsFromCmdLineTest.java index 9187f210..bde6967e 100644 --- a/jsignpdf/src/test/java/net/sf/jsignpdf/SignerOptionsFromCmdLineTest.java +++ b/jsignpdf/src/test/java/net/sf/jsignpdf/SignerOptionsFromCmdLineTest.java @@ -378,6 +378,39 @@ public void optionOverride_emptyKeyIsRejected() { } } + @Test + public void outSuffix_defaultIsResolvedAtParseTimeNotConstruction() throws Exception { + // Regression for the construction-time capture: the outSuffix field initializer reads the default before + // loadCmdLine runs (and before advanced overrides are applied). When -os is absent, loadCmdLine must + // re-resolve the configured output.suffix so a value set after construction (e.g. a -o override) is honored. + net.sf.jsignpdf.utils.AdvancedConfig cfg = net.sf.jsignpdf.utils.PropertyStoreFactory.getInstance() + .advancedConfig(); + Fixture f = new Fixture(""); // constructs the opts -> field initializer captures the current default + cfg.setProperty("output.suffix", "_resolvedlate"); // change the config AFTER construction + try { + f.opts.setCmdLine(new String[] { "-ksf", "/tmp/x.p12" }); // no -os + f.opts.loadCmdLine(); + assertEquals("_resolvedlate", f.opts.getOutSuffix()); + } finally { + cfg.removeProperty("output.suffix"); + } + } + + @Test + public void outSuffix_explicitFlagWinsOverConfiguredDefault() throws Exception { + net.sf.jsignpdf.utils.AdvancedConfig cfg = net.sf.jsignpdf.utils.PropertyStoreFactory.getInstance() + .advancedConfig(); + cfg.setProperty("output.suffix", "_fromcfg"); + try { + Fixture f = new Fixture(""); + f.opts.setCmdLine(new String[] { "--out-suffix", "_explicit" }); + f.opts.loadCmdLine(); + assertEquals("_explicit", f.opts.getOutSuffix()); + } finally { + cfg.removeProperty("output.suffix"); + } + } + /** Convenience wiring: captures warnings and feeds a canned stdin reader with no Console. */ private static final class Fixture { final SignerOptionsFromCmdLine opts = new SignerOptionsFromCmdLine(); diff --git a/jsignpdf/src/test/java/net/sf/jsignpdf/utils/AppConfigTest.java b/jsignpdf/src/test/java/net/sf/jsignpdf/utils/AppConfigTest.java index b00a9839..9b53f525 100644 --- a/jsignpdf/src/test/java/net/sf/jsignpdf/utils/AppConfigTest.java +++ b/jsignpdf/src/test/java/net/sf/jsignpdf/utils/AppConfigTest.java @@ -23,6 +23,30 @@ public void accessorsReturnSomething() { // String accessors backed by getNotEmptyProperty + literal default never return null/empty. assertNotNull(AppConfig.pdf2imageLibraries()); assertNotNull(AppConfig.defaultTsaHashAlg()); + assertNotNull(AppConfig.defaultOutSuffix()); + } + + @Test + public void defaultOutSuffixReadsOutputSuffixKey() { + // Verifies both that the accessor reads the output.suffix key and that, with no user override, it falls back + // to the bundled default (which ships as Constants.DEFAULT_OUT_SUFFIX). Restores the original state afterwards + // so the shared singleton isn't polluted for other tests. + AdvancedConfig cfg = PropertyStoreFactory.getInstance().advancedConfig(); + String original = cfg.hasUserOverride("output.suffix") ? cfg.getProperty("output.suffix") : null; + try { + cfg.setProperty("output.suffix", "_firmado"); + assertEquals("Accessor must read the output.suffix key", "_firmado", AppConfig.defaultOutSuffix()); + + cfg.removeProperty("output.suffix"); + assertEquals("Without an override it falls back to the bundled default", + net.sf.jsignpdf.Constants.DEFAULT_OUT_SUFFIX, AppConfig.defaultOutSuffix()); + } finally { + if (original != null) { + cfg.setProperty("output.suffix", original); + } else { + cfg.removeProperty("output.suffix"); + } + } } @Test diff --git a/website/docs/JSignPdf.adoc b/website/docs/JSignPdf.adoc index 8a7a9f99..12620a1b 100644 --- a/website/docs/JSignPdf.adoc +++ b/website/docs/JSignPdf.adoc @@ -245,7 +245,7 @@ When you are ready, click the _Sign_ button in the toolbar. JSignPdf signs the d image:img/javafx/signing-result.png[Signing complete,width=562,height=400] -The signed PDF is saved to the output path shown in the _Signature Properties_ panel. By default, it is the input file name with a `_signed` suffix (e.g. `document_signed.pdf`). +The signed PDF is saved to the output path shown in the _Signature Properties_ panel. By default, it is the input file name with a `_signed` suffix (e.g. `document_signed.pdf`). The suffix can be changed with the `output.suffix` key in `advanced.properties` (see <>) -- handy for localizing the marker (e.g. `_signe`, `_firmado`). === Using presets @@ -451,7 +451,7 @@ See <> for details. | Prefix for the signed filename. Default: empty. | `-os, --out-suffix ` -| Suffix for the signed filename. Default: `_signed` (e.g. `mydocument.pdf` becomes `mydocument_signed.pdf`). +| Suffix for the signed filename. Default: the `output.suffix` key in `advanced.properties` (bundled default `_signed`), so `mydocument.pdf` becomes `mydocument_signed.pdf`. |=== === Visible signature options @@ -764,7 +764,7 @@ _JavaFX panel: Signature Properties_ _Input PDF file_ is the existing PDF file to which a digital signature will be added. -_Output PDF file_ is the name of the resulting PDF file. If not specified, the _Input PDF file_ name with the suffix `_signed` is used automatically (e.g. input _test.pdf_ will produce _test_signed.pdf_) +_Output PDF file_ is the name of the resulting PDF file. If not specified, the _Input PDF file_ name with the suffix `_signed` is used automatically (e.g. input _test.pdf_ will produce _test_signed.pdf_). The suffix is taken from the `output.suffix` key in `advanced.properties`, so it can be localized (see <>). _*The Input and Output files have to be different!*_ @@ -1031,7 +1031,7 @@ jsignpdf doc.pdf -eng dss -pl LT -ts \ Application-wide tweaks beyond the per-document signing options live in `/advanced.properties` and -- for hardware tokens -- `/pkcs11.cfg`. Both are plain text files; the easiest way to edit them is the JavaFX <>, which writes them on _OK_. Power users can also hand-edit the files directly while JSignPdf is closed; the next launch picks up the changes. -`advanced.properties` covers the same six topics as the Preferences dialog (visible-signature font, certificate-validation toggles, relaxed SSL, PDF preview backend order, default TSA hash algorithm, and one or two miscellaneous knobs). When a key is missing from `advanced.properties`, JSignPdf falls back to defaults bundled inside the application jar, so a fresh install needs no config file at all. +`advanced.properties` covers the same topics as the Preferences dialog (visible-signature font, certificate-validation toggles, relaxed SSL, PDF preview backend order, default TSA hash algorithm) plus a few file-editable knobs such as `output.suffix` -- the suffix appended to the input file name to derive the default output file name (bundled default `_signed`; e.g. set `output.suffix=_firmado` to produce `mydocument_firmado.pdf`). When a key is missing from `advanced.properties`, JSignPdf falls back to defaults bundled inside the application jar, so a fresh install needs no config file at all. In batch mode, any of these keys can be overridden for a single run with the `-o key=value` command-line option (see <>), without changing the file. CLI overrides take precedence over `advanced.properties` and the bundled defaults, and are not persisted.