mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-02-17 13:52:14 +01:00
locally hosted web application that allows you to perform various operations on PDF files
# Description of Changes This pull request introduces major improvements to the PDF attachment API, adding new endpoints for listing, renaming, and deleting attachments in PDFs, as well as improving error handling and content negotiation. It also adds support for converting PDFs to PDF/A-3b format when adding attachments and introduces stricter validation for attachment uploads. The exception handling is improved to ensure consistent JSON error responses, even when the client requests a PDF. **API Feature Additions:** * Added new endpoints in `AttachmentController` for listing (`/list-attachments`), renaming (`/rename-attachment`), and deleting (`/delete-attachment`) PDF attachments, with corresponding request and response models: `ListAttachmentsRequest`, `RenameAttachmentRequest`, `DeleteAttachmentRequest`, and `AttachmentInfo`. * Enhanced the `/add-attachments` endpoint to optionally convert the resulting PDF to PDF/A-3b format, controlled by a new `convertToPdfA3b` flag in `AddAttachmentRequest`. **Validation and Robustness:** * Introduced strict validation for attachment uploads, enforcing non-empty attachments, a maximum size per attachment (50 MB), and a total size limit (200 MB). **Content Negotiation:** * Updated `WebMvcConfig` to configure content negotiation, allowing both PDF and JSON responses, and preventing 406 errors when clients request PDFs but errors must be returned as JSON. <img width="370" height="997" alt="image" src="https://github.com/user-attachments/assets/571504d4-e97e-4b30-ae97-3defba217b47" /> <img width="1415" height="649" alt="image" src="https://github.com/user-attachments/assets/bb8863fc-0be8-4bf2-af7d-73a229010f9a" /> <img width="1415" height="649" alt="image" src="https://github.com/user-attachments/assets/68092672-5be5-4ef7-9cbc-1fb008b728e1" /> <img width="1415" height="649" alt="image" src="https://github.com/user-attachments/assets/c4b0eda5-2573-4e38-8284-c077acb83f7f" /> <!-- Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --> --- ## Checklist ### General - [X] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [X] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [X] I have performed a self-review of my own code - [X] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### Translations (if applicable) - [ ] I ran [`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md) ### UI Changes (if applicable) - [X] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [X] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --------- Signed-off-by: Balázs Szücs <bszucs1209@gmail.com> |
||
|---|---|---|
| .devcontainer | ||
| .github | ||
| .vscode | ||
| app | ||
| devGuide | ||
| devTools | ||
| docker | ||
| docs | ||
| frontend | ||
| gradle/wrapper | ||
| images | ||
| scripts | ||
| testing | ||
| .dockerignore | ||
| .editorconfig | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| ADDING_TOOLS.md | ||
| build.gradle | ||
| CLAUDE.md | ||
| CONTRIBUTING.md | ||
| DATABASE.md | ||
| DeveloperGuide.md | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| HowToUseOCR.md | ||
| launch4jConfig.xml | ||
| LICENSE | ||
| package-lock.json | ||
| README.md | ||
| SECURITY.md | ||
| settings.gradle | ||
| test_globalsign.pdf | ||
| test_irs_signed.pdf | ||
| WINDOWS_SIGNING.md | ||
Stirling PDF - The Open-Source PDF Platform
Stirling PDF is a powerful, open-source PDF editing platform. Run it as a personal desktop app, in the browser, or deploy it on your own servers with a private API. Edit, sign, redact, convert, and automate PDFs without sending documents to external services.
Key Capabilities
- Everywhere you work - Desktop client, browser UI, and self-hosted server with a private API.
- 50+ PDF tools - Edit, merge, split, sign, redact, convert, OCR, compress, and more.
- Automation & workflows - No-code pipelines direct in UI with APIs to process millions of PDFs.
- Enterprise‑grade - SSO, auditing, and flexible on‑prem deployments.
- Developer platform - REST APIs available for nearly all tools to integrate into your existing systems.
- Global UI - Interface available in 40+ languages.
For a full feature list, see the docs: https://docs.stirlingpdf.com
Quick Start
docker run -p 8080:8080 docker.stirlingpdf.com/stirlingtools/stirling-pdf
Then open: http://localhost:8080
For full installation options (including desktop and Kubernetes), see our Documentation Guide.
Resources
Support
- Community Discord
- Bug Reports: Github issues
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
For development setup, see the Developer Guide.
For adding translations, see the Translation Guide.
License
Stirling PDF is open-core. See LICENSE for details.
