mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-19 01:49:24 +00:00
add stamp margin dropdown and remove the prefix
This commit is contained in:
parent
bcba83ab43
commit
ad14e727f6
@ -7,7 +7,7 @@ export const buildAddStampFormData = (parameters: AddStampParameters, file: File
|
||||
const formData = new FormData();
|
||||
formData.append('fileInput', file);
|
||||
formData.append('pageNumbers', parameters.pageNumbers);
|
||||
formData.append('customMargin', 'medium');
|
||||
formData.append('customMargin', parameters.customMargin || 'medium');
|
||||
formData.append('position', String(parameters.position));
|
||||
const effectiveFontSize = parameters.fontSize;
|
||||
formData.append('fontSize', String(effectiveFontSize));
|
||||
@ -34,7 +34,6 @@ export const addStampOperationConfig = {
|
||||
buildFormData: buildAddStampFormData,
|
||||
operationType: 'stamp',
|
||||
endpoint: '/api/v1/misc/add-stamp',
|
||||
filePrefix: 'stamped_',
|
||||
defaultParameters,
|
||||
} as const;
|
||||
|
||||
@ -43,7 +42,6 @@ export const useAddStampOperation = () => {
|
||||
|
||||
return useToolOperation<AddStampParameters>({
|
||||
...addStampOperationConfig,
|
||||
filePrefix: t('stamp.filenamePrefix', 'stamped') + '_',
|
||||
getErrorMessage: createStandardErrorHandler(
|
||||
t('AddStampRequest.error.failed', 'An error occurred while adding stamp to the PDF.')
|
||||
),
|
||||
|
@ -323,6 +323,23 @@ const AddStamp = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
|
||||
)}
|
||||
|
||||
|
||||
{/* Margin selection appears when using quick grid (and for text stamps) */}
|
||||
{(params.parameters.stampType === 'text' || (params.parameters.stampType === 'image' && quickPositionModeSelected)) && (
|
||||
<Select
|
||||
label={t('AddStampRequest.margin', 'Margin')}
|
||||
value={params.parameters.customMargin}
|
||||
onChange={(v) => params.updateParameter('customMargin', (v as any) || 'medium')}
|
||||
data={[
|
||||
{ value: 'small', label: t('margin.small', 'Small') },
|
||||
{ value: 'medium', label: t('margin.medium', 'Medium') },
|
||||
{ value: 'large', label: t('margin.large', 'Large') },
|
||||
{ value: 'x-large', label: t('margin.xLarge', 'Extra Large') },
|
||||
]}
|
||||
disabled={endpointLoading}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
{/* Unified preview; when in quick mode, overlay grid inside preview */}
|
||||
<StampPreview
|
||||
parameters={params.parameters}
|
||||
|
Loading…
x
Reference in New Issue
Block a user