mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-12-30 20:06:30 +01:00
15 KiB
15 KiB
Frontend tool dependency overview
This document summarises how each Stirling PDF frontend tool currently executes its work, identifying whether the implementation already runs entirely in the browser or relies on backend REST APIs.
Key observations
- With the exception of a handful of tools, the React hooks delegate processing to
useToolOperation, which ultimately posts the selected files to backend endpoints viaapiClient.post.【F:frontend/src/hooks/tools/shared/useToolOperation.ts†L213-L267】【F:frontend/src/hooks/tools/shared/useToolApiCalls.ts†L19-L103】 - Automation flows rely on the same backend-driven operations through the shared executor, which performs direct Axios POST requests and ZIP handling.【F:frontend/src/utils/automationExecutor.ts†L52-L127】
- Adjust Contrast and Remove Annotations remain pure client-side processors today, and Rotate now offers an optional browser-based mode powered by
pdf-lib, while Swagger UI is a static documentation viewer. All other PDF manipulations depend on backend services.
Tool matrix
| Tool | Operation Hook(s) | Endpoint(s) | Frontend-only viability |
|---|---|---|---|
| AddAttachments | AddAttachments: frontend/src/hooks/tools/addAttachments/useAddAttachmentsOperation.ts【F:frontend/src/hooks/tools/addAttachments/useAddAttachmentsOperation.ts†L2-L33】 | AddAttachments: /api/v1/misc/add-attachments【F:frontend/src/hooks/tools/addAttachments/useAddAttachmentsOperation.ts†L2-L33】 | Requires backend API for PDF processing |
| AddPageNumbers | AddPageNumbers: frontend/src/components/tools/addPageNumbers/useAddPageNumbersOperation.ts【F:frontend/src/components/tools/addPageNumbers/useAddPageNumbersOperation.ts†L2-L31】 | AddPageNumbers: /api/v1/misc/add-page-numbers【F:frontend/src/components/tools/addPageNumbers/useAddPageNumbersOperation.ts†L2-L31】 | Requires backend API for PDF processing |
| AddPassword | AddPassword: frontend/src/hooks/tools/addPassword/useAddPasswordOperation.ts【F:frontend/src/hooks/tools/addPassword/useAddPasswordOperation.ts†L2-L39】 | AddPassword: /api/v1/security/add-password【F:frontend/src/hooks/tools/addPassword/useAddPasswordOperation.ts†L2-L39】 | Requires backend API for PDF processing |
| AddStamp | AddStamp: frontend/src/components/tools/addStamp/useAddStampOperation.ts【F:frontend/src/components/tools/addStamp/useAddStampOperation.ts†L2-L65】 | AddStamp: /api/v1/misc/add-stamp【F:frontend/src/components/tools/addStamp/useAddStampOperation.ts†L2-L65】 | Toggle between backend processing and new browser stamping pipeline using pdf-lib【F:frontend/src/components/tools/addStamp/useAddStampOperation.ts†L2-L65】【F:frontend/src/utils/pdfOperations/addStamp.ts†L1-L120】 |
| AddWatermark | AddWatermark: frontend/src/hooks/tools/addWatermark/useAddWatermarkOperation.ts【F:frontend/src/hooks/tools/addWatermark/useAddWatermarkOperation.ts†L2-L65】 | AddWatermark: /api/v1/security/add-watermark【F:frontend/src/hooks/tools/addWatermark/useAddWatermarkOperation.ts†L2-L65】 | Toggle between backend processing and new browser watermarking pipeline using pdf-lib【F:frontend/src/hooks/tools/addWatermark/useAddWatermarkOperation.ts†L2-L65】【F:frontend/src/utils/pdfOperations/addWatermark.ts†L1-L99】 |
| AdjustContrast | AdjustContrast: frontend/src/hooks/tools/adjustContrast/useAdjustContrastOperation.ts【F:frontend/src/hooks/tools/adjustContrast/useAdjustContrastOperation.ts†L2-L89】 | — | Already frontend-only (client-side implementation) |
| AdjustPageScale | AdjustPageScale: frontend/src/hooks/tools/adjustPageScale/useAdjustPageScaleOperation.ts【F:frontend/src/hooks/tools/adjustPageScale/useAdjustPageScaleOperation.ts†L2-L25】 | AdjustPageScale: /api/v1/general/scale-pages【F:frontend/src/hooks/tools/adjustPageScale/useAdjustPageScaleOperation.ts†L2-L25】 | Requires backend API for PDF processing |
| AutoRename | AutoRename: frontend/src/hooks/tools/autoRename/useAutoRenameOperation.ts【F:frontend/src/hooks/tools/autoRename/useAutoRenameOperation.ts†L2-L38】 | AutoRename: /api/v1/misc/auto-rename【F:frontend/src/hooks/tools/autoRename/useAutoRenameOperation.ts†L2-L38】 | Requires backend API for PDF processing |
| Automate | Automate: frontend/src/hooks/tools/automate/useAutomateOperation.ts【F:frontend/src/hooks/tools/automate/useAutomateOperation.ts†L1-L45】 | — | Requires backend API for PDF processing |
| BookletImposition | BookletImposition: frontend/src/hooks/tools/bookletImposition/useBookletImpositionOperation.ts【F:frontend/src/hooks/tools/bookletImposition/useBookletImpositionOperation.ts†L2-L33】 | BookletImposition: /api/v1/general/booklet-imposition【F:frontend/src/hooks/tools/bookletImposition/useBookletImpositionOperation.ts†L2-L33】 | Requires backend API for PDF processing |
| CertSign | CertSign: frontend/src/hooks/tools/certSign/useCertSignOperation.ts【F:frontend/src/hooks/tools/certSign/useCertSignOperation.ts†L2-L67】 | CertSign: /api/v1/security/cert-sign【F:frontend/src/hooks/tools/certSign/useCertSignOperation.ts†L2-L67】 | Requires backend API for PDF processing |
| ChangeMetadata | ChangeMetadata: frontend/src/hooks/tools/changeMetadata/useChangeMetadataOperation.ts【F:frontend/src/hooks/tools/changeMetadata/useChangeMetadataOperation.ts†L2-L66】 | ChangeMetadata: /api/v1/misc/update-metadata【F:frontend/src/hooks/tools/changeMetadata/useChangeMetadataOperation.ts†L2-L66】 | Requires backend API for PDF processing |
| ChangePermissions | ChangePermissions: frontend/src/hooks/tools/changePermissions/useChangePermissionsOperation.ts【F:frontend/src/hooks/tools/changePermissions/useChangePermissionsOperation.ts†L2-L37】 | ChangePermissions: /api/v1/security/add-password【F:frontend/src/hooks/tools/changePermissions/useChangePermissionsOperation.ts†L2-L37】 | Requires backend API for PDF processing |
| Compress | Compress: frontend/src/hooks/tools/compress/useCompressOperation.ts【F:frontend/src/hooks/tools/compress/useCompressOperation.ts†L2-L37】 | Compress: /api/v1/misc/compress-pdf【F:frontend/src/hooks/tools/compress/useCompressOperation.ts†L2-L37】 | Requires backend API for PDF processing |
| Convert | Convert: frontend/src/hooks/tools/convert/useConvertOperation.ts【F:frontend/src/hooks/tools/convert/useConvertOperation.ts†L6-L156】 | — | Requires backend API for PDF processing |
| Crop | Crop: frontend/src/hooks/tools/crop/useCropOperation.ts【F:frontend/src/hooks/tools/crop/useCropOperation.ts†L2-L45】 | Crop: /api/v1/general/crop【F:frontend/src/hooks/tools/crop/useCropOperation.ts†L2-L45】 | Toggle between backend processing and new browser cropping pipeline using pdf-lib【F:frontend/src/hooks/tools/crop/useCropOperation.ts†L2-L45】【F:frontend/src/utils/pdfOperations/crop.ts†L1-L33】 |
| ExtractImages | ExtractImages: frontend/src/hooks/tools/extractImages/useExtractImagesOperation.ts【F:frontend/src/hooks/tools/extractImages/useExtractImagesOperation.ts†L3-L36】 | ExtractImages: /api/v1/misc/extract-images【F:frontend/src/hooks/tools/extractImages/useExtractImagesOperation.ts†L3-L36】 | Requires backend API for PDF processing |
| Flatten | Flatten: frontend/src/hooks/tools/flatten/useFlattenOperation.ts【F:frontend/src/hooks/tools/flatten/useFlattenOperation.ts†L2-L27】 | Flatten: /api/v1/misc/flatten【F:frontend/src/hooks/tools/flatten/useFlattenOperation.ts†L2-L27】 | Requires backend API for PDF processing |
| Merge | Merge: frontend/src/hooks/tools/merge/useMergeOperation.ts【F:frontend/src/hooks/tools/merge/useMergeOperation.ts†L2-L34】 | Merge: /api/v1/general/merge-pdfs【F:frontend/src/hooks/tools/merge/useMergeOperation.ts†L2-L34】 | Requires backend API for PDF processing |
| OCR | OCR: frontend/src/hooks/tools/ocr/useOCROperation.ts【F:frontend/src/hooks/tools/ocr/useOCROperation.ts†L4-L124】 | OCR: /api/v1/misc/ocr-pdf【F:frontend/src/hooks/tools/ocr/useOCROperation.ts†L4-L124】 | Requires backend API for PDF processing |
| OverlayPdfs | OverlayPdfs: frontend/src/hooks/tools/overlayPdfs/useOverlayPdfsOperation.ts【F:frontend/src/hooks/tools/overlayPdfs/useOverlayPdfsOperation.ts†L2-L38】 | OverlayPdfs: /api/v1/general/overlay-pdfs【F:frontend/src/hooks/tools/overlayPdfs/useOverlayPdfsOperation.ts†L2-L38】 | Requires backend API for PDF processing |
| PageLayout | PageLayout: frontend/src/hooks/tools/pageLayout/usePageLayoutOperation.ts【F:frontend/src/hooks/tools/pageLayout/usePageLayoutOperation.ts†L2-L25】 | PageLayout: /api/v1/general/multi-page-layout【F:frontend/src/hooks/tools/pageLayout/usePageLayoutOperation.ts†L2-L25】 | Requires backend API for PDF processing |
| Redact | Redact: frontend/src/hooks/tools/redact/useRedactOperation.ts【F:frontend/src/hooks/tools/redact/useRedactOperation.ts†L2-L46】 | Redact: /api/v1/security/auto-redact【F:frontend/src/hooks/tools/redact/useRedactOperation.ts†L2-L46】 | Requires backend API for PDF processing |
| RemoveAnnotations | RemoveAnnotations: frontend/src/hooks/tools/removeAnnotations/useRemoveAnnotationsOperation.ts【F:frontend/src/hooks/tools/removeAnnotations/useRemoveAnnotationsOperation.ts†L2-L92】 | — | Already frontend-only (client-side implementation) |
| RemoveBlanks | RemoveBlanks: frontend/src/hooks/tools/removeBlanks/useRemoveBlanksOperation.ts【F:frontend/src/hooks/tools/removeBlanks/useRemoveBlanksOperation.ts†L3-L34】 | RemoveBlanks: /api/v1/misc/remove-blanks【F:frontend/src/hooks/tools/removeBlanks/useRemoveBlanksOperation.ts†L3-L34】 | Requires backend API for PDF processing |
| RemoveCertificateSign | RemoveCertificateSign: frontend/src/hooks/tools/removeCertificateSign/useRemoveCertificateSignOperation.ts【F:frontend/src/hooks/tools/removeCertificateSign/useRemoveCertificateSignOperation.ts†L2-L25】 | RemoveCertificateSign: /api/v1/security/remove-cert-sign【F:frontend/src/hooks/tools/removeCertificateSign/useRemoveCertificateSignOperation.ts†L2-L25】 | Requires backend API for PDF processing |
| RemoveImage | RemoveImage: frontend/src/hooks/tools/removeImage/useRemoveImageOperation.ts【F:frontend/src/hooks/tools/removeImage/useRemoveImageOperation.ts†L2-L22】 | RemoveImage: /api/v1/general/remove-image-pdf【F:frontend/src/hooks/tools/removeImage/useRemoveImageOperation.ts†L2-L22】 | Requires backend API for PDF processing |
| RemovePages | RemovePages: frontend/src/hooks/tools/removePages/useRemovePagesOperation.ts【F:frontend/src/hooks/tools/removePages/useRemovePagesOperation.ts†L2-L47】 | RemovePages: /api/v1/general/remove-pages【F:frontend/src/hooks/tools/removePages/useRemovePagesOperation.ts†L2-L47】 | Toggle between backend processing and new browser page removal pipeline using pdf-lib【F:frontend/src/hooks/tools/removePages/useRemovePagesOperation.ts†L2-L47】【F:frontend/src/utils/pdfOperations/removePages.ts†L1-L27】 |
| RemovePassword | RemovePassword: frontend/src/hooks/tools/removePassword/useRemovePasswordOperation.ts【F:frontend/src/hooks/tools/removePassword/useRemovePasswordOperation.ts†L2-L26】 | RemovePassword: /api/v1/security/remove-password【F:frontend/src/hooks/tools/removePassword/useRemovePasswordOperation.ts†L2-L26】 | Requires backend API for PDF processing |
| ReorganizePages | ReorganizePages: frontend/src/hooks/tools/reorganizePages/useReorganizePagesOperation.ts【F:frontend/src/hooks/tools/reorganizePages/useReorganizePagesOperation.ts†L2-L28】 | ReorganizePages: /api/v1/general/rearrange-pages【F:frontend/src/hooks/tools/reorganizePages/useReorganizePagesOperation.ts†L2-L28】 | Requires backend API for PDF processing |
| Repair | Repair: frontend/src/hooks/tools/repair/useRepairOperation.ts【F:frontend/src/hooks/tools/repair/useRepairOperation.ts†L2-L25】 | Repair: /api/v1/misc/repair【F:frontend/src/hooks/tools/repair/useRepairOperation.ts†L2-L25】 | Requires backend API for PDF processing |
| ReplaceColor | ReplaceColor: frontend/src/hooks/tools/replaceColor/useReplaceColorOperation.ts【F:frontend/src/hooks/tools/replaceColor/useReplaceColorOperation.ts†L2-L34】 | ReplaceColor: /api/v1/misc/replace-invert-pdf【F:frontend/src/hooks/tools/replaceColor/useReplaceColorOperation.ts†L2-L34】 | Requires backend API for PDF processing |
| Rotate | Rotate: frontend/src/hooks/tools/rotate/useRotateOperation.ts【F:frontend/src/hooks/tools/rotate/useRotateOperation.ts†L1-L35】 | Rotate: /api/v1/general/rotate-pdf【F:frontend/src/hooks/tools/rotate/useRotateOperation.ts†L18-L25】 | Toggle between backend processing and new frontend pdf-lib implementation【F:frontend/src/utils/pdfOperations/rotate.ts†L1-L38】【F:frontend/src/components/tools/rotate/RotateSettings.tsx†L1-L121】 |
| Sanitize | Sanitize: frontend/src/hooks/tools/sanitize/useSanitizeOperation.ts【F:frontend/src/hooks/tools/sanitize/useSanitizeOperation.ts†L2-L35】 | Sanitize: /api/v1/security/sanitize-pdf【F:frontend/src/hooks/tools/sanitize/useSanitizeOperation.ts†L2-L35】 | Requires backend API for PDF processing |
| ScannerImageSplit | ScannerImageSplit: frontend/src/hooks/tools/scannerImageSplit/useScannerImageSplitOperation.ts【F:frontend/src/hooks/tools/scannerImageSplit/useScannerImageSplitOperation.ts†L3-L60】 | ScannerImageSplit: /api/v1/misc/extract-image-scans【F:frontend/src/hooks/tools/scannerImageSplit/useScannerImageSplitOperation.ts†L3-L60】 | Requires backend API for PDF processing |
| Sign | Sign: frontend/src/hooks/tools/sign/useSignOperation.ts【F:frontend/src/hooks/tools/sign/useSignOperation.ts†L2-L55】 | Sign: /api/v1/security/add-signature【F:frontend/src/hooks/tools/sign/useSignOperation.ts†L2-L55】 | Requires backend API for PDF processing |
| SingleLargePage | SingleLargePage: frontend/src/hooks/tools/singleLargePage/useSingleLargePageOperation.ts【F:frontend/src/hooks/tools/singleLargePage/useSingleLargePageOperation.ts†L2-L25】 | SingleLargePage: /api/v1/general/pdf-to-single-page【F:frontend/src/hooks/tools/singleLargePage/useSingleLargePageOperation.ts†L2-L25】 | Requires backend API for PDF processing |
| Split | Split: frontend/src/hooks/tools/split/useSplitOperation.ts【F:frontend/src/hooks/tools/split/useSplitOperation.ts†L3-L96】 | Split: getSplitEndpoint【F:frontend/src/hooks/tools/split/useSplitOperation.ts†L3-L96】 | Requires backend API for PDF processing |
| SwaggerUI | None | N/A | Already frontend-only (documentation viewer) |
| UnlockPdfForms | UnlockPdfForms: frontend/src/hooks/tools/unlockPdfForms/useUnlockPdfFormsOperation.ts【F:frontend/src/hooks/tools/unlockPdfForms/useUnlockPdfFormsOperation.ts†L2-L25】 | UnlockPdfForms: /api/v1/misc/unlock-pdf-forms【F:frontend/src/hooks/tools/unlockPdfForms/useUnlockPdfFormsOperation.ts†L2-L25】 | Requires backend API for PDF processing |
| ValidateSignature | ValidateSignature: frontend/src/hooks/tools/validateSignature/useValidateSignatureOperation.ts【F:frontend/src/hooks/tools/validateSignature/useValidateSignatureOperation.ts†L5-L91】 | ValidateSignature: /api/v1/security/validate-signature【F:frontend/src/hooks/tools/validateSignature/useValidateSignatureOperation.ts†L5-L91】 | Requires backend API for PDF processing |