This pull request adds support for converting common eBook formats
(EPUB, MOBI, AZW3, FB2, TXT, DOCX) to PDF using Calibre. It introduces a
new API endpoint and updates the configuration, dependency checks, and
documentation to support this feature. Additionally, it includes related
UI and localization changes.
**New eBook to PDF conversion feature:**
* Added `ConvertEbookToPDFController` with a new
`/api/v1/convert/ebook/pdf` endpoint to handle eBook to PDF conversion
using Calibre, supporting options like embedding fonts, including table
of contents, and page numbers.
* Introduced `ConvertEbookToPdfRequest` model for handling conversion
requests and options.
**Configuration and dependency management:**
* Updated `RuntimePathConfig`, `ApplicationProperties`, and
`ExternalAppDepConfig` to support Calibre's executable path
configuration and dependency checking, ensuring Calibre is available and
correctly integrated.
[[1]](diffhunk://#diff-68c561052c2376c3d494bf11dd821958acd9917b1b2d33a7195ca2d6df7ec517R24)
[[2]](diffhunk://#diff-68c561052c2376c3d494bf11dd821958acd9917b1b2d33a7195ca2d6df7ec517R61)
[[3]](diffhunk://#diff-68c561052c2376c3d494bf11dd821958acd9917b1b2d33a7195ca2d6df7ec517R72-R74)
[[4]](diffhunk://#diff-1c357db0a3e88cf5bedd4a5852415fadad83b8b3b9eb56e67059d8b9d8b10702R359)
[[5]](diffhunk://#diff-8932df49d210349a062949da2ed43ce769b0f107354880a78103664f008f849eR26-R34)
[[6]](diffhunk://#diff-8932df49d210349a062949da2ed43ce769b0f107354880a78103664f008f849eR48)
[[7]](diffhunk://#diff-8932df49d210349a062949da2ed43ce769b0f107354880a78103664f008f849eR63-R68)
[[8]](diffhunk://#diff-8932df49d210349a062949da2ed43ce769b0f107354880a78103664f008f849eR132)
* Registered the new endpoint and tool group in `EndpointConfiguration`,
including logic to enable/disable the feature based on Calibre's
presence.
[[1]](diffhunk://#diff-3cddb66d1cf93eeb8103ccd17cee8ed006e0c0ee006d0ee1cf42d512f177e437R260)
[[2]](diffhunk://#diff-3cddb66d1cf93eeb8103ccd17cee8ed006e0c0ee006d0ee1cf42d512f177e437R440-R442)
[[3]](diffhunk://#diff-3cddb66d1cf93eeb8103ccd17cee8ed006e0c0ee006d0ee1cf42d512f177e437L487-R492)
**Documentation and localization:**
* Updated the `README.md` to mention eBook to PDF conversion support.
* Added UI route and form for eBook to PDF conversion in the web
controller.
* Added English and German localization strings for the new feature,
including descriptions, labels, and error messages.
[[1]](diffhunk://#diff-ee1c6999a33498cfa3abba4a384e73a8b8269856899438de80560c965079a9fdR617-R620)
[[2]](diffhunk://#diff-482633b22866efc985222c4a14efc5b7d2487b59f39b953f038273a39d0362f7R617-R620)
[[3]](diffhunk://#diff-482633b22866efc985222c4a14efc5b7d2487b59f39b953f038273a39d0362f7R1476-R1485)
## 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)
### 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/devGuide/DeveloperGuide.md#6-testing)
for more details.
---------
Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
# Description of Changes
**What was changed**
- Switched multiple nullable `Boolean` fields to primitive `boolean` in
`ApplicationProperties`:
- `Security.enableLogin`, `Security.csrfDisabled`
- `System.googlevisibility`, `System.showUpdateOnlyAdmin`,
`System.enableAlphaFunctionality`, `System.disableSanitize`,
`System.enableUrlToPDF`
- `Metrics.enabled`
- Updated all consumers to use Lombok’s `is*` accessors instead of
`get*`:
- `AppConfig`, `PostHogService`, `CustomHtmlSanitizer`,
`EndpointConfiguration`, `InitialSetup`, `OpenApiConfig`,
`ConvertWebsiteToPDF`, `HomeWebController`, `MetricsController`,
proprietary `SecurityConfiguration`, `AccountWebController`
- Tests adjusted to mock `isDisableSanitize()` instead of
`getDisableSanitize()`
- Logic simplifications:
- Removed redundant null-handling/ternaries now that primitives have
defaults (e.g., `enableAlphaFunctionality` bean)
- Replaced `Boolean.TRUE.equals(...)` with direct primitive checks
- Used constant-first `equals` for NPE safety in string comparisons
**Why the change was made**
- Primitive booleans eliminate ambiguity, cut down on
`NullPointerException` risks, and simplify conditions
- Aligns with Java/Lombok conventions (`isX()` for `boolean`) for
clearer, more consistent APIs
- Spring provides sane defaults for missing booleans (`false`), reducing
boilerplate and cognitive load
---
## 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)
### 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/devGuide/DeveloperGuide.md#6-testing)
for more details.
- Modularized PDF/A validation with methods for comprehensive and basic checks
- Added improved CIDSet handling for PDF/A-1 compliance using QPDF
- Simplified preflight document parsing logic with reusable methods
- Enhanced metadata management with modern Java APIs
- Streamlined Ghostscript and QPDF command execution for PDF normalization
- Introduced detailed logging of validation results and errors for better debugging
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Updated PDF normalization process to use QPDF instead of Ghostscript
- Aligned command execution logic with QPDF implementation
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Standardized localization files across multiple languages by replacing "or" with "&" in titles
- Added strings for PDF/A and PDF/X format descriptions to clarify use cases
- Resolved inconsistencies in format-specific tags and translations across languages
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Updated localization files across multiple languages for PDF/A and PDF/X descriptions, tags, and credits
- Standardized messaging to reflect the addition of PDF/X format and its purpose
- Resolved inconsistencies in translation strings and ensured proper formatting
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Replaced Ghostscript with QPDF in PDF normalization logic
- Updated command handling to use QPDF version verification
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Bumps [commons-io:commons-io](https://github.com/apache/commons-io) from
2.20.0 to 2.21.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/apache/commons-io/blob/master/RELEASE-NOTES.txt">commons-io:commons-io's
changelog</a>.</em></p>
<blockquote>
<p>Apache Commons IO 2.21.0 Release Notes</p>
<p>The Apache Commons IO team is pleased to announce the release of
Apache Commons IO 2.21.0.</p>
<h2>Introduction</h2>
<p>The Apache Commons IO library contains utility classes, stream
implementations, file filters,
file comparators, endian transformation classes, and much more.</p>
<p>Version 2.21.0: Java 8 or later is required.</p>
<h2>New features</h2>
<p>o FileUtils#byteCountToDisplaySize() supports Zettabyte, Yottabyte,
Ronnabyte and Quettabyte <a
href="https://redirect.github.com/apache/commons-io/issues/763">#763</a>.
Thanks to strangelookingnerd, Gary Gregory.
o Add org.apache.commons.io.FileUtils.ONE_RB <a
href="https://redirect.github.com/apache/commons-io/issues/763">#763</a>.
Thanks to strangelookingnerd, Gary Gregory.
o Add org.apache.commons.io.FileUtils.ONE_QB <a
href="https://redirect.github.com/apache/commons-io/issues/763">#763</a>.
Thanks to strangelookingnerd, Gary Gregory.
o Add org.apache.commons.io.output.ProxyOutputStream.writeRepeat(byte[],
int, int, long). Thanks to Gary Gregory.
o Add org.apache.commons.io.output.ProxyOutputStream.writeRepeat(byte[],
long). Thanks to Gary Gregory.
o Add org.apache.commons.io.output.ProxyOutputStream.writeRepeat(int,
long). Thanks to Gary Gregory.
o Add length unit support in FileSystem limits. Thanks to Piotr P.
Karwasz.
o Add IOUtils.toByteArray(InputStream, int, int) for safer chunked
reading with size validation. Thanks to Piotr P. Karwasz.
o Add org.apache.commons.io.file.PathUtils.getPath(String, String).
Thanks to Gary Gregory.
o Add org.apache.commons.io.channels.ByteArraySeekableByteChannel.
Thanks to Gary Gregory.
o Add IOIterable.asIterable(). Thanks to Gary Gregory.
o Add NIO channel support to <code>AbstractStreamBuilder</code>. Thanks
to Piotr P. Karwasz.
o Add CloseShieldChannel to close-shielded NIO Channels <a
href="https://redirect.github.com/apache/commons-io/issues/786">#786</a>.
Thanks to Piotr P. Karwasz.
o Added IOUtils.checkFromIndexSize as a Java 8 backport of
Objects.checkFromIndexSize <a
href="https://redirect.github.com/apache/commons-io/issues/790">#790</a>.
Thanks to Piotr P. Karwasz.</p>
<h2>Fixed Bugs</h2>
<p>o When testing on Java 21 and up, enable
-XX:+EnableDynamicAgentLoading. Thanks to Gary Gregory.
o When testing on Java 24 and up, don't fail FileUtilsListFilesTest for
a different behavior in the JRE. Thanks to Gary Gregory.
o ValidatingObjectInputStream does not validate dynamic proxy
interfaces. Thanks to Stanislav Fort, Gary Gregory.
o BoundedInputStream.getRemaining() now reports Long.MAX_VALUE instead
of 0 when no limit is set. Thanks to Piotr P. Karwasz.
o BoundedInputStream.available() correctly accounts for the maximum read
limit. Thanks to Piotr P. Karwasz.
o Deprecate IOUtils.readFully(InputStream, int) in favor of
toByteArray(InputStream, int). Thanks to Gary Gregory, Piotr P. Karwasz.
o IOUtils.toByteArray(InputStream) now throws IOException on byte array
overflow. Thanks to Piotr P. Karwasz.
o Javadoc general improvements. Thanks to Gary Gregory, Piotr P.
Karwasz.
o IOUtils.toByteArray() now throws EOFException when not enough data is
available <a
href="https://redirect.github.com/apache/commons-io/issues/796">#796</a>.
Thanks to Piotr P. Karwasz.
o Fix IOUtils.skip() usage in concurrent scenarios. Thanks to Piotr P.
Karwasz.
o [javadoc] Fix XmlStreamReader Javadoc to indicate the correct class
that is built <a
href="https://redirect.github.com/apache/commons-io/issues/806">#806</a>.
Thanks to J Hawkins.</p>
<h2>Changes</h2>
<p>o Bump org.apache.commons:commons-parent from 85 to 91 <a
href="https://redirect.github.com/apache/commons-io/issues/774">#774</a>,
<a
href="https://redirect.github.com/apache/commons-io/issues/783">#783</a>,
<a
href="https://redirect.github.com/apache/commons-io/issues/808">#808</a>.
Thanks to Gary Gregory, Dependabot.</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="54073d3b5f"><code>54073d3</code></a>
Prepare for the release candidate 2.21.0 RC1</li>
<li><a
href="f141f09d91"><code>f141f09</code></a>
Prepare for the next release candidate</li>
<li><a
href="adcf135015"><code>adcf135</code></a>
Add license header</li>
<li><a
href="0f499d060a"><code>0f499d0</code></a>
Use new oak logo</li>
<li><a
href="34a961c3ed"><code>34a961c</code></a>
Use HTTPS in URL</li>
<li><a
href="9e511181a0"><code>9e51118</code></a>
Use HTTPS in URL</li>
<li><a
href="d715865ee7"><code>d715865</code></a>
Add dependabot email [skip ci]</li>
<li><a
href="3d6a7e1136"><code>3d6a7e1</code></a>
Javadoc</li>
<li><a
href="ad875d566f"><code>ad875d5</code></a>
Bump actions/upload-artifact from 4.6.2 to 5.0.0 (<a
href="https://redirect.github.com/apache/commons-io/issues/810">#810</a>)</li>
<li><a
href="bc01dee31e"><code>bc01dee</code></a>
Bump github/codeql-action from 4.30.9 to 4.31.2 (<a
href="https://redirect.github.com/apache/commons-io/issues/811">#811</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/apache/commons-io/compare/rel/commons-io-2.20.0...rel/commons-io-2.21.0">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Added unit tests for metadata operations ensuring PDF/A compliance
- Implemented tests for content sanitization, including JS and transparency removal
- Verified color profile management with sRGB ICC profiles
- Included validation tests for detecting and formatting errors
- Added helper method tests for glyph set building and directory deletion
- Ensured proper handling of edge cases in empty or invalid PDFs through error handling tests
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Updated font embedding settings to avoid incomplete glyphs and allow substitutions
- Added high-quality prepress settings for better content preservation
- Introduced Type1 font CharSet fixing to handle missing or invalid definitions
- Implemented QPDF-based PDF normalization to address font program issues
- Enhanced cleanup logic to manage temporary files from normalization steps
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Replaced getter methods with direct field access for profile attributes
- Simplified output suffix and preflight format methods by using direct fields
- Enhanced request token filtering logic by leveraging direct field access
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Replaced direct field access with getter methods for profile attributes
- Added Lombok annotations to PdfaProfile and PdfXProfile enums for cleaner code
- Updated logging statements to utilize getter methods for consistency
- Improved validation and error message construction by standardizing access to profile attributes
- Simplified PdfaProfile and PdfXProfile implementations by removing redundant methods
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Added null checks for PDResources to prevent possible null pointer exceptions
- Streamlined request token processing by normalizing input directly in initialization
- Simplified filter logic for profile matching by leveraging pre-normalized tokens
- Removed redundant option from the PDF/A format dropdown in the UI template
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Replaced redundant streams and lists initialization with more efficient alternatives
- Centralized stream reading logic to prevent reuse issues and ensure proper closing
- Enhanced logging for PDF/A validation to differentiate warnings from errors
- Simplified methods by removing redundant parameters and improving clarity
- Updated GregorianCalendar usage to modern java.time classes
- Ensured static state for utility-like methods for cleaner invocation
- Improved PDF/A metadata handling by aligning structure and removing redundancy
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Resolved inconsistencies in messages_en_US and messages_en_GB property files
- Updated descriptions, tags, and credits for PDF/A and PDF/X conversion
- Adjusted localization strings to ensure proper format support handling
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
- Updated `PdfToPdfARequest` to include PDF/X in supported output formats
- Expanded input handling and model validation for PDF/A and PDF/X
- Added Ghostscript as a preferred backend for PDF/A and PDF/X conversions
- Implemented PDF/X-specific conversion logic with detailed validation
- Updated UI templates to separate PDF/A and PDF/X format options
- Enhanced error handling and warnings during conversion processes
- Revised localized strings to reflect expanded functionality
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
# Description of Changes
- **What was changed**
- Added new MVC tests:
- `ConverterWebControllerTest` covering simple converter routes,
`/pdf-to-cbr` enable/disable behavior via `EndpointConfiguration`,
Python availability flag, and `maxDPI` defaults/overrides for
`/pdf-to-img` and `/pdf-to-video`.
- `GeneralWebControllerTest` covering many editor/organizer routes’
view/model mapping, `/sign` font discovery from classpath and
`/opt/static/fonts`, handling of missing `UserService`, robust filtering
of malformed font entries, and `/pipeline` JSON config discovery with
graceful fallback on `Files.walk` errors.
- `HomeWebControllerTest` covering `/about`, `/releases`, legacy
redirects, root page’s `SHOW_SURVEY` behavior, `/robots.txt` for
`googlevisibility` true/false/null, and `/licenses` JSON parsing with
IOException fallback.
- Extended proprietary security tests:
- `LoginAttemptServiceTest` (reflective construction) validating
`getRemainingAttempts(...)` for disabled/blank keys, empty cache,
decreasing logic, and intentionally negative values when over the limit
(documented current behavior).
- Hardened `AttemptCounterTest`:
- Eliminated timing flakiness by using generous windows and setting
`lastAttemptTime` to “now”.
- Added edge-case assertions for zero/negative windows to document
current semantics after switching comparison to `elapsed >=
attemptIncrementTime`.
- **Why the change was made**
- To increase test coverage across critical web endpoints and security
logic, document current edge-case behavior, and prevent regressions
around view resolution, environment/property-driven flags, resource
discovery, and timing-sensitive logic.
---
## 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)
- [ ] 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)
- [ ] 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/devGuide/DeveloperGuide.md#6-testing)
for more details.
# Description of Changes
Updated test files to use fixed string identifiers and timestamps
instead of random UUIDs and system-dependent times. These changes make
the tests more deterministic and easier to debug.
**Test determinism and clarity improvements:**
* Replaced randomly generated UUIDs with fixed string identifiers in
test cases for `FileStorageTest.java` and `TaskManagerTest.java` to
ensure predictable test data.
* Changed usages of `System.currentTimeMillis()` and `Instant.now()` to
fixed values in tests for `TempFileCleanupServiceTest.java`,
`FileMonitorTest.java`, and `TextFinderTest.java` to avoid flakiness due
to timing issues.
* Improved code clarity by adding explanatory comments for time offsets
and by using direct string comparisons instead of `equals()` where
appropriate.
* Refactored a timeout simulation in `JobExecutorServiceTest.java` to
use busy-waiting instead of `Thread.sleep`, reducing test flakiness and
improving reliability.
<!--
Please provide a summary of the changes, including:
- What was changed
- Why the change was made
- Any challenges encountered
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/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)
- [ ] 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/devGuide/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/devGuide/DeveloperGuide.md#6-testing)
for more details.
---------
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
# Description of Changes
- Standardized all locale-sensitive operations to use `Locale.ROOT`:
- Replaced `toLowerCase()/toUpperCase()` and `String.format(...)` with
`Locale.ROOT` variants across services, controllers, utils, and tests
(e.g., `InstallationPathConfig`, `ApplicationProperties`,
`ResourceMonitor`, `ChecksumUtils`, `PdfUtils`, `UploadLimitService`).
- Hardened comparisons and parsing:
- Normalized host/domain and file-extension checks with
`toLowerCase(Locale.ROOT)`; switched several `equals` calls to
constant-first style (e.g., content types, security domain checks).
- Logging & formatting improvements:
- Ensured percent/size values and hex formatting use root-locale
formatting to avoid locale-dependent output.
- Code quality & readability:
- Converted multiple if/else ladders to modern `switch` expressions.
- Minor refactors (method references, early returns), removed redundant
returns, and clarified log messages.
- Minor fixes/behavioral nits:
- Normalized printer selection by lowercasing the searched name once;
made some equality checks null-safe/constant-first; added missing
`@Override` annotations where appropriate.
## Why
- Consistent use of `Locale.ROOT` avoids surprises in different
user/system locales (e.g., Turkish-I issues), makes string comparisons
deterministic, and keeps numeric/hex formatting stable across
environments.
---
## 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)
### 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/devGuide/DeveloperGuide.md#6-testing)
for more details.
---------
Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
Co-authored-by: James Brunton <jbrunton96@gmail.com>
Updated shouldReset to use '>=' instead of '>' so that the counter
resets when the elapsed time is exactly equal to the window. Adjusted
the corresponding test to expect a reset in this case.
# Description of Changes
- **What was changed**
- Updated `AttemptCounter.shouldReset(long attemptIncrementTime)` to
treat the boundary as elapsed by switching from a strict `>` comparison
to `>=` and introducing a local `elapsed` variable for clarity.
- Adjusted unit tests in `AttemptCounterTest` to reflect the corrected
behavior:
- Renamed the equality-boundary test to communicate the new expectation.
- Changed the assertion for the "exactly equal to window" case from
`assertFalse` to `assertTrue`.
- **Why the change was made**
- Fixes an off-by-one boundary issue where resets did **not** occur when
the elapsed time was **exactly** equal to the configured window. This
could permit one extra attempt beyond the intended rate-limit window.
- Aligns logic with common rate-limiting semantics: once the window has
fully elapsed, a reset should occur.
---
## 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)
- [ ] 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/devGuide/DeveloperGuide.md#6-testing)
for more details.
# Description of Changes
**What was changed**
- Fixed a CSS typo in `imageHighlighter.css` (`visbility` →
`visibility`) to restore the intended transition behavior.
- Corrected spelling/grammar in logs, comments, and console messages:
- `PdfUtils.java`: log message “overlayed” → “overlaid”.
- `CustomPDFDocumentFactoryTest.java`: comment typo “neeed” → “need”.
- `FlattenController.java`: comment “readd” → “re-add”.
- `PdfContainer.js`: console log “Hidding” → “Hiding”.
- `navbar.js`: clarified tooltip comment wording.
- `languages.html`: corrected Vietnamese label to “Tiếng Việt”.
- `ConvertWebsiteToPdfTest.java`: converted/de-duplicated comments to
clear English and improved assertion messages.
- No functional code paths altered except the CSS fix; the rest are
non-functional text improvements (logs/comments/tests/labels).
**Why the change was made**
- The CSS typo prevented the `visibility` transition from working as
intended.
- Consistent, correct wording improves developer experience, test
readability, and UI polish (language list).
---
## 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/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)
- [ ] 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/devGuide/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/devGuide/DeveloperGuide.md#6-testing)
for more details.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Reece Browne <74901996+reecebrowne@users.noreply.github.com>
Dutch translations completed, corrected and made consistent.
(Additional line at the end of the file removed. Hope this one passes
well.)
(Really; as translators shouldn't code like coders shouldn't translate,
projects would do well to move their translation work off to seperate
online localisation platforms such as Crowdin, Transifex, or Weblate.)
Co-authored-by: Ludy <Ludy87@users.noreply.github.com>
# Description of Changes
- add French translations of last added items in
messages_fr_FR.properties
- translate most of the language names
- Update ignore_translation.toml to exclude untranslated messages.
I hope this PR will reach the 98 % Progress score for fr_FR translation.
# Description of Changes
- **What was changed**
- **CI**: Enhanced `build.yml` to publish JaCoCo coverage and post a PR
summary comment per matrix job (Spring Security/JDK). Also archives
JaCoCo XML reports alongside existing test results.
- **Tests (new & expanded)**: Added a broad set of unit tests across
`app/common`, `app/core`, and `app/proprietary` modules, e.g.:
- Common: `ShowAdminInterfaceTest`, `UnsupportedClaimExceptionTest`,
`ExceptionUtilsTest`, `TempDirectoryTest`, etc.
- Core: `ConnectedInputStreamTest`, `ReplaceAndInvertColorFactoryTest`,
controller/model/service tests (e.g. `SettingsControllerTest`,
`ApiEndpointTest`, `FlexibleCSVWriterTest`,
`MetricsAggregatorServiceTest`, etc.).
- Proprietary: security/database/model/web tests (e.g.
`H2SQLConditionTest`, `JPATokenRepositoryImplTest`,
`AuditWebFilterTest`, `CorrelationIdFilterTest`, etc.).
- **JUnit 5 cleanup**: Consolidated assertion imports (`import static
org.junit.jupiter.api.Assertions.*`), standardized on Jupiter APIs, and
minor Mockito/Jupiter setup tweaks.
- **Fix**: `ReplaceAndInvertColorFactory` now safely returns `null` when
`replaceAndInvertOption` is `null` to avoid NPEs.
- **Testability refactor**: Broadened visibility of
`SPDFApplication#getActiveProfile(String[] args)` (from `private` to
`protected`) to enable direct unit testing.
- **Chore**: Removed obsolete `ValidationUtil` from `app/common`.
- **Why the change was made**
- Improve **signal in PRs** via automatic coverage summaries.
- Increase **test coverage** and reduce regressions across core and
proprietary modules.
- Eliminate a potential **NullPointerException** in color strategy
selection.
- Enable targeted testing of application startup/profile resolution
logic.
---
## 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)
### 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/devGuide/DeveloperGuide.md#6-testing)
for more details.
# Description of Changes
**Summary**
- Updated and refined the Portuguese (Portugal) (pt_PT) translation file
to improve linguistic accuracy, consistency, and terminology alignment
with the UI.
- Corrected minor spelling and grammatical issues.
- Standardized phrasing to ensure a more natural and user-friendly
experience.
**Reason for Change**
- To enhance the quality and clarity of the Portuguese (Portugal)
localization.
- To align the translation with recent UI/feature updates and improve
overall user experience for native speakers.
**Challenges Encountered**
- Ensuring contextual consistency across multiple translation keys and
avoiding conflicts with the Portuguese (Brazil) translation.
- Verifying terminology alignment with existing technical terms and
interface patterns.
---
## 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)
- [x] 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)
### 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)
- [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.
---------
Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
# Description of Changes
This pull request introduces support for FFmpeg as a new external tool
in the application. It adds configuration options for FFmpeg session
limits and timeouts, updates the process execution and tool-checking
utilities to handle FFmpeg, and expands endpoint configuration to
include FFmpeg-dependent features. Corresponding unit tests have also
been added to ensure FFmpeg detection works as expected.
**FFmpeg Integration and Configuration:**
* Added FFmpeg session limit and timeout configuration options to
`ApplicationProperties`, with default values and getter methods.
[[1]](diffhunk://#diff-1c357db0a3e88cf5bedd4a5852415fadad83b8b3b9eb56e67059d8b9d8b10702R631)
[[2]](diffhunk://#diff-1c357db0a3e88cf5bedd4a5852415fadad83b8b3b9eb56e67059d8b9d8b10702R672-R675)
[[3]](diffhunk://#diff-1c357db0a3e88cf5bedd4a5852415fadad83b8b3b9eb56e67059d8b9d8b10702R702)
[[4]](diffhunk://#diff-1c357db0a3e88cf5bedd4a5852415fadad83b8b3b9eb56e67059d8b9d8b10702R743-R746)
* Updated `ProcessExecutor` to recognize FFmpeg as a process type, and
to use the new session limit and timeout configuration for FFmpeg
processes.
[[1]](diffhunk://#diff-8424a11112fff55cc28467c4d531e451a485911ed1aeb0aea772c9fa7dc3aa6aL305-R316)
[[2]](diffhunk://#diff-8424a11112fff55cc28467c4d531e451a485911ed1aeb0aea772c9fa7dc3aa6aR74-R78)
[[3]](diffhunk://#diff-8424a11112fff55cc28467c4d531e451a485911ed1aeb0aea772c9fa7dc3aa6aR133-R137)
**Tool Detection and Exception Handling:**
* Implemented `isFfmpegAvailable()` in `CheckProgramInstall` to detect
FFmpeg installation, with caching for efficiency.
[[1]](diffhunk://#diff-7b61807107c689e3824a5f8fd42c27ab072a67a5666f24445bd6895937351690R14)
[[2]](diffhunk://#diff-7b61807107c689e3824a5f8fd42c27ab072a67a5666f24445bd6895937351690R60-R78)
* Added a specific exception factory method for missing FFmpeg in
`ExceptionUtils`.
**Endpoint Configuration:**
* Registered the new `pdf-to-video` endpoint under the "Convert",
"Java", and "FFmpeg" groups, and updated the tool group logic to include
"FFmpeg".
[[1]](diffhunk://#diff-3cddb66d1cf93eeb8103ccd17cee8ed006e0c0ee006d0ee1cf42d512f177e437R265)
[[2]](diffhunk://#diff-3cddb66d1cf93eeb8103ccd17cee8ed006e0c0ee006d0ee1cf42d512f177e437R395)
[[3]](diffhunk://#diff-3cddb66d1cf93eeb8103ccd17cee8ed006e0c0ee006d0ee1cf42d512f177e437R452-R454)
[[4]](diffhunk://#diff-3cddb66d1cf93eeb8103ccd17cee8ed006e0c0ee006d0ee1cf42d512f177e437L496-R502)
**Testing Enhancements:**
* Added and updated unit tests in `CheckProgramInstallTest` to verify
FFmpeg detection, including scenarios for installed, not installed, and
caching behavior.
[[1]](diffhunk://#diff-0eaf917d935710f0f5e18f12db600be47b8439d628d65a97a3db34133231790eR29)
[[2]](diffhunk://#diff-0eaf917d935710f0f5e18f12db600be47b8439d628d65a97a3db34133231790eR38-R45)
[[3]](diffhunk://#diff-0eaf917d935710f0f5e18f12db600be47b8439d628d65a97a3db34133231790eR67-R75)
[[4]](diffhunk://#diff-0eaf917d935710f0f5e18f12db600be47b8439d628d65a97a3db34133231790eR222-R262)
---
## 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)
### 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/devGuide/DeveloperGuide.md#6-testing)
for more details.
# Description of Changes
This pull request primarily refactors and improves the test code across
several modules, focusing on modernization, simplification, and
consistency of assertions and test setup. The changes include formatting
updates and improvements to utility methods. These updates help make the
tests easier to maintain and read, and ensure they use current best
practices.
**Test code modernization and assertion improvements:**
* Replaced legacy assertion methods such as `assertTrue(x instanceof Y)`
with more specific `assertInstanceOf` assertions in multiple test files,
improving clarity and type safety.
* Updated exception assertion checks to use `assertInstanceOf` for error
types instead of `assertTrue`, ensuring more precise test validation.
* Refactored test setup in `ResourceMonitorTest` to use `final` for
`AtomicReference` fields, clarifying intent and thread safety.
* Changed some test method signatures to remove unnecessary `throws
Exception` clauses, simplifying the test code.
**Test code simplification and cleanup:**
* Removed unused mock fields and simplified array initializations in
`AutoJobPostMappingIntegrationTest`, streamlining test setup and
reducing clutter.
* Updated YAML string initialization in
`ApplicationPropertiesDynamicYamlPropertySourceTest` to use Java text
blocks for improved readability.
* Improved null handling in assertions for collection validity checks.
* Updated byte array encoding to use `StandardCharsets.UTF_8` for
reliability and clarity.
**PDF document factory test refactoring:**
* Refactored `CustomPDFDocumentFactoryTest` to move helper methods for
inflating PDFs and writing temp files to the top of the class, and
restructured parameterized tests for better organization and
maintainability.
<!--
Please provide a summary of the changes, including:
- What was changed
- Why the change was made
- Any challenges encountered
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/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)
- [ ] 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/devGuide/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/devGuide/DeveloperGuide.md#6-testing)
for more details.
---------
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>