feat:(pdfa-conversion) Implement Strict PDF/A Mode with Verification (#5663)

# Description of Changes


This PR introduces a new "Strict Mode" for the PDF to PDF/A conversion
tool. When enabled, the application will use VeraPDF to verify that the
resulting file is perfectly compliant with the selected PDF/A standard.
If validation fails, the system will return a descriptive error instead
of a non-compliant file.



<!--
Please provide a summary of the changes, including:

- What was changed
- Why the change was made
- Any challenges encountered

Closes #(issue_number)
-->
<img width="371" height="993" alt="image"
src="https://github.com/user-attachments/assets/a22d50b0-ad7c-46b0-be79-b79c2bc80d92"
/>

---

## 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)

### 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.

---------

Signed-off-by: Balázs Szücs <[email protected]>
This commit is contained in:
Balázs Szücs
2026-02-06 10:38:39 +00:00
committed by GitHub
parent 00136f9e20
commit 0f5a0e694a
11 changed files with 102 additions and 27 deletions
@@ -105,7 +105,7 @@ describe('Convert Tool Integration Tests', () => {
beforeEach(() => {
vi.clearAllMocks();
// Setup default apiClient mock
mockedApiClient.post = vi.fn();
mockedApiClient.post = vi.fn() as any;
});
afterEach(() => {
@@ -150,7 +150,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -232,7 +233,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -292,7 +294,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -361,7 +364,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -434,7 +438,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -505,7 +510,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -572,7 +578,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -636,7 +643,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -702,7 +710,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -765,7 +774,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -834,7 +844,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -902,7 +913,8 @@ describe('Convert Tool Integration Tests', () => {
includeAllRecipients: false
},
pdfaOptions: {
outputFormat: ''
outputFormat: '',
strict: false
},
pdfxOptions: {
outputFormat: 'pdfx'
@@ -396,7 +396,8 @@ describe('Convert Tool - Smart Detection Integration Tests', () => {
paramsResult.current.updateParameter('fromExtension', 'pdf');
paramsResult.current.updateParameter('toExtension', 'pdfa');
paramsResult.current.updateParameter('pdfaOptions', {
outputFormat: 'pdfa'
outputFormat: 'pdfa',
strict: false
});
});
@@ -409,6 +410,7 @@ describe('Convert Tool - Smart Detection Integration Tests', () => {
const formData = (mockedApiClient.post as Mock).mock.calls[0][1] as FormData;
expect(formData.get('outputFormat')).toBe('pdfa');
expect(formData.get('strict')).toBe('false');
expect(mockedApiClient.post).toHaveBeenCalledWith('/api/v1/convert/pdf/pdfa', expect.any(FormData), {
responseType: 'blob'
});