formats and renames

This commit is contained in:
Anthony Stirling 2025-09-22 14:47:28 +01:00
parent b126fb3bd6
commit 68ccb0f970
18 changed files with 216 additions and 366 deletions

View File

@ -18,7 +18,9 @@ public class PDFFile {
@Schema(description = "The input PDF file", format = "binary")
private MultipartFile fileInput;
@Schema(description = "File ID for server-side files (can be used instead of fileInput if job was previously done on file in async mode)")
@Schema(
description =
"File ID for server-side files (can be used instead of fileInput if job was previously done on file in async mode)")
private String fileId;
@AssertTrue(message = "Either fileInput or fileId must be provided")

View File

@ -9,7 +9,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.RequiredArgsConstructor;
import stirling.software.SPDF.config.EndpointConfiguration;
import stirling.software.common.annotations.api.ConfigApi;
@ -18,7 +17,6 @@ import stirling.software.common.model.ApplicationProperties;
import stirling.software.common.service.ServerCertificateServiceInterface;
@ConfigApi
@RequiredArgsConstructor
@Hidden
public class ConfigController {

View File

@ -427,9 +427,9 @@
"title": "Flatten",
"desc": "Remove all interactive elements and forms from a PDF"
},
"manageSignatures": {
"title": "Sign with Certificate",
"desc": "Add digital signatures to PDF documents using certificates"
"certSign": {
"title": "Sign with Certificate",
"desc": "Signs a PDF with a Certificate/Key (PEM/P12)"
},
"repair": {
"title": "Repair",
@ -447,14 +447,6 @@
"title": "Compare",
"desc": "Compares and shows the differences between 2 PDF Documents"
},
"certSign": {
"title": "Sign with Certificate",
"desc": "Signs a PDF with a Certificate/Key (PEM/P12)"
},
"manageSignatures": {
"title": "Manage Signatures",
"desc": "Sign PDFs with certificates using manual or server-managed keys"
},
"removeCertSign": {
"title": "Remove Certificate Sign",
"desc": "Remove certificate signature from PDF"
@ -1191,7 +1183,9 @@
},
"pageSelection": {
"tooltip": {
"header": { "title": "Page Selection Guide" },
"header": {
"title": "Page Selection Guide"
},
"basic": {
"title": "Basic Usage",
"text": "Select specific pages from your PDF document using simple syntax.",
@ -1225,11 +1219,15 @@
"comma": "Comma: , or | — combine selections (e.g., 1-10, 20)",
"not": "NOT: ! or \"not\" — exclude pages (e.g., 3n & not 30)"
},
"examples": { "title": "Examples" }
"examples": {
"title": "Examples"
}
}
},
"bulkSelection": {
"header": { "title": "Page Selection Guide" },
"header": {
"title": "Page Selection Guide"
},
"syntax": {
"title": "Syntax Basics",
"text": "Use numbers, ranges, keywords, and progressions (n starts at 0). Parentheses are supported.",
@ -1781,67 +1779,11 @@
}
},
"certSign": {
"tags": "authenticate,PEM,P12,official,encrypt",
"tags": "authenticate,PEM,P12,official,encrypt,sign,certificate,PKCS12,JKS,server,manual,auto",
"title": "Certificate Signing",
"header": "Sign a PDF with your certificate (Work in progress)",
"selectPDF": "Select a PDF File for Signing:",
"jksNote": "Note: If your certificate type is not listed below, please convert it to a Java Keystore (.jks) file using the keytool command line tool. Then, choose the .jks file option below.",
"selectKey": "Select Your Private Key File (PKCS#8 format, could be .pem or .der):",
"selectCert": "Select Your Certificate File (X.509 format, could be .pem or .der):",
"selectP12": "Select Your PKCS#12 Keystore File (.p12 or .pfx) (Optional, If provided, it should contain your private key and certificate):",
"selectJKS": "Select Your Java Keystore File (.jks or .keystore):",
"certType": "Certificate Type",
"password": "Enter Your Keystore or Private Key Password (If Any):",
"showSig": "Show Signature",
"reason": "Reason",
"location": "Location",
"name": "Name",
"showLogo": "Show Logo",
"submit": "Sign PDF",
"files": {
"placeholder": "Select PDF files to sign with certificates"
},
"signMode": {
"stepTitle": "Sign Mode"
},
"certTypeStep": {
"stepTitle": "Certificate Format"
},
"certFiles": {
"stepTitle": "Certificate Files"
},
"appearance": {
"stepTitle": "Signature Appearance",
"title": "Signature Appearance",
"invisible": "Invisible",
"visible": "Visible",
"options": {
"title": "Signature Details"
}
},
"sign": {
"submit": "Sign PDF",
"results": "Signed PDF"
},
"error": {
"failed": "An error occurred whilst signing the PDF."
},
"choosePrivateKey": "Choose Private Key File",
"chooseCertificate": "Choose Certificate File",
"chooseP12File": "Choose PKCS12 File",
"choosePfxFile": "Choose PFX File",
"chooseJksFile": "Choose JKS File",
"passwordOptional": "Leave empty if no password",
"serverCertMessage": "Using server certificate - no files or password required",
"pageNumber": "Page Number",
"logoTitle": "Logo",
"noLogo": "No Logo"
},
"manageSignatures": {
"tags": "sign,certificate,PEM,PKCS12,JKS,server,manual,auto",
"title": "Manage Signatures",
"desc": "Sign PDFs with certificates using manual or server-managed keys",
"filenamePrefix": "signed",
"signMode": {
"stepTitle": "Sign Mode",
"tooltip": {
"header": {
"title": "About PDF Signatures"
@ -1866,6 +1808,72 @@
}
}
},
"certTypeStep": {
"stepTitle": "Certificate Format"
},
"certFiles": {
"stepTitle": "Certificate Files"
},
"appearance": {
"stepTitle": "Signature Appearance",
"tooltip": {
"header": {
"title": "About Signature Appearance"
},
"invisible": {
"title": "Invisible Signatures",
"text": "The signature is added to the PDF for security but won't be visible when viewing the document. Perfect for legal requirements without changing the document's appearance.",
"bullet1": "Provides security without visual changes",
"bullet2": "Meets legal requirements for digital signing",
"bullet3": "Doesn't affect document layout or design"
},
"visible": {
"title": "Visible Signatures",
"text": "Shows a signature block on the PDF with your name, date, and optional details. Useful when you want readers to clearly see the document is signed.",
"bullet1": "Shows signer name and date on the document",
"bullet2": "Can include reason and location for signing",
"bullet3": "Choose which page to place the signature",
"bullet4": "Optional logo can be included"
}
}
},
"sign": {
"submit": "Sign PDF",
"results": "Signed PDF"
},
"error": {
"failed": "An error occurred whilst processing signatures."
},
"tooltip": {
"header": {
"title": "About Managing Signatures"
},
"overview": {
"title": "What can this tool do?",
"text": "This tool lets you check if your PDFs are digitally signed and add new digital signatures. Digital signatures prove who created or approved a document and show if it has been changed since signing.",
"bullet1": "Check existing signatures and their validity",
"bullet2": "View detailed information about signers and certificates",
"bullet3": "Add new digital signatures to secure your documents",
"bullet4": "Multiple files supported with easy navigation"
},
"validation": {
"title": "Checking Signatures",
"text": "When you check signatures, the tool tells you if they're valid, who signed the document, when it was signed, and whether the document has been changed since signing.",
"bullet1": "Shows if signatures are valid or invalid",
"bullet2": "Displays signer information and signing date",
"bullet3": "Checks if the document was modified after signing",
"bullet4": "Can use custom certificates for verification"
},
"signing": {
"title": "Adding Signatures",
"text": "To sign a PDF, you need a digital certificate (like PEM, PKCS12, or JKS). You can choose to make the signature visible on the document or keep it invisible for security only.",
"bullet1": "Supports PEM, PKCS12, JKS, and server certificate formats",
"bullet2": "Option to show or hide signature on the PDF",
"bullet3": "Add reason, location, and signer name",
"bullet4": "Choose which page to place visible signatures",
"bullet5": "Use server certificate for simple 'Sign with Stirling-PDF' option"
}
},
"certType": {
"tooltip": {
"header": {
@ -1878,7 +1886,7 @@
"which": {
"title": "Which option should I use?",
"text": "Choose the format that matches your certificate file:",
"bullet1": "PKCS12 (.p12) one combined file (most common)",
"bullet1": "PKCS#12 (.p12 / .pfx) one combined file (most common)",
"bullet2": "PFX (.pfx) Microsoft's version of PKCS12",
"bullet3": "PEM separate private-key and certificate .pem files",
"bullet4": "JKS Java .jks keystore for dev / CI-CD workflows"
@ -2733,20 +2741,14 @@
"actualSize": "Actual Size"
},
"viewer": {
"noPdfLoaded": "No PDF loaded. Click to upload a PDF.",
"choosePdf": "Choose PDF",
"noPagesToDisplay": "No pages to display.",
"singlePageView": "Single Page View",
"dualPageView": "Dual Page View",
"hideSidebars": "Hide Sidebars",
"showSidebars": "Show Sidebars",
"zoomOut": "Zoom out",
"zoomIn": "Zoom in",
"firstPage": "First Page",
"lastPage": "Last Page",
"previousPage": "Previous Page",
"nextPage": "Next Page",
"pageNavigation": "Page Navigation",
"currentPage": "Current Page",
"totalPages": "Total Pages"
"zoomIn": "Zoom In",
"zoomOut": "Zoom Out",
"singlePageView": "Single Page View",
"dualPageView": "Dual Page View"
},
"rightRail": {
"closeSelected": "Close Selected Files",
@ -3130,156 +3132,5 @@
"processImages": "Process Images",
"processImagesDesc": "Converts multiple image files into a single PDF document, then applies OCR technology to extract searchable text from the images."
}
},
"manageSignatures": {
"title": "Sign with Certificate",
"filenamePrefix": "signed",
"files": {
"placeholder": "Select PDF files to sign with certificates"
},
"fileStatus": {
"stepTitle": "File Status"
},
"fileNavigation": "File {{current}} of {{total}}",
"hasSignatures": "Contains {{count}} signature(s)",
"noSignatures": "No signatures detected",
"signed": "Signed",
"certType": {
"stepTitle": "Certificate Type",
"tooltip": {
"header": {
"title": "About Certificate Types"
},
"what": {
"title": "What's a certificate?",
"text": "It's a secure ID for your signature that proves you signed. Unless you're required to sign via certificate, we recommend using another secure method like Type, Draw, or Upload."
},
"which": {
"title": "Which option should I use?",
"text": "Choose the format that matches your certificate file:",
"bullet1": "PKCS#12 (.p12 / .pfx) one combined file (most common)",
"bullet2": "PEM separate private-key and certificate .pem files",
"bullet3": "JKS Java .jks keystore for dev / CI-CD workflows"
},
"convert": {
"title": "Key not listed?",
"text": "Convert your file to a Java keystore (.jks) with keytool, then pick JKS."
}
}
},
"certFiles": {
"stepTitle": "Certificate Files"
},
"appearance": {
"stepTitle": "Signature Appearance",
"title": "Signature Appearance",
"invisible": "Invisible",
"visible": "Visible",
"options": {
"title": "Signature Details"
},
"tooltip": {
"header": {
"title": "About Signature Appearance"
},
"invisible": {
"title": "Invisible Signatures",
"text": "The signature is added to the PDF for security but won't be visible when viewing the document. Perfect for legal requirements without changing the document's appearance.",
"bullet1": "Provides security without visual changes",
"bullet2": "Meets legal requirements for digital signing",
"bullet3": "Doesn't affect document layout or design"
},
"visible": {
"title": "Visible Signatures",
"text": "Shows a signature block on the PDF with your name, date, and optional details. Useful when you want readers to clearly see the document is signed.",
"bullet1": "Shows signer name and date on the document",
"bullet2": "Can include reason and location for signing",
"bullet3": "Choose which page to place the signature",
"bullet4": "Optional logo can be included"
}
}
},
"mode": {
"title": "Action",
"validate": "Check for Signatures",
"viewEdit": "View/Edit Signatures",
"sign": "Add New Signature"
},
"validation": {
"title": "Validation Options",
"customCert": "Custom Certificate (Optional)",
"customCert.desc": "Upload a custom certificate for validation"
},
"signing": {
"title": "Certificate Settings",
"certType": "Certificate Type",
"choosePrivateKey": "Choose Private Key File",
"chooseCertificate": "Choose Certificate File",
"chooseP12File": "Choose PKCS12 File",
"chooseJksFile": "Choose JKS File",
"password": "Certificate Password",
"passwordOptional": "Leave empty if no password",
"showSignature": "Show visible signature on PDF",
"reason": "Reason for Signing",
"location": "Location",
"name": "Signer Name",
"pageNumber": "Page Number",
"logoTitle": "Logo",
"noLogo": "No Logo",
"showLogo": "Show Logo"
},
"validate": {
"submit": "Validate Signatures",
"results": "Signature Validation Results"
},
"sign": {
"submit": "Sign PDF",
"results": "Signed PDF"
},
"results": {
"title": "Signature Results"
},
"error": {
"failed": "An error occurred whilst processing signatures."
},
"tooltip": {
"header": {
"title": "About Managing Signatures"
},
"overview": {
"title": "What can this tool do?",
"text": "This tool lets you check if your PDFs are digitally signed and add new digital signatures. Digital signatures prove who created or approved a document and show if it has been changed since signing.",
"bullet1": "Check existing signatures and their validity",
"bullet2": "View detailed information about signers and certificates",
"bullet3": "Add new digital signatures to secure your documents",
"bullet4": "Multiple files supported with easy navigation"
},
"validation": {
"title": "Checking Signatures",
"text": "When you check signatures, the tool tells you if they're valid, who signed the document, when it was signed, and whether the document has been changed since signing.",
"bullet1": "Shows if signatures are valid or invalid",
"bullet2": "Displays signer information and signing date",
"bullet3": "Checks if the document was modified after signing",
"bullet4": "Can use custom certificates for verification"
},
"signing": {
"title": "Adding Signatures",
"text": "To sign a PDF, you need a digital certificate (like PEM, PKCS12, or JKS). You can choose to make the signature visible on the document or keep it invisible for security only.",
"bullet1": "Supports PEM, PKCS12, and JKS certificate formats",
"bullet2": "Option to show or hide signature on the PDF",
"bullet3": "Add reason, location, and signer name",
"bullet4": "Choose which page to place visible signatures"
}
}
},
"viewer": {
"firstPage": "First Page",
"lastPage": "Last Page",
"previousPage": "Previous Page",
"nextPage": "Next Page",
"zoomIn": "Zoom In",
"zoomOut": "Zoom Out",
"singlePageView": "Single Page View",
"dualPageView": "Dual Page View"
}
}

View File

@ -1,11 +1,11 @@
import { Stack, Text, TextInput } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { ManageSignaturesParameters } from "../../../hooks/tools/manageSignatures/useManageSignaturesParameters";
import { CertSignParameters } from "../../../hooks/tools/certSign/useCertSignParameters";
import FileUploadButton from "../../shared/FileUploadButton";
interface CertificateFilesSettingsProps {
parameters: ManageSignaturesParameters;
onParameterChange: (key: keyof ManageSignaturesParameters, value: any) => void;
parameters: CertSignParameters;
onParameterChange: (key: keyof CertSignParameters, value: any) => void;
disabled?: boolean;
}

View File

@ -1,9 +1,9 @@
import { Stack, Button } from "@mantine/core";
import { ManageSignaturesParameters } from "../../../hooks/tools/manageSignatures/useManageSignaturesParameters";
import { CertSignParameters } from "../../../hooks/tools/certSign/useCertSignParameters";
interface CertificateFormatSettingsProps {
parameters: ManageSignaturesParameters;
onParameterChange: (key: keyof ManageSignaturesParameters, value: any) => void;
parameters: CertSignParameters;
onParameterChange: (key: keyof CertSignParameters, value: any) => void;
disabled?: boolean;
}

View File

@ -1,10 +1,10 @@
import { Stack, Button } from "@mantine/core";
import { ManageSignaturesParameters } from "../../../hooks/tools/manageSignatures/useManageSignaturesParameters";
import { CertSignParameters } from "../../../hooks/tools/certSign/useCertSignParameters";
import { useAppConfig } from "../../../hooks/useAppConfig";
interface CertificateTypeSettingsProps {
parameters: ManageSignaturesParameters;
onParameterChange: (key: keyof ManageSignaturesParameters, value: any) => void;
parameters: CertSignParameters;
onParameterChange: (key: keyof CertSignParameters, value: any) => void;
disabled?: boolean;
}

View File

@ -1,10 +1,10 @@
import { Stack, Text, Button, TextInput, NumberInput } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { ManageSignaturesParameters } from "../../../hooks/tools/manageSignatures/useManageSignaturesParameters";
import { CertSignParameters } from "../../../hooks/tools/certSign/useCertSignParameters";
interface SignatureAppearanceSettingsProps {
parameters: ManageSignaturesParameters;
onParameterChange: (key: keyof ManageSignaturesParameters, value: any) => void;
parameters: CertSignParameters;
onParameterChange: (key: keyof CertSignParameters, value: any) => void;
disabled?: boolean;
}

View File

@ -0,0 +1,45 @@
import { useTranslation } from 'react-i18next';
import { TooltipContent } from '../../types/tips';
export const useCertSignTooltips = (): TooltipContent => {
const { t } = useTranslation();
return {
header: {
title: t("certSign.tooltip.header.title", "About Managing Signatures")
},
tips: [
{
title: t("certSign.tooltip.overview.title", "What can this tool do?"),
description: t("certSign.tooltip.overview.text", "This tool lets you check if your PDFs are digitally signed and add new digital signatures. Digital signatures prove who created or approved a document and show if it has been changed since signing."),
bullets: [
t("certSign.tooltip.overview.bullet1", "Check existing signatures and their validity"),
t("certSign.tooltip.overview.bullet2", "View detailed information about signers and certificates"),
t("certSign.tooltip.overview.bullet3", "Add new digital signatures to secure your documents"),
t("certSign.tooltip.overview.bullet4", "Multiple files supported with easy navigation")
]
},
{
title: t("certSign.tooltip.validation.title", "Checking Signatures"),
description: t("certSign.tooltip.validation.text", "When you check signatures, the tool tells you if they're valid, who signed the document, when it was signed, and whether the document has been changed since signing."),
bullets: [
t("certSign.tooltip.validation.bullet1", "Shows if signatures are valid or invalid"),
t("certSign.tooltip.validation.bullet2", "Displays signer information and signing date"),
t("certSign.tooltip.validation.bullet3", "Checks if the document was modified after signing"),
t("certSign.tooltip.validation.bullet4", "Can use custom certificates for verification")
]
},
{
title: t("certSign.tooltip.signing.title", "Adding Signatures"),
description: t("certSign.tooltip.signing.text", "To sign a PDF, you need a digital certificate (like PEM, PKCS12, or JKS). You can choose to make the signature visible on the document or keep it invisible for security only."),
bullets: [
t("certSign.tooltip.signing.bullet1", "Supports PEM, PKCS12, JKS, and server certificate formats"),
t("certSign.tooltip.signing.bullet2", "Option to show or hide signature on the PDF"),
t("certSign.tooltip.signing.bullet3", "Add reason, location, and signer name"),
t("certSign.tooltip.signing.bullet4", "Choose which page to place visible signatures"),
t("certSign.tooltip.signing.bullet5", "Use server certificate for simple 'Sign with Stirling-PDF' option")
]
}
]
};
};

View File

@ -6,26 +6,26 @@ export const useCertificateTypeTips = (): TooltipContent => {
return {
header: {
title: t("manageSignatures.certType.tooltip.header.title", "About Certificate Types")
title: t("certSign.certType.tooltip.header.title", "About Certificate Types")
},
tips: [
{
title: t("manageSignatures.certType.tooltip.what.title", "What's a certificate?"),
description: t("manageSignatures.certType.tooltip.what.text", "It's a secure ID for your signature that proves you signed. Unless you're required to sign via certificate, we recommend using another secure method like Type, Draw, or Upload.")
title: t("certSign.certType.tooltip.what.title", "What's a certificate?"),
description: t("certSign.certType.tooltip.what.text", "It's a secure ID for your signature that proves you signed. Unless you're required to sign via certificate, we recommend using another secure method like Type, Draw, or Upload.")
},
{
title: t("manageSignatures.certType.tooltip.which.title", "Which option should I use?"),
description: t("manageSignatures.certType.tooltip.which.text", "Choose the format that matches your certificate file:"),
title: t("certSign.certType.tooltip.which.title", "Which option should I use?"),
description: t("certSign.certType.tooltip.which.text", "Choose the format that matches your certificate file:"),
bullets: [
t("manageSignatures.certType.tooltip.which.bullet1", "PKCS12 (.p12) one combined file (most common)"),
t("manageSignatures.certType.tooltip.which.bullet2", "PFX (.pfx) Microsoft's version of PKCS12"),
t("manageSignatures.certType.tooltip.which.bullet3", "PEM separate private-key and certificate .pem files"),
t("manageSignatures.certType.tooltip.which.bullet4", "JKS Java .jks keystore for dev / CI-CD workflows")
t("certSign.certType.tooltip.which.bullet1", "PKCS12 (.p12) one combined file (most common)"),
t("certSign.certType.tooltip.which.bullet2", "PFX (.pfx) Microsoft's version of PKCS12"),
t("certSign.certType.tooltip.which.bullet3", "PEM separate private-key and certificate .pem files"),
t("certSign.certType.tooltip.which.bullet4", "JKS Java .jks keystore for dev / CI-CD workflows")
]
},
{
title: t("manageSignatures.certType.tooltip.convert.title", "Key not listed?"),
description: t("manageSignatures.certType.tooltip.convert.text", "Convert your file to a Java keystore (.jks) with keytool, then pick JKS.")
title: t("certSign.certType.tooltip.convert.title", "Key not listed?"),
description: t("certSign.certType.tooltip.convert.text", "Convert your file to a Java keystore (.jks) with keytool, then pick JKS.")
}
]
};

View File

@ -1,45 +0,0 @@
import { useTranslation } from 'react-i18next';
import { TooltipContent } from '../../types/tips';
export const useManageSignaturesTooltips = (): TooltipContent => {
const { t } = useTranslation();
return {
header: {
title: t("manageSignatures.tooltip.header.title", "About Managing Signatures")
},
tips: [
{
title: t("manageSignatures.tooltip.overview.title", "What can this tool do?"),
description: t("manageSignatures.tooltip.overview.text", "This tool lets you check if your PDFs are digitally signed and add new digital signatures. Digital signatures prove who created or approved a document and show if it has been changed since signing."),
bullets: [
t("manageSignatures.tooltip.overview.bullet1", "Check existing signatures and their validity"),
t("manageSignatures.tooltip.overview.bullet2", "View detailed information about signers and certificates"),
t("manageSignatures.tooltip.overview.bullet3", "Add new digital signatures to secure your documents"),
t("manageSignatures.tooltip.overview.bullet4", "Multiple files supported with easy navigation")
]
},
{
title: t("manageSignatures.tooltip.validation.title", "Checking Signatures"),
description: t("manageSignatures.tooltip.validation.text", "When you check signatures, the tool tells you if they're valid, who signed the document, when it was signed, and whether the document has been changed since signing."),
bullets: [
t("manageSignatures.tooltip.validation.bullet1", "Shows if signatures are valid or invalid"),
t("manageSignatures.tooltip.validation.bullet2", "Displays signer information and signing date"),
t("manageSignatures.tooltip.validation.bullet3", "Checks if the document was modified after signing"),
t("manageSignatures.tooltip.validation.bullet4", "Can use custom certificates for verification")
]
},
{
title: t("manageSignatures.tooltip.signing.title", "Adding Signatures"),
description: t("manageSignatures.tooltip.signing.text", "To sign a PDF, you need a digital certificate (like PEM, PKCS12, or JKS). You can choose to make the signature visible on the document or keep it invisible for security only."),
bullets: [
t("manageSignatures.tooltip.signing.bullet1", "Supports PEM, PKCS12, JKS, and server certificate formats"),
t("manageSignatures.tooltip.signing.bullet2", "Option to show or hide signature on the PDF"),
t("manageSignatures.tooltip.signing.bullet3", "Add reason, location, and signer name"),
t("manageSignatures.tooltip.signing.bullet4", "Choose which page to place visible signatures"),
t("manageSignatures.tooltip.signing.bullet5", "Use server certificate for simple 'Sign with Stirling-PDF' option")
]
}
]
};
};

View File

@ -6,30 +6,30 @@ export const useSignModeTips = (): TooltipContent => {
return {
header: {
title: t("manageSignatures.signMode.tooltip.header.title", "About PDF Signatures")
title: t("certSign.signMode.tooltip.header.title", "About PDF Signatures")
},
tips: [
{
title: t("manageSignatures.signMode.tooltip.overview.title", "How signatures work"),
description: t("manageSignatures.signMode.tooltip.overview.text", "Both modes seal the document (any edits are flagged as tampering) and record who/when/how for auditing. Viewer trust depends on the certificate chain.")
title: t("certSign.signMode.tooltip.overview.title", "How signatures work"),
description: t("certSign.signMode.tooltip.overview.text", "Both modes seal the document (any edits are flagged as tampering) and record who/when/how for auditing. Viewer trust depends on the certificate chain.")
},
{
title: t("manageSignatures.signMode.tooltip.manual.title", "Manual - Bring your certificate"),
description: t("manageSignatures.signMode.tooltip.manual.text", "Use your own certificate files for brand-aligned identity. Can display <b>Trusted</b> when your CA/chain is recognized."),
title: t("certSign.signMode.tooltip.manual.title", "Manual - Bring your certificate"),
description: t("certSign.signMode.tooltip.manual.text", "Use your own certificate files for brand-aligned identity. Can display <b>Trusted</b> when your CA/chain is recognized."),
bullets: [
t("manageSignatures.signMode.tooltip.manual.use", "Use for: customer-facing, legal, compliance.")
t("certSign.signMode.tooltip.manual.use", "Use for: customer-facing, legal, compliance.")
]
},
{
title: t("manageSignatures.signMode.tooltip.auto.title", "Auto - Zero-setup, instant system seal"),
description: t("manageSignatures.signMode.tooltip.auto.text", "Signs with a server <b>self-signed</b> certificate. Same <b>tamper-evident seal</b> and <b>audit trail</b>; typically shows <b>Unverified</b> in viewers."),
title: t("certSign.signMode.tooltip.auto.title", "Auto - Zero-setup, instant system seal"),
description: t("certSign.signMode.tooltip.auto.text", "Signs with a server <b>self-signed</b> certificate. Same <b>tamper-evident seal</b> and <b>audit trail</b>; typically shows <b>Unverified</b> in viewers."),
bullets: [
t("manageSignatures.signMode.tooltip.auto.use", "Use when: you need speed and consistent internal identity across reviews and records.")
t("certSign.signMode.tooltip.auto.use", "Use when: you need speed and consistent internal identity across reviews and records.")
]
},
{
title: t("manageSignatures.signMode.tooltip.rule.title", "Rule of thumb"),
description: t("manageSignatures.signMode.tooltip.rule.text", "Need recipient <b>Trusted</b> status? <b>Manual</b>. Need a fast, tamper-evident seal and audit trail with no setup? <b>Auto</b>.")
title: t("certSign.signMode.tooltip.rule.title", "Rule of thumb"),
description: t("certSign.signMode.tooltip.rule.text", "Need recipient <b>Trusted</b> status? <b>Manual</b>. Need a fast, tamper-evident seal and audit trail with no setup? <b>Auto</b>.")
}
]
};

View File

@ -6,26 +6,26 @@ export const useSignatureAppearanceTips = (): TooltipContent => {
return {
header: {
title: t("manageSignatures.appearance.tooltip.header.title", "About Signature Appearance")
title: t("certSign.appearance.tooltip.header.title", "About Signature Appearance")
},
tips: [
{
title: t("manageSignatures.appearance.tooltip.invisible.title", "Invisible Signatures"),
description: t("manageSignatures.appearance.tooltip.invisible.text", "The signature is added to the PDF for security but won't be visible when viewing the document. Perfect for legal requirements without changing the document's appearance."),
title: t("certSign.appearance.tooltip.invisible.title", "Invisible Signatures"),
description: t("certSign.appearance.tooltip.invisible.text", "The signature is added to the PDF for security but won't be visible when viewing the document. Perfect for legal requirements without changing the document's appearance."),
bullets: [
t("manageSignatures.appearance.tooltip.invisible.bullet1", "Provides security without visual changes"),
t("manageSignatures.appearance.tooltip.invisible.bullet2", "Meets legal requirements for digital signing"),
t("manageSignatures.appearance.tooltip.invisible.bullet3", "Doesn't affect document layout or design")
t("certSign.appearance.tooltip.invisible.bullet1", "Provides security without visual changes"),
t("certSign.appearance.tooltip.invisible.bullet2", "Meets legal requirements for digital signing"),
t("certSign.appearance.tooltip.invisible.bullet3", "Doesn't affect document layout or design")
]
},
{
title: t("manageSignatures.appearance.tooltip.visible.title", "Visible Signatures"),
description: t("manageSignatures.appearance.tooltip.visible.text", "Shows a signature block on the PDF with your name, date, and optional details. Useful when you want readers to clearly see the document is signed."),
title: t("certSign.appearance.tooltip.visible.title", "Visible Signatures"),
description: t("certSign.appearance.tooltip.visible.text", "Shows a signature block on the PDF with your name, date, and optional details. Useful when you want readers to clearly see the document is signed."),
bullets: [
t("manageSignatures.appearance.tooltip.visible.bullet1", "Shows signer name and date on the document"),
t("manageSignatures.appearance.tooltip.visible.bullet2", "Can include reason and location for signing"),
t("manageSignatures.appearance.tooltip.visible.bullet3", "Choose which page to place the signature"),
t("manageSignatures.appearance.tooltip.visible.bullet4", "Optional logo can be included")
t("certSign.appearance.tooltip.visible.bullet1", "Shows signer name and date on the document"),
t("certSign.appearance.tooltip.visible.bullet2", "Can include reason and location for signing"),
t("certSign.appearance.tooltip.visible.bullet3", "Choose which page to place the signature"),
t("certSign.appearance.tooltip.visible.bullet4", "Optional logo can be included")
]
}
]

View File

@ -19,7 +19,7 @@ import AutoRename from "../tools/AutoRename";
import SingleLargePage from "../tools/SingleLargePage";
import UnlockPdfForms from "../tools/UnlockPdfForms";
import RemoveCertificateSign from "../tools/RemoveCertificateSign";
import ManageSignatures from "../tools/ManageSignatures";
import CertSign from "../tools/CertSign";
import BookletImposition from "../tools/BookletImposition";
import Flatten from "../tools/Flatten";
import Rotate from "../tools/Rotate";
@ -37,7 +37,7 @@ import { ocrOperationConfig } from "../hooks/tools/ocr/useOCROperation";
import { convertOperationConfig } from "../hooks/tools/convert/useConvertOperation";
import { removeCertificateSignOperationConfig } from "../hooks/tools/removeCertificateSign/useRemoveCertificateSignOperation";
import { changePermissionsOperationConfig } from "../hooks/tools/changePermissions/useChangePermissionsOperation";
import { manageSignaturesOperationConfig } from "../hooks/tools/manageSignatures/useManageSignaturesOperation";
import { certSignOperationConfig } from "../hooks/tools/certSign/useCertSignOperation";
import { bookletImpositionOperationConfig } from "../hooks/tools/bookletImposition/useBookletImpositionOperation";
import { mergeOperationConfig } from '../hooks/tools/merge/useMergeOperation';
import { autoRenameOperationConfig } from "../hooks/tools/autoRename/useAutoRenameOperation";
@ -56,7 +56,7 @@ import AddWatermarkSingleStepSettings from "../components/tools/addWatermark/Add
import OCRSettings from "../components/tools/ocr/OCRSettings";
import ConvertSettings from "../components/tools/convert/ConvertSettings";
import ChangePermissionsSettings from "../components/tools/changePermissions/ChangePermissionsSettings";
import CertificateTypeSettings from "../components/tools/manageSignatures/CertificateTypeSettings";
import CertificateTypeSettings from "../components/tools/certSign/CertificateTypeSettings";
import BookletImpositionSettings from "../components/tools/bookletImposition/BookletImpositionSettings";
import FlattenSettings from "../components/tools/flatten/FlattenSettings";
import RedactSingleStepSettings from "../components/tools/redact/RedactSingleStepSettings";
@ -160,16 +160,16 @@ export function useFlatToolRegistry(): ToolRegistry {
const allTools: ToolRegistry = {
// Signing
manageSignatures: {
certSign: {
icon: <LocalIcon icon="workspace-premium-rounded" width="1.5rem" height="1.5rem" />,
name: t("home.certSign.title", "Certificate Sign"),
component: ManageSignatures,
component: CertSign,
description: t("home.certSign.desc", "Sign PDF documents using digital certificates"),
categoryId: ToolCategoryId.STANDARD_TOOLS,
subcategoryId: SubcategoryId.SIGNING,
maxFiles: -1,
endpoints: ["cert-sign"],
operationConfig: manageSignaturesOperationConfig,
operationConfig: certSignOperationConfig,
settingsComponent: CertificateTypeSettings,
},
sign: {

View File

@ -1,10 +1,10 @@
import { useTranslation } from 'react-i18next';
import { ToolType, useToolOperation } from '../shared/useToolOperation';
import { createStandardErrorHandler } from '../../../utils/toolErrorHandler';
import { ManageSignaturesParameters, defaultParameters } from './useManageSignaturesParameters';
import { CertSignParameters, defaultParameters } from './useCertSignParameters';
// Build form data for signing
export const buildManageSignaturesFormData = (parameters: ManageSignaturesParameters, file: File): FormData => {
export const buildCertSignFormData = (parameters: CertSignParameters, file: File): FormData => {
const formData = new FormData();
formData.append('fileInput', file);
@ -52,20 +52,20 @@ export const buildManageSignaturesFormData = (parameters: ManageSignaturesParame
};
// Static configuration object
export const manageSignaturesOperationConfig = {
export const certSignOperationConfig = {
toolType: ToolType.singleFile,
buildFormData: buildManageSignaturesFormData,
operationType: 'manageSignatures',
buildFormData: buildCertSignFormData,
operationType: 'certSign',
endpoint: '/api/v1/security/cert-sign',
multiFileEndpoint: false,
defaultParameters,
} as const;
export const useManageSignaturesOperation = () => {
export const useCertSignOperation = () => {
const { t } = useTranslation();
return useToolOperation<ManageSignaturesParameters>({
...manageSignaturesOperationConfig,
getErrorMessage: createStandardErrorHandler(t('manageSignatures.error.failed', 'An error occurred while processing signatures.'))
return useToolOperation<CertSignParameters>({
...certSignOperationConfig,
getErrorMessage: createStandardErrorHandler(t('certSign.error.failed', 'An error occurred while processing signatures.'))
});
};

View File

@ -1,7 +1,7 @@
import { BaseParameters } from '../../../types/parameters';
import { useBaseParameters, BaseParametersHook } from '../shared/useBaseParameters';
export interface ManageSignaturesParameters extends BaseParameters {
export interface CertSignParameters extends BaseParameters {
// Sign mode selection
signMode: 'MANUAL' | 'AUTO';
// Certificate signing options (only for manual mode)
@ -21,7 +21,7 @@ export interface ManageSignaturesParameters extends BaseParameters {
showLogo: boolean;
}
export const defaultParameters: ManageSignaturesParameters = {
export const defaultParameters: CertSignParameters = {
signMode: 'MANUAL',
certType: '',
password: '',
@ -33,12 +33,12 @@ export const defaultParameters: ManageSignaturesParameters = {
showLogo: true,
};
export type ManageSignaturesParametersHook = BaseParametersHook<ManageSignaturesParameters>;
export type CertSignParametersHook = BaseParametersHook<CertSignParameters>;
export const useManageSignaturesParameters = (): ManageSignaturesParametersHook => {
export const useCertSignParameters = (): CertSignParametersHook => {
return useBaseParameters({
defaultParameters,
endpointName: 'manage-signatures',
endpointName: 'cert-sign',
validateFn: (params) => {
// Auto mode (server certificate) - no additional validation needed
if (params.signMode === 'AUTO') {

View File

@ -1,24 +1,24 @@
import { useTranslation } from "react-i18next";
import { createToolFlow } from "../components/tools/shared/createToolFlow";
import CertificateTypeSettings from "../components/tools/manageSignatures/CertificateTypeSettings";
import CertificateFormatSettings from "../components/tools/manageSignatures/CertificateFormatSettings";
import CertificateFilesSettings from "../components/tools/manageSignatures/CertificateFilesSettings";
import SignatureAppearanceSettings from "../components/tools/manageSignatures/SignatureAppearanceSettings";
import { useManageSignaturesParameters } from "../hooks/tools/manageSignatures/useManageSignaturesParameters";
import { useManageSignaturesOperation } from "../hooks/tools/manageSignatures/useManageSignaturesOperation";
import CertificateTypeSettings from "../components/tools/certSign/CertificateTypeSettings";
import CertificateFormatSettings from "../components/tools/certSign/CertificateFormatSettings";
import CertificateFilesSettings from "../components/tools/certSign/CertificateFilesSettings";
import SignatureAppearanceSettings from "../components/tools/certSign/SignatureAppearanceSettings";
import { useCertSignParameters } from "../hooks/tools/certSign/useCertSignParameters";
import { useCertSignOperation } from "../hooks/tools/certSign/useCertSignOperation";
import { useCertificateTypeTips } from "../components/tooltips/useCertificateTypeTips";
import { useSignatureAppearanceTips } from "../components/tooltips/useSignatureAppearanceTips";
import { useSignModeTips } from "../components/tooltips/useSignModeTips";
import { useBaseTool } from "../hooks/tools/shared/useBaseTool";
import { BaseToolProps, ToolComponent } from "../types/tool";
const ManageSignatures = (props: BaseToolProps) => {
const CertSign = (props: BaseToolProps) => {
const { t } = useTranslation();
const base = useBaseTool(
'manageSignatures',
useManageSignaturesParameters,
useManageSignaturesOperation,
'certSign',
useCertSignParameters,
useCertSignOperation,
props
);
@ -126,6 +126,6 @@ const ManageSignatures = (props: BaseToolProps) => {
};
// Static method to get the operation hook for automation
ManageSignatures.tool = () => useManageSignaturesOperation;
CertSign.tool = () => useCertSignOperation;
export default ManageSignatures as ToolComponent;
export default CertSign as ToolComponent;

View File

@ -56,7 +56,6 @@ const TOOL_IDS = [
'devSsoGuide',
'devAirgapped',
'bookletImposition',
'manageSignatures',
] as const;
// Tool identity - what PDF operation we're performing (type-safe)

View File

@ -31,7 +31,7 @@ export const URL_TO_TOOL_MAP: Record<string, ToolId> = {
'/unlock-pdf-forms': 'unlockPDFForms',
'/remove-certificate-sign': 'removeCertSign',
'/remove-cert-sign': 'removeCertSign',
'/cert-sign': 'manageSignatures',
'/manage-signatures': 'manageSignatures',
'/cert-sign': 'certSign',
'/manage-signatures': 'certSign',
'/booklet-imposition': 'bookletImposition',
};