Stirling-PDF/src/main/java/stirling/software/SPDF/config
Anthony Stirling d8cca66560
Add default languages to OCR, fix compression for QPDF and embedded images (#3202)
# Description of Changes

This pull request includes several changes to the codebase, focusing on
enhancing OCR support, improving endpoint management, and adding new
functionality for PDF compression. The most important changes are
detailed below.

### Enhancements to OCR support:

* `Dockerfile` and `Dockerfile.fat`: Added support for multiple new OCR
languages including Chinese (Simplified), German, French, and
Portuguese. (Our top 5 languages including English)
[[1]](diffhunk://#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R69-R72)
[[2]](diffhunk://#diff-571631582b988e88c52c86960cc083b0b8fa63cf88f056f26e9e684195221c27L78-R81)

### Improvements to endpoint management:

*
[`src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java`](diffhunk://#diff-750f31f6ecbd64b025567108a33775cad339e835a04360affff82a09410b697dR51-R66):
Added a new method `isGroupEnabled` to check if a group of endpoints is
enabled.
*
[`src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java`](diffhunk://#diff-750f31f6ecbd64b025567108a33775cad339e835a04360affff82a09410b697dL179-L193):
Updated endpoint groups and removed redundant qpdf endpoints.
[[1]](diffhunk://#diff-750f31f6ecbd64b025567108a33775cad339e835a04360affff82a09410b697dL179-L193)
[[2]](diffhunk://#diff-750f31f6ecbd64b025567108a33775cad339e835a04360affff82a09410b697dL243-L244)
*
[`src/main/java/stirling/software/SPDF/config/EndpointInspector.java`](diffhunk://#diff-845de13e140bb1264014539714860f044405274ad2a9481f38befdd1c1333818R1-R291):
Introduced a new `EndpointInspector` class to discover and validate GET
endpoints dynamically.

### New functionality for PDF compression:

*
[`src/main/java/stirling/software/SPDF/controller/api/misc/CompressController.java`](diffhunk://#diff-c307589e9f958f2593c9567c5ad9d63cd03788aa4803b3017b1c13b0d0485805R10):
Enhanced the `CompressController` to handle nested images within form
XObjects, improving the accuracy of image compression in PDFs.
Remove Compresses Dependency on QPDF
[[1]](diffhunk://#diff-c307589e9f958f2593c9567c5ad9d63cd03788aa4803b3017b1c13b0d0485805R10)
[[2]](diffhunk://#diff-c307589e9f958f2593c9567c5ad9d63cd03788aa4803b3017b1c13b0d0485805R28-R44)
[[3]](diffhunk://#diff-c307589e9f958f2593c9567c5ad9d63cd03788aa4803b3017b1c13b0d0485805L49-R61)
[[4]](diffhunk://#diff-c307589e9f958f2593c9567c5ad9d63cd03788aa4803b3017b1c13b0d0485805R77-R99)
[[5]](diff
hunk://#diff-c307589e9f958f2593c9567c5ad9d63cd03788aa4803b3017b1c13b0d0485805L92-R191)
Closes #(issue_number)

---

## Checklist

### General

- [ ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/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/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [ ] 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/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.

---------

Co-authored-by: a <a>
2025-03-20 09:39:57 +00:00
..
fingerprint Frooodle/license (#1994) 2024-10-14 22:34:41 +01:00
interfaces SSO Refactoring (#2818) 2025-02-24 22:18:34 +00:00
security OAuth 2 redirectUri hotfix (#3066) 2025-02-26 10:22:25 +00:00
AppConfig.java Fix: Context Path Handling and Static Asset Loading Improvements (#3198) 2025-03-20 07:53:29 +00:00
AppUpdateService.java Enhance AppUpdateService: Add @Configuration Annotation for Improved Spring Boot Integration (#3036) 2025-02-23 20:02:46 +00:00
CleanUrlInterceptor.java SSO Refactoring (#2818) 2025-02-24 22:18:34 +00:00
ConfigInitializer.java Improved Configuration and YAML Management (#2966) 2025-02-25 21:52:59 +00:00
EndpointConfiguration.java Add default languages to OCR, fix compression for QPDF and embedded images (#3202) 2025-03-20 09:39:57 +00:00
EndpointInspector.java Add default languages to OCR, fix compression for QPDF and embedded images (#3202) 2025-03-20 09:39:57 +00:00
EndpointInterceptor.java formattingand autowired constructors (#2557) 2024-12-24 09:52:53 +00:00
ExternalAppDepConfig.java Dynamic paths for tools and removal of unused book endpoints (#3018) 2025-02-23 13:36:21 +00:00
FileFallbackTemplateResolver.java File paths dynamic (#2605) 2025-01-06 12:41:30 +00:00
InitialSetup.java Improved Configuration and YAML Management (#2966) 2025-02-25 21:52:59 +00:00
InstallationPathConfig.java Refactor Path Handling (#3041) 2025-02-25 21:31:20 +00:00
LocaleConfiguration.java formattingand autowired constructors (#2557) 2024-12-24 09:52:53 +00:00
LogbackPropertyLoader.java File paths dynamic (#2605) 2025-01-06 12:41:30 +00:00
MetricsConfig.java eol 2024-01-03 17:59:04 +00:00
MetricsFilter.java Dynamic paths for tools and removal of unused book endpoints (#3018) 2025-02-23 13:36:21 +00:00
OpenApiConfig.java formattingand autowired constructors (#2557) 2024-12-24 09:52:53 +00:00
PostHogConfig.java Dynamic paths for tools and removal of unused book endpoints (#3018) 2025-02-23 13:36:21 +00:00
PostHogLoggerImpl.java Posthog to log to log file (#2813) 2025-01-30 15:13:42 +00:00
RuntimePathConfig.java Refactor Path Handling (#3041) 2025-02-25 21:31:20 +00:00
StartupApplicationListener.java eol 2024-01-03 17:59:04 +00:00
WebMvcConfig.java File paths dynamic (#2605) 2025-01-06 12:41:30 +00:00
YamlHelper.java Improved Configuration and YAML Management (#2966) 2025-02-25 21:52:59 +00:00
YamlPropertySourceFactory.java File paths dynamic (#2605) 2025-01-06 12:41:30 +00:00