[V2] feat(convert): add support for CBR to PDF and PDF to CBR conversions
Description of Changes
TLDR:
- Introduced
ConvertFromCbrSettingsandConvertToCbrSettingscomponents for handling conversion-specific settings. - Updated
ConvertSettingsto include CBR-related configurations. - Updated
useConvertParameterswith new parameters:cbrOptionsandpdfToCbrOptions. - Updated locales with CBR-related translations.
- Added endpoints and updated conversion matrix for CBR formats in
convertConstants. - Modified
useConvertOperationto handle CBR-specific parameters during form data preparation.
For backend see this PR: #4581
This pull request adds support for converting between CBR (Comic Book Archive) and PDF formats in the frontend. It introduces new UI components for configuring conversion options, updates the conversion constants and logic, and ensures parameters for these conversions are handled correctly throughout the app.
CBR/PDF Conversion Features:
- Added new UI components:
ConvertFromCbrSettingsfor CBR to PDF conversions (option to optimize for ebook readers), andConvertToCbrSettingsfor PDF to CBR conversions (DPI selection for image rendering). These are conditionally rendered inConvertSettings.tsxbased on selected formats.
Conversion Logic and Constants:
- Extended conversion endpoints, format options, conversion matrix, and endpoint mappings to support CBR to PDF and PDF to CBR conversions.
- Updated
shouldProcessFilesSeparatelylogic to handle PDF to CBR conversions, ensuring each PDF generates its own archive.
Parameter Handling:
- Added new parameters (
cbrOptionsandpdfToCbrOptions) to the conversion parameter interface and default values, ensuring they are set/reset appropriately during format changes - Modified form data construction to include new options for CBR/PDF conversions (optimize for ebook, DPI).
Frontend
Note on RAR5. You can go back-and-forth with this converter due to the fact on default pdf to cbr makes RAR5 meanwhile, cbr to pdf can only RAR4 and below. This is unfortunate limitation of JunRAR library. In the real world, generally RAR5s are not that common, and they mostly unsupported by open-source software.
Checklist
General
- [X] I have read the Contribution Guidelines
- [X] I have read the Stirling-PDF Developer Guide (if applicable)
- [ ] I have read the How to add new languages to Stirling-PDF (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 (if functionality has heavily changed)
- [ ] I have read the section Add New Translation Tags (for new translation tags only)
Translations (if applicable)
- [ ] I ran
scripts/counter_translation.py
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 for more details.
@jbrunton96 looks like you are generating app installers for every commit in every PR.. please dont haha
@jbrunton96 looks like you are generating app installers for every commit in every PR.. please dont haha
https://github.com/Stirling-Tools/Stirling-PDF/pull/4897