diff --git a/frontend/src/components/tools/convert/ConvertSettings.tsx b/frontend/src/components/tools/convert/ConvertSettings.tsx index 355ce042f..2d030a03f 100644 --- a/frontend/src/components/tools/convert/ConvertSettings.tsx +++ b/frontend/src/components/tools/convert/ConvertSettings.tsx @@ -12,6 +12,7 @@ import ConvertToImageSettings from "./ConvertToImageSettings"; import ConvertFromImageSettings from "./ConvertFromImageSettings"; import ConvertFromWebSettings from "./ConvertFromWebSettings"; import ConvertFromEmailSettings from "./ConvertFromEmailSettings"; +import ConvertToPdfaSettings from "./ConvertToPdfaSettings"; import { ConvertParameters } from "../../../hooks/tools/convert/useConvertParameters"; import { FROM_FORMAT_OPTIONS, @@ -114,6 +115,9 @@ const ConvertSettings = ({ downloadHtml: false, includeAllRecipients: false, }); + onParameterChange('pdfaOptions', { + outputFormat: 'pdfa-1', + }); // Disable smart detection when manually changing source format onParameterChange('isSmartDetection', false); onParameterChange('smartDetectionType', 'none'); @@ -161,6 +165,9 @@ const ConvertSettings = ({ downloadHtml: false, includeAllRecipients: false, }); + onParameterChange('pdfaOptions', { + outputFormat: 'pdfa-1', + }); }; @@ -274,6 +281,19 @@ const ConvertSettings = ({ )} + {/* PDF to PDF/A options */} + {parameters.fromExtension === 'pdf' && parameters.toExtension === 'pdfa' && ( + <> + + + + )} + ); }; diff --git a/frontend/src/components/tools/convert/ConvertToPdfaSettings.tsx b/frontend/src/components/tools/convert/ConvertToPdfaSettings.tsx new file mode 100644 index 000000000..0422ee780 --- /dev/null +++ b/frontend/src/components/tools/convert/ConvertToPdfaSettings.tsx @@ -0,0 +1,60 @@ +import React from 'react'; +import { Stack, Text, Select, Alert } from '@mantine/core'; +import { useTranslation } from 'react-i18next'; +import { ConvertParameters } from '../../../hooks/tools/convert/useConvertParameters'; +import { usePdfSignatureDetection } from '../../../hooks/usePdfSignatureDetection'; + +interface ConvertToPdfaSettingsProps { + parameters: ConvertParameters; + onParameterChange: (key: keyof ConvertParameters, value: any) => void; + selectedFiles: File[]; + disabled?: boolean; +} + +const ConvertToPdfaSettings = ({ + parameters, + onParameterChange, + selectedFiles, + disabled = false +}: ConvertToPdfaSettingsProps) => { + const { t } = useTranslation(); + const { hasDigitalSignatures, isChecking } = usePdfSignatureDetection(selectedFiles); + + const pdfaFormatOptions = [ + { value: 'pdfa-1', label: 'PDF/A-1b' }, + { value: 'pdfa', label: 'PDF/A-2b' } + ]; + + return ( + + {t("convert.pdfaOptions", "PDF/A Options")}: + + {hasDigitalSignatures && ( + + + {t("convert.pdfaDigitalSignatureWarning", "The PDF contains a digital signature. This will be removed in the next step.")} + + + )} + + + {t("convert.outputFormat", "Output Format")}: +