Compare commits

..
56 Commits
Author SHA1 Message Date
ConnorYohandGitHub f59d2595a6 Merge branch 'V2' into fix-analytics-v2 2025-11-26 12:28:27 +00:00
Connor Yoh 5c4be090aa Added posthog variables directly to code 2025-11-26 12:22:39 +00:00
EthanHealy01andGitHub 21657a3fa6 fix the text color for the first time setup with default credentials (#5023)
# Description of Changes

Fix for this:
<img width="584" height="203" alt="Screenshot 2025-11-26 at 11 58 17 AM"
src="https://github.com/user-attachments/assets/fb5ea4ae-e42a-407a-a890-933d9f6db829"
/>

---

## 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.
2025-11-26 12:14:04 +00:00
James BruntonandGitHub bc11875081 Fix CORS issues in desktop app (#5019)
# Description of Changes
In the 2.0.0 release version, the frontend can't connect to the backend
on my machine because all the network requests 403. I think this is
because of CORS issues, and supposedly these will be fixed by using a
different Spring function, which is more lenient on URL schemes (needs
to allow `tauri://localhost` here, which isn't a standard URL)
2025-11-26 10:02:38 +00:00
Reece BrowneandGitHub 31b3219169 Detect backend down (#5010)
# Description of Changes

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

### 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.
2025-11-25 22:10:38 +00:00
d8a99fcb07 Use proper Windows APIs for checking/setting default app (#5000)
# Description of Changes
Use proper Windows APIs for checking/setting default app

---------

Co-authored-by: Connor Yoh <con.yoh13@gmail.com>
Co-authored-by: ConnorYoh <40631091+ConnorYoh@users.noreply.github.com>
2025-11-25 21:31:02 +00:00
Reece BrowneandGitHub 8016d271aa Handle non-pdf gracefully in viewer (#5004)
# Description of Changes

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

### 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.
2025-11-25 21:27:47 +00:00
Anthony StirlingandGitHub 8f1bef7f46 translationsNew (#5015)
# Description of Changes

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

### 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.
2025-11-25 21:25:16 +00:00
e6db57e031 grandfather users (#4984)
# Description of Changes

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

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

---------

Co-authored-by: ConnorYoh <40631091+ConnorYoh@users.noreply.github.com>
Co-authored-by: Dario Ghunney Ware <dariogware@gmail.com>
2025-11-25 21:23:32 +00:00
Reece BrowneandGitHub daf749e6be File in context indication (#4990)
# Description of Changes

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

### 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.
2025-11-25 20:28:24 +00:00
Reece BrowneandGitHub 53d167eda5 Chore/v2/translation fixes (#5011)
# Description of Changes

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

### 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.
2025-11-25 20:03:47 +00:00
d74856f675 Remove "Download for Desktop" and "Security Check" slides from desktop app onboarding (#5012)
# Description of Changes

- Title^ + I changed the text for set as default to make it more visible

---

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

---------

Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
Co-authored-by: Connor Yoh <connor@stirlingpdf.com>
2025-11-25 19:56:09 +00:00
f8386843d4 Bug/v2/onboarding slides fix (#5005)
# Description of Changes

- Stop onboarding from appearing before logging in
- Also (should've done this in a different PR) fixed a small bug in
settings when changing logo

---

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

---------

Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
Co-authored-by: Connor Yoh <connor@stirlingpdf.com>
2025-11-25 18:45:40 +00:00
ConnorYohandGitHub 2277a94c91 Added default supabase and stripe public variables (#5009)
Added to codebase
VITE_SUPABASE_URL
VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY
VITE_STRIPE_PUBLISHABLE_KEY
2025-11-25 17:58:38 +00:00
ConnorYohandGitHub 3b8b539efc Feature/v2/stripeorsupabaseNotEnabled (#5006)
Removed current plan section from static plan to match connected version

stripe publishable key not required to show plans or checkout in hosted
version

lazy load plans when needed not on load
2025-11-25 17:09:41 +00:00
Anthony StirlingandGitHub 7253b9fa6d translations and login page (#5008)
# Description of Changes

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

### 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.
2025-11-25 16:39:21 +00:00
EthanHealy01andGitHub 9a1f89486d center login section (#5007)
# Description of Changes


<img width="2056" height="1084" alt="Screenshot 2025-11-25 at 3 54
11 PM"
src="https://github.com/user-attachments/assets/32c0b69a-4799-49f2-be8b-d75bba5e6aac"
/>


---

## 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.
2025-11-25 16:25:58 +00:00
EthanHealy01andGitHub a6614e1bfb UI/allow logo selection (#4982)
# Description of Changes

- Allow switching between logos in-app using the same section in
settings

---

## 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.
2025-11-25 15:22:14 +00:00
Reece BrowneandGitHub ae5b1a4b02 consolidate english language to use gb (#5002)
# Description of Changes

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

### 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.
2025-11-25 15:15:44 +00:00
ConnorYohandGitHub 9fcaace8ed Make sure license gets pushed and saved for default license replacements (#5001) 2025-11-25 14:58:33 +00:00
ConnorYohandGitHub 2ab7945130 Capture emaill when the license is default or invalid (#4998)
Stripe checkout captures email if the license is the default or invalid.
2025-11-25 14:33:19 +00:00
a8db2fda18 Feature/onboarding slides (#4955)
# Description of Changes

- Added onboarding slides/upgrade banner conditions for all the
following cases
  - 'licensed'
  - 'no-login-user-under-limit-no-license'
  - 'no-login-admin-under-limit-no-license'
  - 'no-login-user-over-limit-no-license'
  - 'no-login-admin-over-limit-no-license'
  - 'login-user-under-limit-no-license'
  - 'login-admin-under-limit-no-license'
  - 'login-user-over-limit-no-license'
  - 'login-admin-over-limit-no-license';


---

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

---------

Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
Co-authored-by: Connor Yoh <connor@stirlingpdf.com>
2025-11-25 13:45:02 +00:00
James BruntonandGitHub 80f2980755 Fix backend issues in desktop app (#4995)
# Description of Changes
Fixes two distinct but related issues in the backend of the desktop app:
- Correctly shows tools as unavaialable when the backend doesn't have
the dependencies or has disabled them etc. (same as web version - this
primarily didn't work on desktop because the app spawns before the
backend is running)
- Fixes infinite re-rendering issues caused by the app polling whether
the backend is healthy or not
2025-11-25 13:15:30 +00:00
James BruntonandGitHub 2d8b0ff08c Various fixes for desktop (#4976)
# Description of Changes
- ~Force classic logo~
- Refer to email instead of username in SaaS sign in flow
- Allow drag-and-drop files into desktop app
- Convert terminology & icons from upload/download to open/save in
desktop version
2025-11-25 13:11:13 +00:00
Anthony StirlingandGitHub 991e03970e Fix settings loading (#4997)
# Description of Changes

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

### 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.
2025-11-25 12:30:44 +00:00
James BruntonandGitHub 64d343b765 Add SSO login options to desktop app (#4954)
# Description of Changes
Add SSO login options to desktop app
2025-11-25 11:56:25 +00:00
stirlingbot[bot]GitHubstirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com>
2534c532b7 🌐 [V2] Sync Translations + Update README Progress Table (#4946)
### Description of Changes

This Pull Request was automatically generated to synchronize updates to
translation files and documentation for the **V2 branch**. Below are the
details of the changes made:

#### **1. Synchronization of Translation Files**
- Updated translation files
(`frontend/public/locales/*/translation.json`) to reflect changes in the
reference file `en-GB/translation.json`.
- Ensured consistency and synchronization across all supported language
files.
- Highlighted any missing or incomplete translations.

#### **2. Update README.md**
- Generated the translation progress table in `README.md`.
- Added a summary of the current translation status for all supported
languages.
- Included up-to-date statistics on translation coverage.

#### **Why these changes are necessary**
- Keeps translation files aligned with the latest reference updates.
- Ensures the documentation reflects the current translation progress.

---

Auto-generated by [create-pull-request][1].

[1]: https://github.com/peter-evans/create-pull-request

Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com>
2025-11-25 10:01:38 +00:00
Anthony StirlingandGitHub 8757a80fda Update tauri-build.yml (#4978)
# Description of Changes

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

### 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.
2025-11-24 23:31:09 +00:00
James BruntonandGitHub d599a07a66 Automatically switch to Viewer when going to exactly 1 file (#4973)
# Description of Changes
Automatically switch to Viewer when going to exactly 1 file
2025-11-24 17:09:41 +00:00
Reece BrowneandGitHub 861e4394df Bug/v2/fix rtl (#4958) 2025-11-24 16:57:36 +00:00
5d18184e46 V2 Payment Features (#4974)
* Added ability to add seats to enterprise
* first logged in date on people page
* Remove Premium config section				
* Cleanup add seat flow					
* Shrink numbers in plan 					
* Make editing text a server feature in the highlights
* default to dollar pricing				
* clear checkout logic when crash				
* Recongnise location and find pricing			
* Payment successful page

---------

Co-authored-by: Connor Yoh <connor@stirlingpdf.com>
2025-11-24 16:38:07 +00:00
EthanHealy01andGitHub 050408639b revert to classic logo (#4971)
# Description of Changes
 
- Revert to classic logo

---

## 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.
2025-11-24 15:04:42 +00:00
b0397da19e PDF Text editor (#4724)
## Summary
- add a `PdfJsonConversionService` that serializes PDF text, fonts, and
metadata to JSON and rebuilds a PDF from the same structure
- expose REST endpoints for `/pdf/json` and `/json/pdf` conversions
using the existing convert API infrastructure
- define JSON model classes capturing document metadata, font
information, and positioned text elements

## Testing
- `./gradlew spotlessApply` *(fails: plugin
org.springframework.boot:3.5.4 unavailable in build environment)*
- `./gradlew build` *(fails: plugin org.springframework.boot:3.5.4
unavailable in build environment)*

------
https://chatgpt.com/codex/tasks/task_b_68f8e98d94ac8328a0e499e541528b6f

---------

Co-authored-by: EthanHealy01 <ethan.healy.21@gmail.com>
2025-11-24 14:15:02 +00:00
Reece BrowneandGitHub d42065e338 Feature/v2/add image (#4956)
# Description of Changes

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

### 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.
2025-11-24 14:00:43 +00:00
Reece BrowneandGitHub 30bcc38c04 Feature/v2/add text (#4951)
Refactor sign to separate out add text and add image functions. 
Implement add text as standalone tool
2025-11-24 13:37:35 +00:00
James BruntonandGitHub e8e98128d2 Allow login to SaaS for desktop instead of offline mode (#4941)
# Description of Changes
Makes the desktop options to sign in with your Stirling account, or sign
into self-hosted:

<img width="608" height="456" alt="image"
src="https://github.com/user-attachments/assets/a49988ab-db3f-4333-b242-790aee5c07c6"
/>

The first option still runs everything locally, just enforces that
you've signed in for now. Future work will enable sending operations
that can't be run locally to the server.
2025-11-22 00:38:59 +00:00
Anthony StirlingandGitHub e1a879a5f6 Differentiate unavailable tools by reason (#4916)
## Summary
- track endpoint disable reasons server-side and expose them through a
new `/api/v1/config/endpoints-availability` API that the frontend can
consume
- refresh the web UI tool management logic to cache endpoint details,
compute per-tool availability metadata, and show reason-specific
messaging (admin disabled vs missing dependency) when a tool cannot be
launched
- add the missing en-GB translations for the new unavailability labels
so the UI copy reflects the new distinction
<img width="1156" height="152" alt="image"
src="https://github.com/user-attachments/assets/b54eda37-fe5c-42f9-bd5f-9ee00398d1ae"
/>


<img width="930" height="168" alt="image"
src="https://github.com/user-attachments/assets/47c07ffa-adb7-4ce3-910c-b6ff73f6f993"
/>


## Testing
- `npm run typecheck:core` *(fails:
frontend/src/core/components/shared/LocalIcon.tsx expects
../../../assets/material-symbols-icons.json, which is not present in
this environment)*

------
[Codex
Task](https://chatgpt.com/codex/tasks/task_b_6919af7a493c8328bb5ac3d07e65452b)
2025-11-21 13:19:53 +00:00
Reece BrowneandGitHub 4fd336c26c Feature/v2/bookmarks (#4949)
bookmark panel on viewer
2025-11-21 11:33:49 +00:00
Dario Ghunney WareandGitHub fca8470637 Moar Login Fixes (#4948) 2025-11-20 20:51:53 +00:00
Balázs SzücsandGitHub 76f2fd3b76 [V2] refactor(tooltips): add merge tooltips header for consistency, and update other tooltips (#4895)
# Description of Changes

Note on tooltips: I'll do more PRs on tooltips, however this has
priority, hence I submitted this for now.


#### Before:

<img width="758" height="721" alt="image"
src="https://github.com/user-attachments/assets/ce3166d2-c681-447e-82df-68fe6d18669d"
/>

<img width="782" height="485" alt="image"
src="https://github.com/user-attachments/assets/48970a4c-9911-4ade-9346-c33c5a6a319f"
/>

<img width="782" height="602" alt="image"
src="https://github.com/user-attachments/assets/9f77648d-4d1a-4e4b-93af-eaab6db849ff"
/>

<img width="782" height="602" alt="image"
src="https://github.com/user-attachments/assets/ae653534-bf04-47a0-8aab-0bb5b9c3ecef"
/>

#### After:
<img width="758" height="721" alt="image"
src="https://github.com/user-attachments/assets/8d45e876-a0df-4fe3-89a8-5184492db204"
/>

<img width="782" height="602" alt="image"
src="https://github.com/user-attachments/assets/550ee105-1286-4072-9f55-46255b3fbe80"
/>

<img width="782" height="602" alt="image"
src="https://github.com/user-attachments/assets/fba7ea93-73fe-4529-84fe-c37816375a9e"
/>
<img width="782" height="602" alt="image"
src="https://github.com/user-attachments/assets/ca452e77-b58b-4a5b-8e97-e6ccef4cf500"
/>


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

- [ ] 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>
2025-11-20 15:00:16 +00:00
Balázs SzücsandGitHub 06af6be14b [V2] feat(pipeline): add pre-publish sanitization workflow (#4910)
# Description of Changes
TLDR
- Created `Pre-publish-sanitization.json` default pipeline configuration
- Added sanitization operations removing metadata, JavaScript, embedded
files, and annotations
- Registered new pipeline in `GeneralUtils`
- Included "Pre-publish Sanitization" in the suggested automations list

This pull request introduces a new "Pre-publish Sanitization" workflow
for PDF files, designed to help users remove sensitive metadata and
content before publishing documents online. The changes include backend
and frontend updates to support this workflow, as well as a minor bug
fix in form data handling.

**New Pre-publish Sanitization Workflow:**

* Added a new default configuration file `Pre-publish-sanitization.json`
that defines a pipeline for sanitizing PDFs by removing JavaScript,
embedded files, metadata, annotations, flattening forms, and compressing
the document.
* Registered the new `Pre-publish-sanitization.json` config in the set
of default web UI configurations in `GeneralUtils.java`, making it
available in the application.

**Frontend Integration:**

* Added a new suggested automation called "Pre-publish Sanitization" in
the `useSuggestedAutomations` hook, including its name, description,
operations, and a new privacy icon for better UI representation.

<!--
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
- [ ] 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)

- [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>
2025-11-20 14:59:13 +00:00
Anthony StirlingandGitHub c87da6d5cc Add automatic unlock prompt for encrypted PDFs (#4912)
## Summary
- propagate an `isEncrypted` flag from thumbnail generation into
processed file metadata so uploads know when a password is still present
- add queueing logic inside `FileContext` that detects encrypted
uploads, prompts the user via a new modal, and automatically runs the
Remove Password endpoint to replace the file and preserve history
- introduce a dedicated `EncryptedPdfUnlockModal` component that mirrors
existing styling and messaging for unlocking PDFs

## Testing
- npm run typecheck:core


------
[Codex
Task](https://chatgpt.com/codex/tasks/task_b_6919a0a418bc8328b886ec76a28170b7)
2025-11-20 14:54:41 +00:00
6c8d2c89fe Add initial Windows signing infrastructure (#4945)
# Description of Changes

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

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

---------

Co-authored-by: James Brunton <james@stirlingpdf.com>
Co-authored-by: James Brunton <jbrunton96@gmail.com>
2025-11-20 12:21:42 +00:00
8d9e70c796 Stripe and license payment integration (#4935)
selfhosted stripe payment and license integration

---------

Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
Co-authored-by: Connor Yoh <connor@stirlingpdf.com>
2025-11-20 12:07:37 +00:00
James BruntonandGitHub f4725b98b0 Allow desktop app to connect to selfhosted servers (#4902)
# Description of Changes
Changes the desktop app to allow connections to self-hosted servers on
first startup. This was quite involved and hit loads of CORS issues all
through the stack, but I think it's working now. This also changes the
bundled backend to spawn on an OS-decided port rather than always
spawning on `8080`, which means that the user can have other things
running on port `8080` now and the app will still work fine. There were
quite a few places that needed to be updated to decouple the app from
explicitly using `8080` and I was originally going to split those
changes out into another PR (#4939), but I couldn't get it working
independently in the time I had, so the diff here is just going to be
complex and contian two distinct changes - sorry 🙁
2025-11-20 10:03:34 +00:00
stirlingbot[bot]GitHubstirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com>
75414b89f9 🌐 [V2] Sync Translations + Update README Progress Table (#4900)
### Description of Changes

This Pull Request was automatically generated to synchronize updates to
translation files and documentation for the **V2 branch**. Below are the
details of the changes made:

#### **1. Synchronization of Translation Files**
- Updated translation files
(`frontend/public/locales/*/translation.json`) to reflect changes in the
reference file `en-GB/translation.json`.
- Ensured consistency and synchronization across all supported language
files.
- Highlighted any missing or incomplete translations.

#### **2. Update README.md**
- Generated the translation progress table in `README.md`.
- Added a summary of the current translation status for all supported
languages.
- Included up-to-date statistics on translation coverage.

#### **Why these changes are necessary**
- Keeps translation files aligned with the latest reference updates.
- Ensures the documentation reflects the current translation progress.

---

Auto-generated by [create-pull-request][1].

[1]: https://github.com/peter-evans/create-pull-request

Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com>
2025-11-19 21:18:01 +00:00
Reece BrowneandGitHub dd1c653301 Feature/v2/saved signatures (#4899)
Add Saved signature functionality
2025-11-19 17:30:01 +00:00
Reece BrowneandGitHub 0f73a1cf13 Feature/sign placement UI (#4891)
Show signature preview on hover
Place signature smaller (mkatch preview size)
Retain signature in modal on close/open
Clean up ui generally
Small bug fixes
2025-11-19 12:53:25 +00:00
Anthony StirlingandGitHub 8ffe53536d activeUsers (#4936)
# Description of Changes

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

### 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.
2025-11-19 12:35:35 +00:00
Anthony StirlingandGitHub 6177ccd333 update notif (#4937)
# Description of Changes
<img width="1521" height="1041" alt="image"
src="https://github.com/user-attachments/assets/2644bf70-0a9b-4c91-9046-02f555314608"
/>

<img width="1162" height="1598" alt="image"
src="https://github.com/user-attachments/assets/36d693f7-6fdd-4f2b-9db1-39ac336d9055"
/>

<img width="1220" height="1625" alt="image"
src="https://github.com/user-attachments/assets/4d4c19ea-0020-45fb-b15a-9f6ad377856c"
/>

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

### 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.
2025-11-19 11:54:33 +00:00
87bf7a5b7f Add edit table of contents tool to React UI (#4917)
## Summary
- add a dedicated edit table of contents tool to the React UI, complete
with bookmark editor, import/export actions, and parameter handling
- register the tool in the translated registry and extend the English
translations with the new strings
- wire up the backend endpoints through a new operation hook and
form-data serialization helpers

## Testing
- ./gradlew build

------
[Codex
Task](https://chatgpt.com/codex/tasks/task_b_691a4a87a9c4832899ecd1c55989f27f)

---------

Co-authored-by: Reece Browne <74901996+reecebrowne@users.noreply.github.com>
2025-11-18 15:07:12 +00:00
Reece BrowneandGitHub a8ea0b60cf Chore/v2/fix auto zoom (#4903) 2025-11-18 13:43:52 +00:00
Anthony StirlingandGitHub 15b8447626 translations (#4906)
# Description of Changes

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

### 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.
2025-11-18 12:23:11 +00:00
James BruntonandGitHub a7fc36586a Fix OnboardingTour not responding to translations (#4934)
# Description of Changes
The onboarding tour wasn't presenting itself as having any dependencies
to React so would never be re-rendered after language changes.
2025-11-18 10:15:05 +00:00
James BruntonandGitHub a415c457e9 Add prompt to make Stirling your default PDF app (#4890)
# Description of Changes
- Adds a reusable banner component/system to the core app
- Adds banner at the top of the desktop app if Stirling isn't your
default PDF editor, with a button to make it your default
- Adds a permanent button in the settings to do it manually (in case
you've dismissed the banner)
- Simplifies the file loading logic to fix a bug where the input file
could be duplicated occasionally. Now, the TS just receives files from
one buffer, regardless of how they've been passed to the app in Rust.

## Caveats
I've only been able to get the setting of default apps working properly
on Mac. The Windows build isn't signed (yet) so we can't use the proper
API for it, so currently it just sends you to the Settings UI. I've also
not been able to test it on Linux at all.
2025-11-17 16:05:33 +00:00
Anthony StirlingandGitHub 28eb9baa02 Enable withCredentials for API client (#4921)
# Description of Changes

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

### 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.
2025-11-17 14:07:58 +00:00
462 changed files with 152306 additions and 117741 deletions
-81
View File
@@ -1,81 +0,0 @@
name: Push Docker Image - V2 Demo (Unified)
on:
workflow_dispatch:
push:
branches:
- demo
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up JDK 21
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
java-version: "21"
distribution: "temurin"
- uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
with:
gradle-version: 8.14
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Get version number
id: versionNumber
run: echo "versionNumber=$(./gradlew printVersion --quiet | tail -1)" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_API }}
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Generate tags
id: meta
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: |
${{ secrets.DOCKER_HUB_ORG_USERNAME }}/stirling-pdf
tags: |
type=raw,value=v2-demo
- name: Build and push Unified Dockerfile (v2-demo)
id: build-push-demo
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./docker/Dockerfile.unified
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: VERSION_TAG=${{ steps.versionNumber.outputs.versionNumber }}
platforms: linux/amd64
provenance: true
sbom: true
+307 -4
View File
@@ -14,7 +14,7 @@ on:
- macos
- linux
pull_request:
branches: [main, V2]
branches: [main, V2, V2-tauri-windows]
paths:
- 'frontend/src-tauri/**'
- 'frontend/src/desktop/**'
@@ -61,6 +61,9 @@ jobs:
fail-fast: false
matrix: ${{ fromJson(needs.determine-matrix.outputs.matrix) }}
runs-on: ${{ matrix.platform }}
env:
SM_API_KEY: ${{ secrets.SM_API_KEY }}
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
@@ -89,8 +92,6 @@ jobs:
toolchain: stable
targets: ${{ (matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel') && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Set up JDK 21
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
@@ -174,6 +175,84 @@ jobs:
working-directory: ./frontend
run: npm install
# DigiCert KeyLocker Setup (Cloud HSM)
- name: Setup DigiCert KeyLocker
id: digicert-setup
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY != '' && github.ref == 'refs/heads/main' }}
uses: digicert/ssm-code-signing@v1.1.0
env:
SM_API_KEY: ${{ secrets.SM_API_KEY }}
SM_CLIENT_CERT_FILE_B64: ${{ secrets.SM_CLIENT_CERT_FILE_B64 }}
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
SM_KEYPAIR_ALIAS: ${{ secrets.SM_KEYPAIR_ALIAS }}
SM_HOST: ${{ secrets.SM_HOST }}
- name: Setup DigiCert KeyLocker Certificate
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY != '' && github.ref == 'refs/heads/main' }}
shell: pwsh
run: |
Write-Host "Setting up DigiCert KeyLocker environment..."
# Decode client certificate
$certBytes = [Convert]::FromBase64String("${{ secrets.SM_CLIENT_CERT_FILE_B64 }}")
$certPath = "D:\Certificate_pkcs12.p12"
[IO.File]::WriteAllBytes($certPath, $certBytes)
# Set environment variables
echo "SM_CLIENT_CERT_FILE=D:\Certificate_pkcs12.p12" >> $env:GITHUB_ENV
echo "SM_HOST=${{ secrets.SM_HOST }}" >> $env:GITHUB_ENV
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> $env:GITHUB_ENV
echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> $env:GITHUB_ENV
echo "SM_KEYPAIR_ALIAS=${{ secrets.SM_KEYPAIR_ALIAS }}" >> $env:GITHUB_ENV
# Get PKCS11 config path from DigiCert action
$pkcs11Config = $env:PKCS11_CONFIG
if ($pkcs11Config) {
Write-Host "Found PKCS11_CONFIG: $pkcs11Config"
echo "PKCS11_CONFIG=$pkcs11Config" >> $env:GITHUB_ENV
} else {
Write-Host "PKCS11_CONFIG not set by DigiCert action, using default path"
$defaultPath = "C:\Users\RUNNER~1\AppData\Local\Temp\smtools-windows-x64\pkcs11properties.cfg"
if (Test-Path $defaultPath) {
Write-Host "Found config at default path: $defaultPath"
echo "PKCS11_CONFIG=$defaultPath" >> $env:GITHUB_ENV
} else {
Write-Host "Warning: Could not find PKCS11 config file"
}
}
# Traditional PFX Certificate Import (fallback if KeyLocker not configured)
- name: Import Windows Code Signing Certificate
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY == '' && github.ref == 'refs/heads/main' }}
env:
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
shell: powershell
run: |
if ($env:WINDOWS_CERTIFICATE) {
Write-Host "Importing Windows Code Signing Certificate..."
# Decode base64 certificate and save to file
$certBytes = [Convert]::FromBase64String($env:WINDOWS_CERTIFICATE)
$certPath = Join-Path $env:RUNNER_TEMP "certificate.pfx"
[IO.File]::WriteAllBytes($certPath, $certBytes)
# Import certificate to CurrentUser\My store
$cert = Import-PfxCertificate -FilePath $certPath -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -AsPlainText -Force)
# Extract and set thumbprint as environment variable
$thumbprint = $cert.Thumbprint
Write-Host "Certificate imported with thumbprint: $thumbprint"
echo "WINDOWS_CERTIFICATE_THUMBPRINT=$thumbprint" >> $env:GITHUB_ENV
# Clean up certificate file
Remove-Item $certPath
Write-Host "Windows certificate import completed."
} else {
Write-Host "⚠️ WINDOWS_CERTIFICATE secret not set - building unsigned binary"
}
- name: Import Apple Developer Certificate
if: matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel'
env:
@@ -229,13 +308,177 @@ jobs:
APPLE_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPIMAGETOOL_SIGN_PASSPHRASE: ${{ secrets.APPIMAGETOOL_SIGN_PASSPHRASE }}
SIGN: 1
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY: ${{ secrets.VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY }}
VITE_SAAS_SERVER_URL: ${{ secrets.VITE_SAAS_SERVER_URL }}
# Only enable Windows signing in Tauri when on main
SIGN: ${{ github.ref == 'refs/heads/main' && (env.SM_API_KEY == '' && env.WINDOWS_CERTIFICATE != '') && '1' || '0' }}
CI: true
with:
projectPath: ./frontend
tauriScript: npx tauri
args: ${{ matrix.args }}
# Sign with DigiCert KeyLocker (post-build)
- name: Sign Windows binaries with DigiCert KeyLocker
if: ${{ matrix.platform == 'windows-latest' && env.SM_API_KEY != '' && github.ref == 'refs/heads/main' }}
shell: pwsh
run: |
Write-Host "=== DigiCert KeyLocker Signing ==="
# Test smctl connectivity first
Write-Host "Testing smctl connection..."
$healthCheck = & smctl healthcheck 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host "[SUCCESS] Connected to DigiCert KeyLocker"
} else {
Write-Host "[ERROR] Failed to connect to DigiCert KeyLocker"
Write-Host $healthCheck
exit 1
}
Write-Host ""
# Sync certificates to Windows certificate store
Write-Host "Syncing certificates to Windows certificate store..."
$syncOutput = & smctl windows certsync 2>&1
Write-Host "Cert sync result: $syncOutput"
Write-Host ""
# List available certificates and check if they have certificates attached
Write-Host "Checking for available certificates..."
$certList = & smctl keypair ls 2>&1
Write-Host "Keypair list output:"
Write-Host $certList
Write-Host ""
# Parse the output to check certificate status
$lines = $certList -split "`n"
$foundKeypair = $false
$hasCertificate = $false
foreach ($line in $lines) {
if ($line -match "${{ secrets.SM_KEYPAIR_ALIAS }}") {
$foundKeypair = $true
Write-Host "[SUCCESS] Found keypair in list"
# Check if this line has certificate info (not just empty spaces after alias)
$parts = $line -split "\s+"
if ($parts.Count -gt 2 -and $parts[1] -ne "" -and $parts[1] -ne "CERTIFICATE") {
$hasCertificate = $true
Write-Host "[SUCCESS] Certificate is associated with keypair"
}
}
}
if (-not $foundKeypair) {
Write-Host "[ERROR] Keypair not found: ${{ secrets.SM_KEYPAIR_ALIAS }}"
Write-Host "Available keypairs are listed above"
Write-Host ""
Write-Host "Please verify:"
Write-Host " 1. Keypair alias is correct in GitHub secret"
Write-Host " 2. API key has access to this keypair"
exit 1
}
if (-not $hasCertificate) {
Write-Host "[ERROR] No certificate associated with keypair"
Write-Host "This usually means:"
Write-Host " 1. Certificate not yet synced to KeyLocker (run sync manually)"
Write-Host " 2. Certificate is pending approval"
Write-Host " 3. Certificate needs to be attached to the keypair"
Write-Host ""
Write-Host "Try running in DigiCert ONE portal:"
Write-Host " smctl keypair sync"
exit 1
}
Write-Host "[SUCCESS] Certificate check passed"
Write-Host ""
# Find only the files we need to sign (not build scripts)
$filesToSign = @()
# Main application executable
$mainExe = Get-ChildItem -Path "./frontend/src-tauri/target/x86_64-pc-windows-msvc/release" -Filter "stirling-pdf.exe" -File -ErrorAction SilentlyContinue
if ($mainExe) { $filesToSign += $mainExe }
# MSI installer
$msiFiles = Get-ChildItem -Path "./frontend/src-tauri/target" -Filter "*.msi" -Recurse -File
$filesToSign += $msiFiles
if ($filesToSign.Count -eq 0) {
Write-Host "[ERROR] No files found to sign"
exit 1
}
Write-Host "Found $($filesToSign.Count) files to sign:"
foreach ($f in $filesToSign) { Write-Host " - $($f.Name)" }
Write-Host ""
$signedCount = 0
foreach ($file in $filesToSign) {
Write-Host "Signing: $($file.Name)"
# Get PKCS11 config file path (set by DigiCert action)
$pkcs11Config = $env:PKCS11_CONFIG
if (-not $pkcs11Config) {
Write-Host "[ERROR] PKCS11_CONFIG environment variable not set"
Write-Host "DigiCert KeyLocker action may not have run correctly"
exit 1
}
Write-Host "Using PKCS11 config: $pkcs11Config"
# Try signing with certificate fingerprint first (if available)
$fingerprint = "${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}"
if ($fingerprint -and $fingerprint -ne "") {
Write-Host "Attempting to sign with certificate fingerprint..."
$output = & smctl sign --fingerprint "$fingerprint" --input "$($file.FullName)" --config-file "$pkcs11Config" --verbose 2>&1
$exitCode = $LASTEXITCODE
} else {
Write-Host "No fingerprint provided, using keypair alias..."
# Use smctl to sign with keypair alias
$output = & smctl sign --keypair-alias "${{ secrets.SM_KEYPAIR_ALIAS }}" --input "$($file.FullName)" --config-file "$pkcs11Config" --verbose 2>&1
$exitCode = $LASTEXITCODE
}
Write-Host "Exit code: $exitCode"
Write-Host "Output: $output"
# Check if output contains "FAILED" even with exit code 0
if ($output -match "FAILED" -or $output -match "error" -or $output -match "Error") {
Write-Host ""
Write-Host "[ERROR] Signing failed for $($file.Name)"
Write-Host "[ERROR] smctl returned success but output indicates failure"
Write-Host ""
Write-Host "Possible issues:"
Write-Host " 1. Certificate not fully synced to KeyLocker (wait a few minutes)"
Write-Host " 2. Incorrect keypair alias"
Write-Host " 3. API key lacks signing permissions"
Write-Host ""
Write-Host "Please verify in DigiCert ONE portal:"
Write-Host " - Certificate status is 'Issued' (not Pending)"
Write-Host " - Keypair status is 'Online'"
Write-Host " - 'Can sign' is set to 'Yes'"
exit 1
}
if ($exitCode -ne 0) {
Write-Host "[ERROR] Failed to sign $($file.Name)"
Write-Host "Full error output:"
Write-Host $output
exit 1
}
$signedCount++
Write-Host "[SUCCESS] Signed: $($file.Name)"
Write-Host ""
}
Write-Host "=== Summary ==="
Write-Host "[SUCCESS] Signed $signedCount/$($filesToSign.Count) files successfully"
- name: Verify notarization (macOS only)
if: matrix.platform == 'macos-15' || matrix.platform == 'macos-15-intel'
run: |
@@ -269,6 +512,66 @@ jobs:
find . -name "*.AppImage" -exec cp {} "../../../dist/Stirling-PDF-${{ matrix.name }}.AppImage" \;
fi
- name: Verify Windows Code Signature
if: matrix.platform == 'windows-latest' && github.ref == 'refs/heads/main'
shell: pwsh
run: |
Write-Host "Verifying Windows code signatures..."
$exePath = "./dist/Stirling-PDF-${{ matrix.name }}.exe"
$msiPath = "./dist/Stirling-PDF-${{ matrix.name }}.msi"
$allSigned = $true
$usingKeyLocker = "${{ env.SM_API_KEY }}" -ne ""
$usingPfx = "${{ env.WINDOWS_CERTIFICATE }}" -ne ""
# Check EXE signature
if (Test-Path $exePath) {
$exeSig = Get-AuthenticodeSignature -FilePath $exePath
Write-Host "EXE Signature Status: $($exeSig.Status)"
Write-Host "EXE Signer: $($exeSig.SignerCertificate.Subject)"
Write-Host "EXE Timestamp: $($exeSig.TimeStamperCertificate.NotAfter)"
if ($exeSig.Status -ne "Valid") {
Write-Host "[WARNING] EXE is not properly signed (Status: $($exeSig.Status))"
if ($usingKeyLocker -or $usingPfx) {
Write-Host "[ERROR] Certificate was provided but signing failed"
$allSigned = $false
} else {
Write-Host "[INFO] Building unsigned binary (no certificate provided)"
}
} else {
Write-Host "[SUCCESS] EXE is properly signed"
}
}
# Check MSI signature
if (Test-Path $msiPath) {
$msiSig = Get-AuthenticodeSignature -FilePath $msiPath
Write-Host "MSI Signature Status: $($msiSig.Status)"
Write-Host "MSI Signer: $($msiSig.SignerCertificate.Subject)"
Write-Host "MSI Timestamp: $($msiSig.TimeStamperCertificate.NotAfter)"
if ($msiSig.Status -ne "Valid") {
Write-Host "[WARNING] MSI is not properly signed (Status: $($msiSig.Status))"
if ($usingKeyLocker -or $usingPfx) {
Write-Host "[ERROR] Certificate was provided but signing failed"
$allSigned = $false
} else {
Write-Host "[INFO] Building unsigned binary (no certificate provided)"
}
} else {
Write-Host "[SUCCESS] MSI is properly signed"
}
}
if (($usingKeyLocker -or $usingPfx) -and -not $allSigned) {
Write-Host "[ERROR] Code signing verification failed"
exit 1
} else {
Write-Host "[SUCCESS] Code signature verification completed"
}
- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
+1
View File
@@ -33,6 +33,7 @@ SwaggerDoc.json
# Gradle
.gradle
.gradle-home
.lock
# External tool builders
+37 -37
View File
@@ -115,46 +115,46 @@ Stirling-PDF currently supports 40 languages!
| Language | Progress |
| -------------------------------------------- | -------------------------------------- |
| Arabic (العربية) (ar_AR) | ![64%](https://geps.dev/progress/64) |
| Azerbaijani (Azərbaycan Dili) (az_AZ) | ![24%](https://geps.dev/progress/24) |
| Basque (Euskara) (eu_ES) | ![14%](https://geps.dev/progress/14) |
| Bulgarian (Български) (bg_BG) | ![26%](https://geps.dev/progress/26) |
| Catalan (Català) (ca_CA) | ![26%](https://geps.dev/progress/26) |
| Croatian (Hrvatski) (hr_HR) | ![24%](https://geps.dev/progress/24) |
| Czech (Česky) (cs_CZ) | ![26%](https://geps.dev/progress/26) |
| Danish (Dansk) (da_DK) | ![23%](https://geps.dev/progress/23) |
| Dutch (Nederlands) (nl_NL) | ![23%](https://geps.dev/progress/23) |
| Arabic (العربية) (ar_AR) | ![87%](https://geps.dev/progress/87) |
| Azerbaijani (Azərbaycan Dili) (az_AZ) | ![86%](https://geps.dev/progress/86) |
| Basque (Euskara) (eu_ES) | ![86%](https://geps.dev/progress/86) |
| Bulgarian (Български) (bg_BG) | ![86%](https://geps.dev/progress/86) |
| Catalan (Català) (ca_CA) | ![85%](https://geps.dev/progress/85) |
| Croatian (Hrvatski) (hr_HR) | ![86%](https://geps.dev/progress/86) |
| Czech (Česky) (cs_CZ) | ![84%](https://geps.dev/progress/84) |
| Danish (Dansk) (da_DK) | ![85%](https://geps.dev/progress/85) |
| Dutch (Nederlands) (nl_NL) | ![85%](https://geps.dev/progress/85) |
| English (English) (en_GB) | ![100%](https://geps.dev/progress/100) |
| English (US) (en_US) | ![100%](https://geps.dev/progress/100) |
| French (Français) (fr_FR) | ![63%](https://geps.dev/progress/63) |
| German (Deutsch) (de_DE) | ![64%](https://geps.dev/progress/64) |
| Greek (Ελληνικά) (el_GR) | ![26%](https://geps.dev/progress/26) |
| Hindi (हिंदी) (hi_IN) | ![26%](https://geps.dev/progress/26) |
| Hungarian (Magyar) (hu_HU) | ![29%](https://geps.dev/progress/29) |
| Indonesian (Bahasa Indonesia) (id_ID) | ![24%](https://geps.dev/progress/24) |
| Irish (Gaeilge) (ga_IE) | ![26%](https://geps.dev/progress/26) |
| Italian (Italiano) (it_IT) | ![64%](https://geps.dev/progress/64) |
| Japanese (日本語) (ja_JP) | ![47%](https://geps.dev/progress/47) |
| Korean (한국어) (ko_KR) | ![26%](https://geps.dev/progress/26) |
| Norwegian (Norsk) (no_NB) | ![24%](https://geps.dev/progress/24) |
| Persian (فارسی) (fa_IR) | ![26%](https://geps.dev/progress/26) |
| Polish (Polski) (pl_PL) | ![27%](https://geps.dev/progress/27) |
| Portuguese (Português) (pt_PT) | ![26%](https://geps.dev/progress/26) |
| Portuguese Brazilian (Português) (pt_BR) | ![64%](https://geps.dev/progress/64) |
| Romanian (Română) (ro_RO) | ![22%](https://geps.dev/progress/22) |
| Russian (Русский) (ru_RU) | ![63%](https://geps.dev/progress/63) |
| Serbian Latin alphabet (Srpski) (sr_LATN_RS) | ![28%](https://geps.dev/progress/28) |
| Simplified Chinese (简体中文) (zh_CN) | ![65%](https://geps.dev/progress/65) |
| Slovakian (Slovensky) (sk_SK) | ![19%](https://geps.dev/progress/19) |
| Slovenian (Slovenščina) (sl_SI) | ![27%](https://geps.dev/progress/27) |
| Spanish (Español) (es_ES) | ![64%](https://geps.dev/progress/64) |
| Swedish (Svenska) (sv_SE) | ![25%](https://geps.dev/progress/25) |
| Thai (ไทย) (th_TH) | ![23%](https://geps.dev/progress/23) |
| French (Français) (fr_FR) | ![85%](https://geps.dev/progress/85) |
| German (Deutsch) (de_DE) | ![86%](https://geps.dev/progress/86) |
| Greek (Ελληνικά) (el_GR) | ![86%](https://geps.dev/progress/86) |
| Hindi (हिंदी) (hi_IN) | ![86%](https://geps.dev/progress/86) |
| Hungarian (Magyar) (hu_HU) | ![86%](https://geps.dev/progress/86) |
| Indonesian (Bahasa Indonesia) (id_ID) | ![85%](https://geps.dev/progress/85) |
| Irish (Gaeilge) (ga_IE) | ![86%](https://geps.dev/progress/86) |
| Italian (Italiano) (it_IT) | ![85%](https://geps.dev/progress/85) |
| Japanese (日本語) (ja_JP) | ![86%](https://geps.dev/progress/86) |
| Korean (한국어) (ko_KR) | ![86%](https://geps.dev/progress/86) |
| Norwegian (Norsk) (no_NB) | ![86%](https://geps.dev/progress/86) |
| Persian (فارسی) (fa_IR) | ![86%](https://geps.dev/progress/86) |
| Polish (Polski) (pl_PL) | ![86%](https://geps.dev/progress/86) |
| Portuguese (Português) (pt_PT) | ![86%](https://geps.dev/progress/86) |
| Portuguese Brazilian (Português) (pt_BR) | ![86%](https://geps.dev/progress/86) |
| Romanian (Română) (ro_RO) | ![85%](https://geps.dev/progress/85) |
| Russian (Русский) (ru_RU) | ![86%](https://geps.dev/progress/86) |
| Serbian Latin alphabet (Srpski) (sr_LATN_RS) | ![86%](https://geps.dev/progress/86) |
| Simplified Chinese (简体中文) (zh_CN) | ![87%](https://geps.dev/progress/87) |
| Slovakian (Slovensky) (sk_SK) | ![86%](https://geps.dev/progress/86) |
| Slovenian (Slovenščina) (sl_SI) | ![86%](https://geps.dev/progress/86) |
| Spanish (Español) (es_ES) | ![86%](https://geps.dev/progress/86) |
| Swedish (Svenska) (sv_SE) | ![86%](https://geps.dev/progress/86) |
| Thai (ไทย) (th_TH) | ![86%](https://geps.dev/progress/86) |
| Tibetan (བོད་ཡིག་) (bo_CN) | ![65%](https://geps.dev/progress/65) |
| Traditional Chinese (繁體中文) (zh_TW) | ![29%](https://geps.dev/progress/29) |
| Turkish (Türkçe) (tr_TR) | ![28%](https://geps.dev/progress/28) |
| Ukrainian (Українська) (uk_UA) | ![28%](https://geps.dev/progress/28) |
| Vietnamese (Tiếng Việt) (vi_VN) | ![21%](https://geps.dev/progress/21) |
| Traditional Chinese (繁體中文) (zh_TW) | ![87%](https://geps.dev/progress/87) |
| Turkish (Türkçe) (tr_TR) | ![86%](https://geps.dev/progress/86) |
| Ukrainian (Українська) (uk_UA) | ![86%](https://geps.dev/progress/86) |
| Vietnamese (Tiếng Việt) (vi_VN) | ![86%](https://geps.dev/progress/86) |
| Malayalam (മലയാളം) (ml_IN) | ![73%](https://geps.dev/progress/73) |
## Stirling PDF Enterprise
+258
View File
@@ -0,0 +1,258 @@
# Windows Code Signing Setup Guide
This guide explains how to set up Windows code signing for Stirling-PDF desktop application builds.
## Overview
Windows code signing is essential for:
- Preventing Windows SmartScreen warnings
- Building trust with users
- Enabling Microsoft Store distribution
- Professional application distribution
## Certificate Types
### OV Certificate (Organization Validated)
- More affordable option
- Requires business verification
- May trigger SmartScreen warnings initially until reputation builds
- Suitable for most independent software vendors
### EV Certificate (Extended Validation)
- Premium option with immediate SmartScreen reputation
- Requires hardware security module (HSM) or cloud-based signing
- Higher cost but provides immediate trust
- Required since June 2023 for new certificates
## Obtaining a Certificate
### Certificate Authorities
Popular certificate authorities for Windows code signing:
- DigiCert
- Sectigo (formerly Comodo)
- GlobalSign
- SSL.com
### Certificate Format
You'll receive a certificate in one of these formats:
- `.pfx` or `.p12` (preferred - contains both certificate and private key)
- `.cer` + private key (needs conversion to .pfx)
### Converting to PFX (if needed)
If you have separate certificate and private key files:
```bash
openssl pkcs12 -export -out certificate.pfx -inkey private-key.key -in certificate.cer
```
## Setting Up GitHub Secrets
### Required Secrets
Navigate to your GitHub repository → Settings → Secrets and variables → Actions
Add the following secrets:
#### 1. `WINDOWS_CERTIFICATE`
- **Description**: Base64-encoded .pfx certificate file
- **How to create**:
**On macOS/Linux:**
```bash
base64 -i certificate.pfx | pbcopy # Copies to clipboard
```
**On Windows (PowerShell):**
```powershell
[Convert]::ToBase64String([IO.File]::ReadAllBytes("certificate.pfx")) | Set-Clipboard
```
Paste the entire base64 string into the GitHub secret.
#### 2. `WINDOWS_CERTIFICATE_PASSWORD`
- **Description**: Password for the .pfx certificate
- **Value**: The password you set when creating/exporting the .pfx file
### Optional Secrets for Tauri Updater
If you're using Tauri's built-in updater feature:
#### `TAURI_SIGNING_PRIVATE_KEY`
- Generated using Tauri CLI: `npm run tauri signer generate`
- Used for update package verification
#### `TAURI_SIGNING_PRIVATE_KEY_PASSWORD`
- Password for the Tauri signing key
## Configuration Files
### 1. Tauri Configuration (frontend/src-tauri/tauri.conf.json)
The Windows signing configuration is already set up:
```json
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": "http://timestamp.digicert.com"
}
```
**Configuration Options:**
- `certificateThumbprint`: Automatically extracted from imported certificate (leave as `null`)
- `digestAlgorithm`: Hashing algorithm - `sha256` is recommended
- `timestampUrl`: Timestamp server to prove signing time (survives certificate expiration)
**Alternative Timestamp Servers:**
- DigiCert: `http://timestamp.digicert.com`
- Sectigo: `http://timestamp.sectigo.com`
- GlobalSign: `http://timestamp.globalsign.com`
### 2. GitHub Workflow (.github/workflows/tauri-build.yml)
The workflow includes three Windows signing steps:
1. **Import Certificate**: Decodes and imports the .pfx certificate into Windows certificate store
2. **Build Tauri App**: Builds and signs the application using the imported certificate
3. **Verify Signature**: Validates that both .exe and .msi files are properly signed
## Testing the Setup
### 1. Local Testing (Windows Only)
Before pushing to GitHub, test locally:
```powershell
# Set environment variables
$env:WINDOWS_CERTIFICATE = [Convert]::ToBase64String([IO.File]::ReadAllBytes("certificate.pfx"))
$env:WINDOWS_CERTIFICATE_PASSWORD = "your-certificate-password"
# Build the application
cd frontend
npm run tauri build
# Verify the signature
Get-AuthenticodeSignature "./src-tauri/target/release/bundle/msi/Stirling-PDF_*.msi"
```
### 2. GitHub Actions Testing
1. Push your changes to a branch
2. Manually trigger the workflow:
- Go to Actions → Build Tauri Applications
- Click "Run workflow"
- Select "windows" platform
3. Check the build logs for:
- ✅ Certificate import success
- ✅ Build completion
- ✅ Signature verification
### 3. Verifying Signed Binaries
After downloading the built artifacts:
**Windows (PowerShell):**
```powershell
Get-AuthenticodeSignature "Stirling-PDF-windows-x86_64.exe"
Get-AuthenticodeSignature "Stirling-PDF-windows-x86_64.msi"
```
Look for:
- Status: `Valid`
- Signer: Your organization name
- Timestamp: Recent date/time
**Windows (GUI):**
1. Right-click the .exe or .msi file
2. Select "Properties"
3. Go to "Digital Signatures" tab
4. Verify signature details
## Troubleshooting
### "HashMismatch" Status
- Certificate doesn't match the binary
- Possible file corruption during download
- Re-download and verify
### "NotSigned" Status
- Certificate wasn't imported correctly
- Check GitHub secrets are set correctly
- Verify base64 encoding is complete (no truncation)
### "UnknownError" Status
- Timestamp server unreachable
- Try alternative timestamp URL in tauri.conf.json
- Check network connectivity in GitHub Actions
### SmartScreen Still Shows Warnings
- Normal for OV certificates initially
- Reputation builds over time with user downloads
- Consider EV certificate for immediate reputation
### Certificate Not Found During Build
- Verify `WINDOWS_CERTIFICATE` secret is set
- Check base64 encoding is correct (no extra whitespace)
- Ensure password is correct
## Security Best Practices
1. **Never commit certificates to version control**
- Keep .pfx files secure and backed up
- Use GitHub secrets for CI/CD
2. **Rotate certificates before expiration**
- Set calendar reminders
- Update GitHub secrets with new certificate
3. **Use strong passwords**
- Certificate password should be complex
- Store securely (password manager)
4. **Monitor certificate usage**
- Review GitHub Actions logs
- Set up notifications for failed builds
5. **Limit access to secrets**
- Only repository admins should access secrets
- Audit secret access regularly
## Certificate Lifecycle
### Before Expiration
1. Obtain new certificate from CA (typically annual renewal)
2. Convert to .pfx format if needed
3. Update `WINDOWS_CERTIFICATE` secret with new base64-encoded certificate
4. Update `WINDOWS_CERTIFICATE_PASSWORD` if password changed
5. Test build to verify new certificate works
### Expired Certificates
- Signed binaries remain valid (timestamp proves signing time)
- New builds will fail until certificate is renewed
- Users can still install previously signed versions
## Cost Considerations
### Certificate Costs (Annual, as of 2024)
- **OV Certificate**: $100-400/year
- **EV Certificate**: $400-1000/year
### Choosing the Right Certificate
- **Open source / early stage**: Start with OV
- **Commercial / enterprise**: Consider EV for better trust
- **Microsoft Store**: EV certificate required
## Additional Resources
- [Tauri Windows Signing Documentation](https://v2.tauri.app/distribute/sign/windows/)
- [Microsoft Code Signing Overview](https://docs.microsoft.com/windows/win32/seccrypto/cryptography-tools)
- [DigiCert Code Signing Guide](https://www.digicert.com/signing/code-signing-certificates)
- [Windows SmartScreen FAQ](https://support.microsoft.com/windows/smartscreen-faq)
## Support
If you encounter issues with Windows code signing:
1. Check GitHub Actions logs for detailed error messages
2. Verify all secrets are set correctly
3. Test certificate locally first (Windows environment required)
4. Open an issue in the repository with relevant logs (remove sensitive data)
@@ -18,11 +18,37 @@ import stirling.software.common.model.ApplicationProperties;
@Slf4j
public class EndpointConfiguration {
public enum DisableReason {
CONFIG,
DEPENDENCY,
UNKNOWN
}
public static class EndpointAvailability {
private final boolean enabled;
private final DisableReason reason;
public EndpointAvailability(boolean enabled, DisableReason reason) {
this.enabled = enabled;
this.reason = reason;
}
public boolean isEnabled() {
return enabled;
}
public DisableReason getReason() {
return reason;
}
}
private static final String REMOVE_BLANKS = "remove-blanks";
private final ApplicationProperties applicationProperties;
@Getter private Map<String, Boolean> endpointStatuses = new ConcurrentHashMap<>();
private Map<String, Set<String>> endpointGroups = new ConcurrentHashMap<>();
private Set<String> disabledGroups = new HashSet<>();
private Map<String, DisableReason> endpointDisableReasons = new ConcurrentHashMap<>();
private Map<String, DisableReason> groupDisableReasons = new ConcurrentHashMap<>();
private Map<String, Set<String>> endpointAlternatives = new ConcurrentHashMap<>();
private final boolean runningProOrHigher;
@@ -35,16 +61,31 @@ public class EndpointConfiguration {
processEnvironmentConfigs();
}
private String normalizeEndpoint(String endpoint) {
if (endpoint == null) {
return null;
}
return endpoint.startsWith("/") ? endpoint.substring(1) : endpoint;
}
public void enableEndpoint(String endpoint) {
endpointStatuses.put(endpoint, true);
log.debug("Enabled endpoint: {}", endpoint);
String normalized = normalizeEndpoint(endpoint);
endpointStatuses.put(normalized, true);
endpointDisableReasons.remove(normalized);
log.debug("Enabled endpoint: {}", normalized);
}
public void disableEndpoint(String endpoint) {
if (!Boolean.FALSE.equals(endpointStatuses.get(endpoint))) {
log.debug("Disabling endpoint: {}", endpoint);
disableEndpoint(endpoint, DisableReason.CONFIG);
}
public void disableEndpoint(String endpoint, DisableReason reason) {
String normalized = normalizeEndpoint(endpoint);
if (!Boolean.FALSE.equals(endpointStatuses.get(normalized))) {
log.debug("Disabling endpoint: {}", normalized);
}
endpointStatuses.put(endpoint, false);
endpointStatuses.put(normalized, false);
endpointDisableReasons.put(normalized, reason);
}
public boolean isEndpointEnabled(String endpoint) {
@@ -150,6 +191,10 @@ public class EndpointConfiguration {
}
public void disableGroup(String group) {
disableGroup(group, DisableReason.CONFIG);
}
public void disableGroup(String group, DisableReason reason) {
if (disabledGroups.add(group)) {
if (isToolGroup(group)) {
log.debug(
@@ -161,11 +206,12 @@ public class EndpointConfiguration {
group);
}
}
groupDisableReasons.put(group, reason);
// Only cascade to endpoints for *functional* groups
if (!isToolGroup(group)) {
Set<String> endpoints = endpointGroups.get(group);
if (endpoints != null) {
endpoints.forEach(this::disableEndpoint);
endpoints.forEach(endpoint -> disableEndpoint(endpoint, reason));
}
}
}
@@ -174,12 +220,39 @@ public class EndpointConfiguration {
if (disabledGroups.remove(group)) {
log.debug("Enabling group: {}", group);
}
groupDisableReasons.remove(group);
Set<String> endpoints = endpointGroups.get(group);
if (endpoints != null) {
endpoints.forEach(this::enableEndpoint);
}
}
public EndpointAvailability getEndpointAvailability(String endpoint) {
boolean enabled = isEndpointEnabled(endpoint);
DisableReason reason = enabled ? null : determineDisableReason(endpoint);
return new EndpointAvailability(enabled, reason);
}
private DisableReason determineDisableReason(String endpoint) {
String normalized = normalizeEndpoint(endpoint);
if (Boolean.FALSE.equals(endpointStatuses.get(normalized))) {
return endpointDisableReasons.getOrDefault(normalized, DisableReason.CONFIG);
}
for (Map.Entry<String, Set<String>> entry : endpointGroups.entrySet()) {
String group = entry.getKey();
Set<String> endpoints = entry.getValue();
if (!disabledGroups.contains(group) || endpoints == null) {
continue;
}
if (endpoints.contains(normalized)) {
return groupDisableReasons.getOrDefault(group, DisableReason.CONFIG);
}
}
return DisableReason.UNKNOWN;
}
public Set<String> getDisabledGroups() {
return new HashSet<>(disabledGroups);
}
@@ -261,6 +334,8 @@ public class EndpointConfiguration {
addEndpointToGroup("Convert", "pdf-to-csv");
addEndpointToGroup("Convert", "pdf-to-markdown");
addEndpointToGroup("Convert", "eml-to-pdf");
addEndpointToGroup("Convert", "cbz-to-pdf");
addEndpointToGroup("Convert", "pdf-to-cbz");
addEndpointToGroup("Convert", "pdf-to-json");
addEndpointToGroup("Convert", "json-to-pdf");
@@ -296,6 +371,12 @@ public class EndpointConfiguration {
addEndpointToGroup("Other", "replace-and-invert-color-pdf");
addEndpointToGroup("Other", "multi-tool");
// Adding form-related endpoints to "Other" group
addEndpointToGroup("Other", "fields");
addEndpointToGroup("Other", "modify-fields");
addEndpointToGroup("Other", "delete-fields");
addEndpointToGroup("Other", "fill");
// Adding endpoints to "Advance" group
addEndpointToGroup("Advance", "adjust-contrast");
addEndpointToGroup("Advance", "compress-pdf");
@@ -390,6 +471,8 @@ public class EndpointConfiguration {
addEndpointToGroup("Java", "pdf-to-markdown");
addEndpointToGroup("Java", "add-attachments");
addEndpointToGroup("Java", "compress-pdf");
addEndpointToGroup("Java", "cbz-to-pdf");
addEndpointToGroup("Java", "pdf-to-cbz");
addEndpointToGroup("Java", "pdf-to-json");
addEndpointToGroup("Java", "json-to-pdf");
addEndpointToGroup("rar", "pdf-to-cbr");
@@ -38,6 +38,7 @@ public class GeneralUtils {
Set.of(
"OCR images.json",
"Prepare-pdfs-for-email.json",
"Pre-publish-sanitization.json",
"split-rotate-auto-rename.json");
private final String DEFAULT_WEBUI_CONFIGS_DIR = "defaultWebUIConfigs";
@@ -12,6 +12,8 @@ import java.util.Properties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;
@@ -198,6 +200,14 @@ public class SPDFApplication {
// }
}
@EventListener
public void onWebServerInitialized(WebServerInitializedEvent event) {
int actualPort = event.getWebServer().getPort();
serverPortStatic = String.valueOf(actualPort);
// Log the actual runtime port for Tauri to parse
log.info("Stirling-PDF running on port: {}", actualPort);
}
private static void printStartupLogs() {
log.info("Stirling-PDF Started.");
String url = baseUrlStatic + ":" + getStaticPort() + contextPathStatic;
@@ -12,6 +12,7 @@ import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import stirling.software.SPDF.config.EndpointConfiguration.DisableReason;
import stirling.software.common.configuration.RuntimePathConfig;
import stirling.software.common.util.RegexPatternUtils;
@@ -24,6 +25,7 @@ public class ExternalAppDepConfig {
private final String weasyprintPath;
private final String unoconvPath;
private final Map<String, List<String>> commandToGroupMapping;
private volatile boolean dependenciesChecked = false;
public ExternalAppDepConfig(
EndpointConfiguration endpointConfiguration, RuntimePathConfig runtimePathConfig) {
@@ -97,7 +99,7 @@ public class ExternalAppDepConfig {
if (affectedGroups != null) {
for (String group : affectedGroups) {
List<String> affectedFeatures = getAffectedFeatures(group);
endpointConfiguration.disableGroup(group);
endpointConfiguration.disableGroup(group, DisableReason.DEPENDENCY);
log.warn(
"Missing dependency: {} - Disabling group: {} (Affected features: {})",
command,
@@ -110,6 +112,10 @@ public class ExternalAppDepConfig {
}
}
public boolean isDependenciesChecked() {
return dependenciesChecked;
}
@PostConstruct
public void checkDependencies() {
// Check core dependencies
@@ -127,8 +133,8 @@ public class ExternalAppDepConfig {
if (!pythonAvailable) {
List<String> pythonFeatures = getAffectedFeatures("Python");
List<String> openCVFeatures = getAffectedFeatures("OpenCV");
endpointConfiguration.disableGroup("Python");
endpointConfiguration.disableGroup("OpenCV");
endpointConfiguration.disableGroup("Python", DisableReason.DEPENDENCY);
endpointConfiguration.disableGroup("OpenCV", DisableReason.DEPENDENCY);
log.warn(
"Missing dependency: Python - Disabling Python features: {} and OpenCV features: {}",
String.join(", ", pythonFeatures),
@@ -146,14 +152,14 @@ public class ExternalAppDepConfig {
int exitCode = process.waitFor();
if (exitCode != 0) {
List<String> openCVFeatures = getAffectedFeatures("OpenCV");
endpointConfiguration.disableGroup("OpenCV");
endpointConfiguration.disableGroup("OpenCV", DisableReason.DEPENDENCY);
log.warn(
"OpenCV not available in Python - Disabling OpenCV features: {}",
String.join(", ", openCVFeatures));
}
} catch (Exception e) {
List<String> openCVFeatures = getAffectedFeatures("OpenCV");
endpointConfiguration.disableGroup("OpenCV");
endpointConfiguration.disableGroup("OpenCV", DisableReason.DEPENDENCY);
log.warn(
"Error checking OpenCV: {} - Disabling OpenCV features: {}",
e.getMessage(),
@@ -161,5 +167,7 @@ public class ExternalAppDepConfig {
}
}
endpointConfiguration.logDisabledEndpointsSummary();
dependenciesChecked = true;
log.info("Dependency checks completed");
}
}
@@ -0,0 +1,49 @@
package stirling.software.SPDF.config;
import java.io.IOException;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import stirling.software.SPDF.service.WeeklyActiveUsersService;
/**
* Filter to track browser IDs for Weekly Active Users (WAU) counting. Only active when security is
* disabled (no-login mode).
*/
@Component
@ConditionalOnProperty(name = "security.enableLogin", havingValue = "false")
@RequiredArgsConstructor
@Slf4j
public class WAUTrackingFilter implements Filter {
private final WeeklyActiveUsersService wauService;
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
if (request instanceof HttpServletRequest httpRequest) {
// Extract browser ID from header
String browserId = httpRequest.getHeader("X-Browser-Id");
if (browserId != null && !browserId.trim().isEmpty()) {
// Record browser access
wauService.recordBrowserAccess(browserId);
}
}
// Continue the filter chain
chain.doFilter(request, response);
}
}
@@ -42,12 +42,28 @@ public class WebMvcConfig implements WebMvcConfigurer {
// Tauri v1 uses tauri://localhost, v2 uses http(s)://tauri.localhost
logger.info("Tauri mode detected - enabling CORS for Tauri protocols (v1 and v2)");
registry.addMapping("/**")
.allowedOrigins(
.allowedOriginPatterns(
"tauri://localhost",
"http://tauri.localhost",
"https://tauri.localhost")
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH")
.allowedHeaders("*")
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
.allowedHeaders(
"Authorization",
"Content-Type",
"X-Requested-With",
"Accept",
"Origin",
"X-API-KEY",
"X-CSRF-TOKEN",
"X-XSRF-TOKEN",
"X-Browser-Id")
.exposedHeaders(
"WWW-Authenticate",
"X-Total-Count",
"X-Page-Number",
"X-Page-Size",
"Content-Disposition",
"Content-Type")
.allowCredentials(true)
.maxAge(3600);
} else if (hasConfiguredOrigins) {
@@ -63,13 +79,53 @@ public class WebMvcConfig implements WebMvcConfigurer {
.toArray(new String[0]);
registry.addMapping("/**")
.allowedOrigins(allowedOrigins)
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH")
.allowedHeaders("*")
.allowedOriginPatterns(allowedOrigins)
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
.allowedHeaders(
"Authorization",
"Content-Type",
"X-Requested-With",
"Accept",
"Origin",
"X-API-KEY",
"X-CSRF-TOKEN",
"X-XSRF-TOKEN",
"X-Browser-Id")
.exposedHeaders(
"WWW-Authenticate",
"X-Total-Count",
"X-Page-Number",
"X-Page-Size",
"Content-Disposition",
"Content-Type")
.allowCredentials(true)
.maxAge(3600);
} else {
// Default to allowing all origins when nothing is configured
logger.info(
"No CORS allowed origins configured in settings.yml (system.corsAllowedOrigins); allowing all origins.");
registry.addMapping("/**")
.allowedOriginPatterns("*")
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
.allowedHeaders(
"Authorization",
"Content-Type",
"X-Requested-With",
"Accept",
"Origin",
"X-API-KEY",
"X-CSRF-TOKEN",
"X-XSRF-TOKEN",
"X-Browser-Id")
.exposedHeaders(
"WWW-Authenticate",
"X-Total-Count",
"X-Page-Number",
"X-Page-Size",
"Content-Disposition",
"Content-Type")
.allowCredentials(true)
.maxAge(3600);
}
// If no origins are configured and not in Tauri mode, CORS is not enabled (secure by
// default)
}
}
@@ -29,7 +29,6 @@ import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import stirling.software.SPDF.config.swagger.JsonDataResponse;
import stirling.software.SPDF.config.swagger.StandardPdfResponse;
import stirling.software.SPDF.model.api.EditTableOfContentsRequest;
import stirling.software.common.annotations.AutoJobPostMapping;
@@ -49,13 +48,12 @@ public class EditTableOfContentsController {
@AutoJobPostMapping(
value = "/extract-bookmarks",
consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@JsonDataResponse
@Operation(
summary = "Extract PDF Bookmarks",
description = "Extracts bookmarks/table of contents from a PDF document as JSON.")
@ResponseBody
public List<Map<String, Object>> extractBookmarks(@RequestParam("file") MultipartFile file)
throws Exception {
public ResponseEntity<List<Map<String, Object>>> extractBookmarks(
@RequestParam("file") MultipartFile file) throws Exception {
PDDocument document = null;
try {
document = pdfDocumentFactory.load(file);
@@ -63,10 +61,10 @@ public class EditTableOfContentsController {
if (outline == null) {
log.info("No outline/bookmarks found in PDF");
return new ArrayList<>();
return ResponseEntity.ok(new ArrayList<>());
}
return extractBookmarkItems(document, outline);
return ResponseEntity.ok(extractBookmarkItems(document, outline));
} finally {
if (document != null) {
document.close();
@@ -1,6 +1,7 @@
package stirling.software.SPDF.controller.api.misc;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.context.ApplicationContext;
@@ -10,9 +11,13 @@ import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.v3.oas.annotations.Hidden;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.extern.slf4j.Slf4j;
import stirling.software.SPDF.config.EndpointConfiguration;
import stirling.software.SPDF.config.EndpointConfiguration.EndpointAvailability;
import stirling.software.SPDF.config.InitialSetup;
import stirling.software.common.annotations.api.ConfigApi;
import stirling.software.common.configuration.AppConfig;
@@ -30,6 +35,7 @@ public class ConfigController {
private final EndpointConfiguration endpointConfiguration;
private final ServerCertificateServiceInterface serverCertificateService;
private final UserServiceInterface userService;
private final stirling.software.SPDF.config.ExternalAppDepConfig externalAppDepConfig;
public ConfigController(
ApplicationProperties applicationProperties,
@@ -38,12 +44,14 @@ public class ConfigController {
@org.springframework.beans.factory.annotation.Autowired(required = false)
ServerCertificateServiceInterface serverCertificateService,
@org.springframework.beans.factory.annotation.Autowired(required = false)
UserServiceInterface userService) {
UserServiceInterface userService,
stirling.software.SPDF.config.ExternalAppDepConfig externalAppDepConfig) {
this.applicationProperties = applicationProperties;
this.applicationContext = applicationContext;
this.endpointConfiguration = endpointConfiguration;
this.serverCertificateService = serverCertificateService;
this.userService = userService;
this.externalAppDepConfig = externalAppDepConfig;
}
@GetMapping("/app-config")
@@ -51,6 +59,9 @@ public class ConfigController {
Map<String, Object> configData = new HashMap<>();
try {
// Add dependency check status
configData.put("dependenciesReady", externalAppDepConfig.isDependenciesChecked());
// Get AppConfig bean
AppConfig appConfig = applicationContext.getBean(AppConfig.class);
@@ -154,6 +165,25 @@ public class ConfigController {
// EE features not available, continue without them
}
// Add version and machine info for update checking
try {
if (applicationContext.containsBean("appVersion")) {
configData.put(
"appVersion", applicationContext.getBean("appVersion", String.class));
}
if (applicationContext.containsBean("machineType")) {
configData.put(
"machineType", applicationContext.getBean("machineType", String.class));
}
if (applicationContext.containsBean("activeSecurity")) {
configData.put(
"activeSecurity",
applicationContext.getBean("activeSecurity", Boolean.class));
}
} catch (Exception e) {
// Version/machine info not available
}
return ResponseEntity.ok(configData);
} catch (Exception e) {
@@ -181,4 +211,19 @@ public class ConfigController {
}
return ResponseEntity.ok(result);
}
@GetMapping("/endpoints-availability")
public ResponseEntity<Map<String, EndpointAvailability>> getEndpointAvailability(
@RequestParam(name = "endpoints")
@Size(min = 1, max = 100, message = "Must provide between 1 and 100 endpoints")
List<@NotBlank String> endpoints) {
Map<String, EndpointAvailability> result = new HashMap<>();
for (String endpoint : endpoints) {
String trimmedEndpoint = endpoint.trim();
result.put(
trimmedEndpoint,
endpointConfiguration.getEndpointAvailability(trimmedEndpoint));
}
return ResponseEntity.ok(result);
}
}
@@ -196,9 +196,9 @@ public class StampController {
resourceDir =
switch (alphabet) {
case "arabic" -> "static/fonts/NotoSansArabic-Regular.ttf";
case "japanese" -> "static/fonts/Meiryo.ttf";
case "korean" -> "static/fonts/malgun.ttf";
case "chinese" -> "static/fonts/SimSun.ttf";
case "japanese" -> "static/fonts/NotoSansJP-Regular.ttf";
case "korean" -> "static/fonts/NotoSansKR-Regular.ttf";
case "chinese" -> "static/fonts/NotoSansSC-Regular.ttf";
case "thai" -> "static/fonts/NotoSansThai-Regular.ttf";
case "roman" -> "static/fonts/NotoSans-Regular.ttf";
default -> "static/fonts/NotoSans-Regular.ttf";
@@ -171,9 +171,9 @@ public class WatermarkController {
resourceDir =
switch (alphabet) {
case "arabic" -> "static/fonts/NotoSansArabic-Regular.ttf";
case "japanese" -> "static/fonts/Meiryo.ttf";
case "korean" -> "static/fonts/malgun.ttf";
case "chinese" -> "static/fonts/SimSun.ttf";
case "japanese" -> "static/fonts/NotoSansJP-Regular.ttf";
case "korean" -> "static/fonts/NotoSansKR-Regular.ttf";
case "chinese" -> "static/fonts/NotoSansSC-Regular.ttf";
case "thai" -> "static/fonts/NotoSansThai-Regular.ttf";
default -> "static/fonts/NotoSans-Regular.ttf";
};
@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
import stirling.software.SPDF.config.EndpointInspector;
import stirling.software.SPDF.config.StartupApplicationListener;
import stirling.software.SPDF.service.WeeklyActiveUsersService;
import stirling.software.common.annotations.api.InfoApi;
import stirling.software.common.model.ApplicationProperties;
@@ -34,6 +35,7 @@ public class MetricsController {
private final ApplicationProperties applicationProperties;
private final MeterRegistry meterRegistry;
private final EndpointInspector endpointInspector;
private final Optional<WeeklyActiveUsersService> wauService;
private boolean metricsEnabled;
@PostConstruct
@@ -352,6 +354,36 @@ public class MetricsController {
return ResponseEntity.ok(formatDuration(uptime));
}
@GetMapping("/wau")
@Operation(
summary = "Weekly Active Users statistics",
description =
"Returns WAU (Weekly Active Users) count and total unique browsers. "
+ "Only available when security is disabled (no-login mode). "
+ "Tracks unique browsers via client-generated UUID in localStorage.")
public ResponseEntity<?> getWeeklyActiveUsers() {
if (!metricsEnabled) {
return ResponseEntity.status(HttpStatus.FORBIDDEN).body("This endpoint is disabled.");
}
// Check if WAU service is available (only when security.enableLogin=false)
if (wauService.isEmpty()) {
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.body(
"WAU tracking is only available when security is disabled (no-login mode)");
}
WeeklyActiveUsersService service = wauService.get();
Map<String, Object> wauStats = new HashMap<>();
wauStats.put("weeklyActiveUsers", service.getWeeklyActiveUsers());
wauStats.put("totalUniqueBrowsers", service.getTotalUniqueBrowsers());
wauStats.put("daysOnline", service.getDaysOnline());
wauStats.put("trackingSince", service.getStartTime().toString());
return ResponseEntity.ok(wauStats);
}
private String formatDuration(Duration duration) {
long days = duration.toDays();
long hours = duration.toHoursPart();
@@ -0,0 +1,101 @@
package stirling.software.SPDF.service;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
/**
* Service for tracking Weekly Active Users (WAU) in no-login mode. Uses in-memory storage with
* automatic cleanup of old entries.
*/
@Service
@Slf4j
public class WeeklyActiveUsersService {
// Map of browser ID -> last seen timestamp
private final Map<String, Instant> activeBrowsers = new ConcurrentHashMap<>();
// Track total unique browsers seen (overall)
private long totalUniqueBrowsers = 0;
// Application start time
private final Instant startTime = Instant.now();
/**
* Records a browser access with the current timestamp
*
* @param browserId Unique browser identifier from X-Browser-Id header
*/
public void recordBrowserAccess(String browserId) {
if (browserId == null || browserId.trim().isEmpty()) {
return;
}
boolean isNewBrowser = !activeBrowsers.containsKey(browserId);
activeBrowsers.put(browserId, Instant.now());
if (isNewBrowser) {
totalUniqueBrowsers++;
log.debug("New browser recorded: {} (Total: {})", browserId, totalUniqueBrowsers);
}
}
/**
* Gets the count of unique browsers seen in the last 7 days
*
* @return Weekly Active Users count
*/
public long getWeeklyActiveUsers() {
cleanupOldEntries();
return activeBrowsers.size();
}
/**
* Gets the total count of unique browsers ever seen
*
* @return Total unique browsers count
*/
public long getTotalUniqueBrowsers() {
return totalUniqueBrowsers;
}
/**
* Gets the number of days the service has been running
*
* @return Days online
*/
public long getDaysOnline() {
return ChronoUnit.DAYS.between(startTime, Instant.now());
}
/**
* Gets the timestamp when tracking started
*
* @return Start time
*/
public Instant getStartTime() {
return startTime;
}
/** Removes entries older than 7 days */
private void cleanupOldEntries() {
Instant sevenDaysAgo = Instant.now().minus(7, ChronoUnit.DAYS);
activeBrowsers.entrySet().removeIf(entry -> entry.getValue().isBefore(sevenDaysAgo));
}
/** Manual cleanup trigger (can be called by scheduled task if needed) */
public void performCleanup() {
int sizeBefore = activeBrowsers.size();
cleanupOldEntries();
int sizeAfter = activeBrowsers.size();
if (sizeBefore != sizeAfter) {
log.debug("Cleaned up {} old browser entries", sizeBefore - sizeAfter);
}
}
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,54 @@
{
"name": "Pre-publish-sanitization",
"pipeline": [
{
"operation": "/api/v1/security/sanitize-pdf",
"parameters": {
"removeJavaScript": true,
"removeEmbeddedFiles": true,
"removeXMPMetadata": true,
"removeMetadata": true,
"removeLinks": true,
"removeFonts": false
}
},
{
"operation": "/api/v1/misc/flatten",
"parameters": {
"flattenOnlyForms": true
}
},
{
"operation": "/api/v1/general/remove-annotations",
"parameters": {}
},
{
"operation": "/api/v1/misc/update-metadata",
"parameters": {
"deleteAll": true,
"author": "",
"creationDate": "",
"creator": "",
"keywords": "",
"modificationDate": "",
"producer": "",
"subject": "",
"title": "",
"trapped": ""
}
},
{
"operation": "/api/v1/misc/compress-pdf",
"parameters": {
"optimizeLevel": 3,
"expectedOutputSize": ""
}
}
],
"_examples": {
"outputDir": "{outputFolder}/{folderName}",
"outputFileName": "{filename}-{pipelineName}-{date}-{time}"
},
"outputDir": "{outputFolder}",
"outputFileName": "pre_publish_{filename}.PDF"
}
@@ -24,6 +24,7 @@ import org.mockito.ArgumentMatchers;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.mock.web.MockMultipartFile;
@@ -86,9 +87,13 @@ class EditTableOfContentsControllerTest {
when(mockOutlineItem.getNextSibling()).thenReturn(null);
// When
List<Map<String, Object>> result = editTableOfContentsController.extractBookmarks(mockFile);
ResponseEntity<List<Map<String, Object>>> response =
editTableOfContentsController.extractBookmarks(mockFile);
// Then
assertNotNull(response);
assertEquals(HttpStatus.OK, response.getStatusCode());
List<Map<String, Object>> result = response.getBody();
assertNotNull(result);
assertEquals(1, result.size());
@@ -108,9 +113,13 @@ class EditTableOfContentsControllerTest {
when(mockCatalog.getDocumentOutline()).thenReturn(null);
// When
List<Map<String, Object>> result = editTableOfContentsController.extractBookmarks(mockFile);
ResponseEntity<List<Map<String, Object>>> response =
editTableOfContentsController.extractBookmarks(mockFile);
// Then
assertNotNull(response);
assertEquals(HttpStatus.OK, response.getStatusCode());
List<Map<String, Object>> result = response.getBody();
assertNotNull(result);
assertTrue(result.isEmpty());
verify(mockDocument).close();
@@ -142,9 +151,13 @@ class EditTableOfContentsControllerTest {
when(childItem.getNextSibling()).thenReturn(null);
// When
List<Map<String, Object>> result = editTableOfContentsController.extractBookmarks(mockFile);
ResponseEntity<List<Map<String, Object>>> response =
editTableOfContentsController.extractBookmarks(mockFile);
// Then
assertNotNull(response);
assertEquals(HttpStatus.OK, response.getStatusCode());
List<Map<String, Object>> result = response.getBody();
assertNotNull(result);
assertEquals(1, result.size());
@@ -178,9 +191,13 @@ class EditTableOfContentsControllerTest {
when(mockOutlineItem.getNextSibling()).thenReturn(null);
// When
List<Map<String, Object>> result = editTableOfContentsController.extractBookmarks(mockFile);
ResponseEntity<List<Map<String, Object>>> response =
editTableOfContentsController.extractBookmarks(mockFile);
// Then
assertNotNull(response);
assertEquals(HttpStatus.OK, response.getStatusCode());
List<Map<String, Object>> result = response.getBody();
assertNotNull(result);
assertEquals(1, result.size());
@@ -31,10 +31,12 @@ import stirling.software.common.model.api.PDFFile;
import stirling.software.common.service.JobOwnershipService;
import stirling.software.common.util.ExceptionUtils;
import stirling.software.common.util.WebResponseUtils;
import stirling.software.proprietary.security.config.PremiumEndpoint;
@Slf4j
@ConvertApi
@RequiredArgsConstructor
@PremiumEndpoint
public class ConvertPdfJsonController {
private final PdfJsonConversionService pdfJsonConversionService;
@@ -42,12 +44,11 @@ public class ConvertPdfJsonController {
@Autowired(required = false)
private JobOwnershipService jobOwnershipService;
@AutoJobPostMapping(consumes = "multipart/form-data", value = "/pdf/json")
@AutoJobPostMapping(consumes = "multipart/form-data", value = "/pdf/text-editor")
@Operation(
summary = "Convert PDF to JSON",
summary = "Convert PDF to Text Editor Format",
description =
"Extracts PDF text, fonts, and metadata into an editable JSON structure that can be"
+ " transformed back into a PDF. Input:PDF Output:JSON Type:SISO")
"Extracts PDF text, fonts, and metadata into an editable JSON structure for the text editor tool. Input:PDF Output:JSON Type:SISO")
public ResponseEntity<byte[]> convertPdfToJson(
@ModelAttribute PDFFile request,
@RequestParam(value = "lightweight", defaultValue = "false") boolean lightweight)
@@ -67,13 +68,12 @@ public class ConvertPdfJsonController {
return WebResponseUtils.bytesToWebResponse(jsonBytes, docName, MediaType.APPLICATION_JSON);
}
@AutoJobPostMapping(consumes = "multipart/form-data", value = "/json/pdf")
@AutoJobPostMapping(consumes = "multipart/form-data", value = "/text-editor/pdf")
@StandardPdfResponse
@Operation(
summary = "Convert JSON to PDF",
summary = "Convert Text Editor Format to PDF",
description =
"Rebuilds a PDF from the editable JSON structure generated by the PDF to JSON"
+ " endpoint. Input:JSON Output:PDF Type:SISO")
"Rebuilds a PDF from the editable JSON structure generated by the text editor tool. Input:JSON Output:PDF Type:SISO")
public ResponseEntity<byte[]> convertJsonToPdf(@ModelAttribute GeneralFile request)
throws Exception {
MultipartFile jsonFile = request.getFileInput();
@@ -91,11 +91,11 @@ public class ConvertPdfJsonController {
return WebResponseUtils.bytesToWebResponse(pdfBytes, docName);
}
@PostMapping(consumes = "multipart/form-data", value = "/pdf/json/metadata")
@PostMapping(consumes = "multipart/form-data", value = "/pdf/text-editor/metadata")
@Operation(
summary = "Extract PDF metadata for lazy loading",
summary = "Extract PDF metadata for text editor lazy loading",
description =
"Extracts document metadata, fonts, and page dimensions. Caches the document for"
"Extracts document metadata, fonts, and page dimensions for the text editor tool. Caches the document for"
+ " subsequent page requests. Returns a server-generated jobId scoped to the"
+ " authenticated user. Input:PDF Output:JSON Type:SISO")
public ResponseEntity<byte[]> extractPdfMetadata(@ModelAttribute PDFFile request)
@@ -129,13 +129,15 @@ public class ConvertPdfJsonController {
.body(jsonBytes);
}
@PostMapping(value = "/pdf/json/partial/{jobId}", consumes = MediaType.APPLICATION_JSON_VALUE)
@PostMapping(
value = "/pdf/text-editor/partial/{jobId}",
consumes = MediaType.APPLICATION_JSON_VALUE)
@StandardPdfResponse
@Operation(
summary = "Apply incremental edits to a cached PDF",
summary = "Apply incremental edits from text editor to a cached PDF",
description =
"Applies edits for the specified pages of a cached PDF and returns an updated PDF."
+ " Requires the PDF to have been previously cached via the PDF to JSON endpoint."
+ " Requires the PDF to have been previously cached via the text editor metadata endpoint."
+ " The jobId must be obtained from the metadata extraction endpoint.")
public ResponseEntity<byte[]> exportPartialPdf(
@PathVariable String jobId,
@@ -162,12 +164,12 @@ public class ConvertPdfJsonController {
return WebResponseUtils.bytesToWebResponse(pdfBytes, docName);
}
@GetMapping(value = "/pdf/json/page/{jobId}/{pageNumber}")
@GetMapping(value = "/pdf/text-editor/page/{jobId}/{pageNumber}")
@Operation(
summary = "Extract single page from cached PDF",
summary = "Extract single page from cached PDF for text editor",
description =
"Retrieves a single page's content from a previously cached PDF document."
+ " Requires prior call to /pdf/json/metadata. The jobId must belong to the"
"Retrieves a single page's content from a previously cached PDF document for the text editor tool."
+ " Requires prior call to /pdf/text-editor/metadata. The jobId must belong to the"
+ " authenticated user. Output:JSON")
public ResponseEntity<byte[]> extractSinglePage(
@PathVariable String jobId, @PathVariable int pageNumber) throws Exception {
@@ -180,11 +182,11 @@ public class ConvertPdfJsonController {
return WebResponseUtils.bytesToWebResponse(jsonBytes, docName, MediaType.APPLICATION_JSON);
}
@PostMapping(value = "/pdf/json/clear-cache/{jobId}")
@PostMapping(value = "/pdf/text-editor/clear-cache/{jobId}")
@Operation(
summary = "Clear cached PDF document",
summary = "Clear cached PDF document for text editor",
description =
"Manually clears a cached PDF document to free up server resources."
"Manually clears a cached PDF document used by the text editor to free up server resources."
+ " Called automatically after 30 minutes. The jobId must belong to the"
+ " authenticated user.")
public ResponseEntity<Void> clearCache(@PathVariable String jobId) {
@@ -342,7 +342,7 @@ public class PdfJsonConversionService {
document, page, pageNumber, fonts, fontCache, jobId);
pageFontResources.put(pageNumber, resourceMap);
log.debug(
"PDF→JSON: collected {} font resources on page {}",
"PDF->JSON: collected {} font resources on page {}",
resourceMap.size(),
pageNumber);
@@ -454,11 +454,50 @@ public class PdfJsonConversionService {
progress.accept(
PdfJsonConversionProgress.of(95, "serializing", "Generating JSON output"));
log.debug(
"PDF→JSON conversion complete (fonts: {}, pages: {}, lazyImages: {})",
serializedFonts.size(),
pdfJson.getPages().size(),
useLazyImages);
// Collect font issues for summary
java.util.List<String> fontsWithMissingProgram =
serializedFonts.stream()
.filter(
f ->
Boolean.TRUE.equals(f.getEmbedded())
&& (f.getProgram() == null
|| f.getProgram().isEmpty()))
.map(
f -> {
String name =
f.getBaseName() != null
? f.getBaseName()
: "Unknown";
String subtype =
f.getSubtype() != null
? f.getSubtype()
: "Unknown";
// Clean up subset prefix (e.g., "ABCDEF+TimesNewRoman"
// -> "TimesNewRoman")
String cleanName = name.replaceAll("^[A-Z]{6}\\+", "");
return String.format("%s (%s)", cleanName, subtype);
})
.collect(java.util.stream.Collectors.toList());
long type3Fonts =
serializedFonts.stream()
.filter(f -> "Type3".equals(f.getSubtype()))
.count();
if (!fontsWithMissingProgram.isEmpty()) {
log.warn(
"PDF->JSON conversion complete: {} fonts ({} Type3), {} pages. Missing font programs for {} embedded font(s): {}",
serializedFonts.size(),
type3Fonts,
pdfJson.getPages().size(),
fontsWithMissingProgram.size(),
String.join(", ", fontsWithMissingProgram));
} else {
log.info(
"PDF->JSON conversion complete: {} fonts ({} Type3), {} pages",
serializedFonts.size(),
type3Fonts,
pdfJson.getPages().size());
}
byte[] result = objectMapper.writeValueAsBytes(pdfJson);
progress.accept(PdfJsonConversionProgress.complete());
@@ -490,7 +529,7 @@ public class PdfJsonConversionService {
pdfJson.setFonts(fontModels);
}
// Generate synthetic jobId for this JSON→PDF conversion to prevent cache collisions
// Generate synthetic jobId for this JSON->PDF conversion to prevent cache collisions
// Each conversion gets its own namespace for Type3 font caching
String syntheticJobId = "json2pdf:" + java.util.UUID.randomUUID().toString();
@@ -509,6 +548,8 @@ public class PdfJsonConversionService {
}
int pageIndex = 0;
Set<String> allFallbackFontIds = new java.util.HashSet<>();
int pagesWithFallbacks = 0;
for (PdfJsonPage pageModel : pages) {
int pageNumberValue =
pageModel.getPageNumber() != null
@@ -563,7 +604,9 @@ public class PdfJsonConversionService {
if (!preflightResult.fallbackFontIds().isEmpty()) {
ensureFallbackResources(page, preflightResult.fallbackFontIds(), fontMap);
log.info(
allFallbackFontIds.addAll(preflightResult.fallbackFontIds());
pagesWithFallbacks++;
log.debug(
"Page {} registered fallback fonts: {}",
pageNumberValue,
preflightResult.fallbackFontIds());
@@ -655,6 +698,18 @@ public class PdfJsonConversionService {
pdfJson.getFormFields() != null ? pdfJson.getFormFields() : new ArrayList<>();
restoreFormFields(document, formFields);
// Log conversion summary
if (!allFallbackFontIds.isEmpty()) {
log.info(
"JSON->PDF conversion complete: {} pages, {} fallback font(s) used across {} page(s): {}",
pages.size(),
allFallbackFontIds.size(),
pagesWithFallbacks,
allFallbackFontIds);
} else {
log.info("JSON->PDF conversion complete: {} pages", pages.size());
}
try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
document.save(baos);
byte[] result = baos.toByteArray();
@@ -791,7 +846,7 @@ public class PdfJsonConversionService {
if (font.getId() == null) {
return null;
}
// JSON→PDF conversion: no jobId context, pass null
// JSON->PDF conversion: no jobId context, pass null
return buildFontKey(null, font.getPageNumber(), font.getId());
}
@@ -804,7 +859,7 @@ public class PdfJsonConversionService {
if (font == null || font.getId() == null) {
continue;
}
// JSON→PDF conversion: no jobId context, pass null
// JSON->PDF conversion: no jobId context, pass null
lookup.put(buildFontKey(null, font.getPageNumber(), font.getId()), font);
}
return lookup;
@@ -815,7 +870,7 @@ public class PdfJsonConversionService {
if (lookup == null || fontId == null) {
return null;
}
// JSON→PDF conversion: no jobId context, pass null
// JSON->PDF conversion: no jobId context, pass null
PdfJsonFont model = lookup.get(buildFontKey(null, pageNumber, fontId));
if (model != null) {
return model;
@@ -1261,6 +1316,8 @@ public class PdfJsonConversionService {
Set<String> fallbackIds = new LinkedHashSet<>();
boolean fallbackNeeded = false;
Set<String> warnedFonts =
new HashSet<>(); // Track fonts we've already warned about on this page
Map<String, PdfJsonFont> fontLookup = buildFontModelLookup(fontModels);
Map<String, Set<Integer>> type3GlyphCache = new HashMap<>();
@@ -1326,12 +1383,22 @@ public class PdfJsonConversionService {
}
if (!fallbackFontService.canEncodeFully(font, text)) {
log.info(
"[FONT-DEBUG] Font {} (resource {}) cannot encode text '{}' on page {}",
fontModel != null ? fontModel.getId() : "unknown",
element.getFontId(),
text,
pageNumber);
String fontName =
fontModel != null && fontModel.getBaseName() != null
? fontModel
.getBaseName()
.replaceAll("^[A-Z]{6}\\+", "") // Remove subset prefix
: (font != null ? font.getName() : "unknown");
String fontKey = fontName + ":" + element.getFontId() + ":" + pageNumber;
if (!warnedFonts.contains(fontKey)) {
log.warn(
"[FALLBACK-NEEDED] Font '{}' (resource {}, subtype {}) cannot encode text on page {}. Using fallback font.",
fontName,
element.getFontId(),
fontModel != null ? fontModel.getSubtype() : "unknown",
pageNumber);
warnedFonts.add(fontKey);
}
fallbackNeeded = true;
element.setFallbackUsed(Boolean.TRUE);
for (int offset = 0; offset < text.length(); ) {
@@ -1613,17 +1680,17 @@ public class PdfJsonConversionService {
PDStream fontFile2 = descriptor.getFontFile2();
if (fontFile2 != null) {
log.info("[FONT-DEBUG] Font {}: Found FontFile2 (TrueType)", font.getName());
log.debug("[FONT-DEBUG] Font {}: Found FontFile2 (TrueType)", font.getName());
return readFontProgram(fontFile2, null, true, toUnicode);
}
PDStream fontFile = descriptor.getFontFile();
if (fontFile != null) {
log.info("[FONT-DEBUG] Font {}: Found FontFile (Type1)", font.getName());
log.debug("[FONT-DEBUG] Font {}: Found FontFile (Type1)", font.getName());
return readFontProgram(fontFile, "type1", false, toUnicode);
}
log.warn("[FONT-DEBUG] Font {}: No font program found", font.getName());
log.debug("[FONT-DEBUG] Font {}: No font program found", font.getName());
return null;
}
@@ -1638,7 +1705,7 @@ public class PdfJsonConversionService {
if (detectTrueType) {
format = fontService.detectTrueTypeFormat(data);
}
log.info(
log.debug(
"[FONT-DEBUG] Font program: size={} bytes, formatHint={}, detectedFormat={}",
data.length,
formatHint,
@@ -1649,7 +1716,7 @@ public class PdfJsonConversionService {
String pdfBase64 = null;
String pdfFormat = null;
if (format != null && isCffFormat(format)) {
log.info(
log.debug(
"[FONT-DEBUG] Font is CFF format, attempting conversion. CFF conversion enabled: {}, method: {}",
fontService.isCffConversionEnabled(),
fontService.getCffConverterMethod());
@@ -1659,7 +1726,7 @@ public class PdfJsonConversionService {
String detectedFormat = fontService.detectFontFlavor(converted);
webBase64 = Base64.getEncoder().encodeToString(converted);
webFormat = detectedFormat;
log.info(
log.debug(
"[FONT-DEBUG] Primary CFF conversion succeeded: {} bytes -> {}",
data.length,
detectedFormat);
@@ -1668,11 +1735,11 @@ public class PdfJsonConversionService {
pdfFormat = detectedFormat;
}
} else {
log.warn("[FONT-DEBUG] Primary CFF conversion returned null/empty");
log.debug("[FONT-DEBUG] Primary CFF conversion returned null/empty");
}
if (pdfBase64 == null && fontService.isCffConversionEnabled()) {
log.info("[FONT-DEBUG] Attempting fallback FontForge conversion");
log.debug("[FONT-DEBUG] Attempting fallback FontForge conversion");
byte[] ttfConverted = fontService.convertCffUsingFontForge(data);
if (ttfConverted != null && ttfConverted.length > 0) {
String detectedFormat = fontService.detectFontFlavor(ttfConverted);
@@ -1683,24 +1750,24 @@ public class PdfJsonConversionService {
webBase64 = pdfBase64;
webFormat = detectedFormat;
}
log.info(
log.debug(
"[FONT-DEBUG] FontForge conversion succeeded: {} bytes -> {}",
data.length,
detectedFormat);
}
} else {
log.warn("[FONT-DEBUG] FontForge conversion also returned null/empty");
log.debug("[FONT-DEBUG] FontForge conversion also returned null/empty");
}
}
if (webBase64 == null && pdfBase64 == null) {
log.error(
log.warn(
"[FONT-DEBUG] ALL CFF conversions failed - font will not be usable in browser!");
}
} else if (format != null) {
log.info("[FONT-DEBUG] Font is non-CFF format ({}), using as-is", format);
log.debug("[FONT-DEBUG] Font is non-CFF format ({}), using as-is", format);
// For non-CFF formats (TrueType, etc.), preserve original font stream as pdfProgram
// This allows PDFBox to reconstruct the font during JSON→PDF
// This allows PDFBox to reconstruct the font during JSON->PDF
String base64 = Base64.getEncoder().encodeToString(data);
pdfBase64 = base64;
pdfFormat = format;
@@ -2820,12 +2887,7 @@ public class PdfJsonConversionService {
}
}
}
if (targetFont != baseFont) {
log.info(
"Using fallback font '{}' for code point U+{}",
targetFont.getName(),
Integer.toHexString(codePoint));
}
// Fallback applied - tracked at page level, not logged per character
}
boolean useRawType3Glyph =
@@ -3405,7 +3467,7 @@ public class PdfJsonConversionService {
byte[] encoded = font.encode(text);
return sanitizeEncoded(encoded);
} catch (IllegalArgumentException ex) {
log.info(
log.debug(
"[FONT-DEBUG] Font {} cannot encode text '{}': {}",
font.getName(),
text,
@@ -3644,7 +3706,7 @@ public class PdfJsonConversionService {
}
PDFont loadedFont = createFontFromModel(document, fontModel, jobId);
if (loadedFont != null && fontModel.getId() != null) {
// Use null jobId for map keys - JSON→PDF doesn't need job-scoped lookups
// Use null jobId for map keys - JSON->PDF doesn't need job-scoped lookups
// The jobId is only used internally for Type3 cache isolation
fontMap.put(
buildFontKey(null, fontModel.getPageNumber(), fontModel.getId()),
@@ -3659,7 +3721,7 @@ public class PdfJsonConversionService {
PdfJsonFont fallbackModel = fallbackFontService.buildFallbackFontModel();
if (fonts != null) {
fonts.add(fallbackModel);
log.info("Added fallback font definition to JSON font list");
log.debug("Added fallback font definition to JSON font list");
}
PDFont fallbackFont = createFontFromModel(document, fallbackModel, jobId);
fontMap.put(buildFontKey(null, -1, FALLBACK_FONT_ID), fallbackFont);
@@ -4119,7 +4181,7 @@ public class PdfJsonConversionService {
}
applyAdditionalFontMetadata(document, font, fontModel);
log.info(
log.debug(
"[FONT-RESTORE] Successfully restored embedded font {} (subtype={}) from original dictionary",
fontModel.getId(),
font.getSubType());
@@ -44,12 +44,15 @@ public class PdfJsonFallbackFontService {
Map.entry("arial", "fallback-liberation-sans"),
Map.entry("helvetica", "fallback-liberation-sans"),
Map.entry("arimo", "fallback-liberation-sans"),
Map.entry("liberationsans", "fallback-liberation-sans"),
Map.entry("times", "fallback-liberation-serif"),
Map.entry("timesnewroman", "fallback-liberation-serif"),
Map.entry("tinos", "fallback-liberation-serif"),
Map.entry("liberationserif", "fallback-liberation-serif"),
Map.entry("courier", "fallback-liberation-mono"),
Map.entry("couriernew", "fallback-liberation-mono"),
Map.entry("cousine", "fallback-liberation-mono"),
Map.entry("liberationmono", "fallback-liberation-mono"),
// DejaVu fonts - widely used open source fonts
Map.entry("dejavu", "fallback-dejavu-sans"),
Map.entry("dejavusans", "fallback-dejavu-sans"),
@@ -77,7 +80,9 @@ public class PdfJsonFallbackFontService {
Map.entry(
FALLBACK_FONT_KR_ID,
new FallbackFontSpec(
"classpath:/static/fonts/malgun.ttf", "MalgunGothic", "ttf")),
"classpath:/static/fonts/NotoSansKR-Regular.ttf",
"NotoSansKR-Regular",
"ttf")),
Map.entry(
FALLBACK_FONT_AR_ID,
new FallbackFontSpec(
@@ -327,7 +332,8 @@ public class PdfJsonFallbackFontService {
font.encode(text);
return true;
} catch (IOException | IllegalArgumentException | UnsupportedOperationException ex) {
log.info(
// Only log at debug level to reduce verbosity - summary is logged elsewhere
log.debug(
"[FONT-DEBUG] Font {} cannot encode text '{}' ({}): {}",
font != null ? font.getName() : "null",
text,
@@ -93,34 +93,35 @@ public class PdfJsonFontService {
if ("python".equalsIgnoreCase(cffConverterMethod)) {
if (!pythonCffConverterAvailable) {
log.warn("[FONT-DEBUG] Python CFF converter not available, skipping conversion");
log.debug("[FONT-DEBUG] Python CFF converter not available, skipping conversion");
return null;
}
byte[] result = convertCffUsingPython(fontBytes, toUnicode);
log.info(
log.debug(
"[FONT-DEBUG] Python conversion result: {}",
result == null ? "null" : result.length + " bytes");
return result;
} else if ("fontforge".equalsIgnoreCase(cffConverterMethod)) {
if (!fontForgeCffConverterAvailable) {
log.warn("[FONT-DEBUG] FontForge CFF converter not available, skipping conversion");
log.debug(
"[FONT-DEBUG] FontForge CFF converter not available, skipping conversion");
return null;
}
byte[] result = convertCffUsingFontForge(fontBytes);
log.info(
log.debug(
"[FONT-DEBUG] FontForge conversion result: {}",
result == null ? "null" : result.length + " bytes");
return result;
} else {
log.warn(
log.debug(
"[FONT-DEBUG] Unknown CFF converter method: {}, falling back to Python",
cffConverterMethod);
if (!pythonCffConverterAvailable) {
log.warn("[FONT-DEBUG] Python CFF converter not available, skipping conversion");
log.debug("[FONT-DEBUG] Python CFF converter not available, skipping conversion");
return null;
}
byte[] result = convertCffUsingPython(fontBytes, toUnicode);
log.info(
log.debug(
"[FONT-DEBUG] Python conversion result: {}",
result == null ? "null" : result.length + " bytes");
return result;
@@ -182,18 +183,18 @@ public class PdfJsonFontService {
private byte[] convertCffUsingPython(byte[] fontBytes, String toUnicode) {
if (!pythonCffConverterAvailable) {
log.warn("[FONT-DEBUG] Python CFF converter not available");
log.debug("[FONT-DEBUG] Python CFF converter not available");
return null;
}
if (pythonCommand == null
|| pythonCommand.isBlank()
|| pythonScript == null
|| pythonScript.isBlank()) {
log.warn("[FONT-DEBUG] Python converter not configured");
log.debug("[FONT-DEBUG] Python converter not configured");
return null;
}
log.info(
log.debug(
"[FONT-DEBUG] Running Python CFF converter: command={}, script={}",
pythonCommand,
pythonScript);
@@ -208,7 +209,7 @@ public class PdfJsonFontService {
byte[] toUnicodeBytes = Base64.getDecoder().decode(toUnicode);
Files.write(toUnicodeFile.getPath(), toUnicodeBytes);
} catch (IllegalArgumentException ex) {
log.warn(
log.debug(
"[FONT-DEBUG] Failed to decode ToUnicode data for CFF conversion: {}",
ex.getMessage());
return null;
@@ -220,7 +221,7 @@ public class PdfJsonFontService {
inputFile.getAbsolutePath(),
outputFile.getAbsolutePath(),
toUnicodeFile != null ? toUnicodeFile.getAbsolutePath() : null);
log.info("[FONT-DEBUG] Executing: {}", String.join(" ", command));
log.debug("[FONT-DEBUG] Executing: {}", String.join(" ", command));
ProcessExecutorResult result =
ProcessExecutor.getInstance(ProcessExecutor.Processes.CFF_CONVERTER)
@@ -108,7 +108,7 @@ public class Type3FontConversionService {
if (result.getStrategyLabel() == null) {
result.setStrategyLabel(strategy.getLabel());
}
log.info(
log.debug(
"[TYPE3] Strategy {} finished with status {} (message: {}) for font {}",
strategy.getId(),
result.getStatus(),
@@ -120,6 +120,37 @@ public class ProprietaryUIDataController {
// Add enableLogin flag so frontend doesn't need to call /app-config
data.setEnableLogin(securityProps.getEnableLogin());
// Check if this is first-time setup with default credentials
// The isFirstLogin flag captures: default username/password usage and unchanged state
boolean isFirstTimeSetup = false;
boolean showDefaultCredentials = false;
List<User> allUsers = userRepository.findAll();
List<User> realUsers =
allUsers.stream()
.filter(
user ->
!Role.INTERNAL_API_USER
.getRoleId()
.equals(user.getUsername()))
.toList();
long userCount = realUsers.size();
if (userCount == 0) {
isFirstTimeSetup = true;
showDefaultCredentials = true;
} else if (userCount == 1) {
Optional<User> adminUser = userRepository.findByUsernameIgnoreCase("admin");
if (adminUser.isPresent() && Boolean.TRUE.equals(adminUser.get().getIsFirstLogin())) {
isFirstTimeSetup = true;
showDefaultCredentials = true;
}
}
data.setFirstTimeSetup(isFirstTimeSetup);
data.setShowDefaultCredentials(showDefaultCredentials);
OAUTH2 oauth = securityProps.getOauth2();
if (oauth != null && oauth.getEnabled()) {
@@ -366,7 +397,8 @@ public class ProprietaryUIDataController {
Map<Long, Date> teamLastRequest = new HashMap<>();
for (Object[] result : teamActivities) {
Long teamId = (Long) result[0];
Date lastActivity = (Date) result[1];
Instant instant = (Instant) result[1];
Date lastActivity = instant != null ? Date.from(instant) : null;
teamLastRequest.put(teamId, lastActivity);
}
@@ -410,7 +442,8 @@ public class ProprietaryUIDataController {
Map<String, Date> userLastRequest = new HashMap<>();
for (Object[] result : userSessions) {
String username = (String) result[0];
Date lastRequest = (Date) result[1];
Instant instant = (Instant) result[1];
Date lastRequest = instant != null ? Date.from(instant) : null;
userLastRequest.put(username, lastRequest);
}
@@ -456,6 +489,8 @@ public class ProprietaryUIDataController {
private Map<String, String> providerList;
private String loginMethod;
private boolean altLogin;
private boolean firstTimeSetup;
private boolean showDefaultCredentials;
}
@Data
@@ -238,6 +238,12 @@ public class CustomLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler {
path = "errorOAuth=oAuth2AutoCreateDisabled";
} else if (request.getParameter("oAuth2AdminBlockedUser") != null) {
path = "errorOAuth=oAuth2AdminBlockedUser";
} else if (request.getParameter("oAuth2RequiresLicense") != null) {
path = "errorOAuth=oAuth2RequiresLicense";
} else if (request.getParameter("saml2RequiresLicense") != null) {
path = "errorOAuth=saml2RequiresLicense";
} else if (request.getParameter("maxUsersReached") != null) {
path = "errorOAuth=maxUsersReached";
} else if (request.getParameter("userIsDisabled") != null) {
path = "errorOAuth=userIsDisabled";
} else if ((errorMessage = request.getParameter("error")) != null) {
@@ -62,6 +62,7 @@ public class InitialSecuritySetup {
private void initializeUserLicenseSettings() {
licenseSettingsService.initializeGrandfatheredCount();
licenseSettingsService.updateLicenseMaxUsers();
licenseSettingsService.grandfatherExistingOAuthUsers();
}
private void configureJWTSettings() {
@@ -23,7 +23,7 @@ public class PremiumEndpointAspect {
public Object checkPremiumAccess(ProceedingJoinPoint joinPoint) throws Throwable {
if (!runningProOrHigher) {
throw new ResponseStatusException(
HttpStatus.FORBIDDEN, "This endpoint requires a Pro or higher license");
HttpStatus.FORBIDDEN, "This endpoint requires a Server or Enterprise license");
}
return joinPoint.proceed();
}
@@ -84,6 +84,8 @@ public class SecurityConfiguration {
private final GrantedAuthoritiesMapper oAuth2userAuthoritiesMapper;
private final RelyingPartyRegistrationRepository saml2RelyingPartyRegistrations;
private final OpenSaml4AuthenticationRequestResolver saml2AuthenticationRequestResolver;
private final stirling.software.proprietary.service.UserLicenseSettingsService
licenseSettingsService;
public SecurityConfiguration(
PersistentLoginRepository persistentLoginRepository,
@@ -103,7 +105,9 @@ public class SecurityConfiguration {
@Autowired(required = false)
RelyingPartyRegistrationRepository saml2RelyingPartyRegistrations,
@Autowired(required = false)
OpenSaml4AuthenticationRequestResolver saml2AuthenticationRequestResolver) {
OpenSaml4AuthenticationRequestResolver saml2AuthenticationRequestResolver,
stirling.software.proprietary.service.UserLicenseSettingsService
licenseSettingsService) {
this.userDetailsService = userDetailsService;
this.userService = userService;
this.loginEnabledValue = loginEnabledValue;
@@ -120,10 +124,11 @@ public class SecurityConfiguration {
this.oAuth2userAuthoritiesMapper = oAuth2userAuthoritiesMapper;
this.saml2RelyingPartyRegistrations = saml2RelyingPartyRegistrations;
this.saml2AuthenticationRequestResolver = saml2AuthenticationRequestResolver;
this.licenseSettingsService = licenseSettingsService;
}
@Bean
public PasswordEncoder passwordEncoder() {
public static PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@@ -354,7 +359,8 @@ public class SecurityConfiguration {
loginAttemptService,
securityProperties.getOauth2(),
userService,
jwtService))
jwtService,
licenseSettingsService))
.failureHandler(new CustomOAuth2AuthenticationFailureHandler())
// Add existing Authorities from the database
.userInfoEndpoint(
@@ -395,7 +401,8 @@ public class SecurityConfiguration {
loginAttemptService,
securityProperties.getSaml2(),
userService,
jwtService))
jwtService,
licenseSettingsService))
.failureHandler(
new CustomSaml2AuthenticationFailureHandler())
.authenticationRequestResolver(
@@ -32,7 +32,8 @@ public class EEAppConfig {
@Bean(name = "runningProOrHigher")
@Primary
public boolean runningProOrHigher() {
return licenseKeyChecker.getPremiumLicenseEnabledResult() != License.NORMAL;
License license = licenseKeyChecker.getPremiumLicenseEnabledResult();
return license == License.SERVER || license == License.ENTERPRISE;
}
@Profile("security")
@@ -30,7 +30,7 @@ public class KeygenLicenseVerifier {
public enum License {
NORMAL,
PRO,
SERVER,
ENTERPRISE
}
@@ -76,7 +76,7 @@ public class KeygenLicenseVerifier {
log.info("Detected certificate-based license. Processing...");
boolean isValid = verifyCertificateLicense(licenseKeyOrCert, context);
if (isValid) {
license = context.isEnterpriseLicense ? License.ENTERPRISE : License.PRO;
license = context.isEnterpriseLicense ? License.ENTERPRISE : License.SERVER;
} else {
license = License.NORMAL;
}
@@ -84,7 +84,7 @@ public class KeygenLicenseVerifier {
log.info("Detected JWT-style license key. Processing...");
boolean isValid = verifyJWTLicense(licenseKeyOrCert, context);
if (isValid) {
license = context.isEnterpriseLicense ? License.ENTERPRISE : License.PRO;
license = context.isEnterpriseLicense ? License.ENTERPRISE : License.SERVER;
} else {
license = License.NORMAL;
}
@@ -92,7 +92,7 @@ public class KeygenLicenseVerifier {
log.info("Detected standard license key. Processing...");
boolean isValid = verifyStandardLicense(licenseKeyOrCert, context);
if (isValid) {
license = context.isEnterpriseLicense ? License.ENTERPRISE : License.PRO;
license = context.isEnterpriseLicense ? License.ENTERPRISE : License.SERVER;
} else {
license = License.NORMAL;
}
@@ -261,10 +261,23 @@ public class KeygenLicenseVerifier {
// Extract metadata
JSONObject metadataObj = attributesObj.optJSONObject("metadata");
if (metadataObj != null) {
int users = metadataObj.optInt("users", 1);
applicationProperties.getPremium().setMaxUsers(users);
log.info("License allows for {} users", users);
// Check if this is an old license (no planType) with isEnterprise flag
context.isEnterpriseLicense = metadataObj.optBoolean("isEnterprise", false);
// Extract user count - default based on license type
// Old licenses: Only had isEnterprise flag
// New licenses: Have planType field with "server" or "enterprise"
int users = metadataObj.optInt("users", context.isEnterpriseLicense ? 1 : 0);
// SERVER license (isEnterprise=false, users=0) = unlimited
// ENTERPRISE license (isEnterprise=true, users>0) = limited seats
if (!context.isEnterpriseLicense && users == 0) {
log.info("SERVER license detected with unlimited users");
} else if (context.isEnterpriseLicense && users > 0) {
log.info("ENTERPRISE license allows for {} users", users);
}
applicationProperties.getPremium().setMaxUsers(users);
}
// Check license status if available
@@ -431,28 +444,31 @@ public class KeygenLicenseVerifier {
}
// Extract max users and isEnterprise from policy or metadata
int users = policyObj.optInt("users", 1);
context.isEnterpriseLicense = policyObj.optBoolean("isEnterprise", false);
int users = policyObj.optInt("users", -1);
if (users > 0) {
applicationProperties.getPremium().setMaxUsers(users);
log.info("License allows for {} users", users);
} else {
// Try to get users from metadata if present
if (users == -1) {
// Try to get users from metadata if not at policy level
Object metadataObj = policyObj.opt("metadata");
if (metadataObj instanceof JSONObject metadata) {
users = metadata.optInt("users", 1);
applicationProperties.getPremium().setMaxUsers(users);
log.info("License allows for {} users (from metadata)", users);
// Check for isEnterprise flag in metadata
context.isEnterpriseLicense = metadata.optBoolean("isEnterprise", false);
context.isEnterpriseLicense =
metadata.optBoolean("isEnterprise", context.isEnterpriseLicense);
users = metadata.optInt("users", context.isEnterpriseLicense ? 1 : 0);
} else {
// Default value
applicationProperties.getPremium().setMaxUsers(1);
log.info("Using default of 1 user for license");
// Default based on license type
users = context.isEnterpriseLicense ? 1 : 0;
}
}
// SERVER license (isEnterprise=false, users=0) = unlimited
// ENTERPRISE license (isEnterprise=true, users>0) = limited seats
if (!context.isEnterpriseLicense && users == 0) {
log.info("SERVER license detected with unlimited users");
} else if (context.isEnterpriseLicense && users > 0) {
log.info("ENTERPRISE license allows for {} users", users);
}
applicationProperties.getPremium().setMaxUsers(users);
}
return true;
@@ -584,17 +600,7 @@ public class KeygenLicenseVerifier {
context.maxMachines);
}
// Extract user count, default to 1 if not specified
int users =
jsonResponse
.path("data")
.path("attributes")
.path("metadata")
.path("users")
.asInt(1);
applicationProperties.getPremium().setMaxUsers(users);
// Extract isEnterprise flag
// Extract isEnterprise flag first
context.isEnterpriseLicense =
jsonResponse
.path("data")
@@ -603,6 +609,24 @@ public class KeygenLicenseVerifier {
.path("isEnterprise")
.asBoolean(false);
// Extract user count - default based on license type
int users =
jsonResponse
.path("data")
.path("attributes")
.path("metadata")
.path("users")
.asInt(context.isEnterpriseLicense ? 1 : 0);
// SERVER license (isEnterprise=false, users=0) = unlimited
// ENTERPRISE license (isEnterprise=true, users>0) = limited seats
if (!context.isEnterpriseLicense && users == 0) {
log.info("SERVER license detected with unlimited users");
} else if (context.isEnterpriseLicense && users > 0) {
log.info("ENTERPRISE license allows for {} users", users);
}
applicationProperties.getPremium().setMaxUsers(users);
log.debug(applicationProperties.toString());
} else {
@@ -68,8 +68,8 @@ public class LicenseKeyChecker {
premiumEnabledResult = licenseService.verifyLicense(licenseKey);
if (License.ENTERPRISE == premiumEnabledResult) {
log.info("License key is Enterprise.");
} else if (License.PRO == premiumEnabledResult) {
log.info("License key is Pro.");
} else if (License.SERVER == premiumEnabledResult) {
log.info("License key is Server.");
} else {
log.info("License key is invalid, defaulting to non pro license.");
}
@@ -113,7 +113,12 @@ public class LicenseKeyChecker {
public void updateLicenseKey(String newKey) throws IOException {
applicationProperties.getPremium().setKey(newKey);
GeneralUtils.saveKeyToSettings("EnterpriseEdition.key", newKey);
GeneralUtils.saveKeyToSettings("premium.key", newKey);
evaluateLicense();
synchronizeLicenseSettings();
}
public void resyncLicense() {
evaluateLicense();
synchronizeLicenseSettings();
}
@@ -0,0 +1,245 @@
package stirling.software.proprietary.security.controller.api;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import stirling.software.common.model.ApplicationProperties;
import stirling.software.common.util.GeneralUtils;
import stirling.software.proprietary.security.configuration.ee.KeygenLicenseVerifier;
import stirling.software.proprietary.security.configuration.ee.KeygenLicenseVerifier.License;
import stirling.software.proprietary.security.configuration.ee.LicenseKeyChecker;
/**
* Admin controller for license management. Provides installation ID for Stripe checkout metadata
* and endpoints for managing license keys.
*/
@RestController
@Slf4j
@RequestMapping("/api/v1/admin")
@PreAuthorize("hasRole('ROLE_ADMIN')")
@Tag(name = "Admin License Management", description = "Admin-only License Management APIs")
public class AdminLicenseController {
@Autowired(required = false)
private LicenseKeyChecker licenseKeyChecker;
@Autowired(required = false)
private KeygenLicenseVerifier keygenLicenseVerifier;
@Autowired private ApplicationProperties applicationProperties;
/**
* Get the installation ID (machine fingerprint) for this self-hosted instance. This ID is used
* as metadata in Stripe checkout to link licenses to specific installations.
*
* @return Map containing the installation ID
*/
@GetMapping("/installation-id")
@Operation(
summary = "Get installation ID",
description =
"Returns the unique installation ID (MAC-based fingerprint) for this"
+ " self-hosted instance")
public ResponseEntity<Map<String, String>> getInstallationId() {
try {
String installationId = GeneralUtils.generateMachineFingerprint();
log.info("Admin requested installation ID: {}", installationId);
return ResponseEntity.ok(Map.of("installationId", installationId));
} catch (Exception e) {
log.error("Failed to generate installation ID", e);
return ResponseEntity.internalServerError()
.body(Map.of("error", "Failed to generate installation ID"));
}
}
/**
* Save and activate a license key. This endpoint accepts a license key from the frontend (e.g.,
* after Stripe checkout) and activates it on the backend.
*
* @param request Map containing the license key
* @return Response with success status, license type, and whether restart is required
*/
@PostMapping("/license-key")
@Operation(
summary = "Save and activate license key",
description =
"Accepts a license key and activates it on the backend. Returns the activated"
+ " license type.")
public ResponseEntity<Map<String, Object>> saveLicenseKey(
@RequestBody Map<String, String> request) {
String licenseKey = request.get("licenseKey");
// Reject null but allow empty string to clear license
if (licenseKey == null) {
return ResponseEntity.badRequest()
.body(Map.of("success", false, "error", "License key is required"));
}
try {
if (licenseKeyChecker == null) {
return ResponseEntity.internalServerError()
.body(Map.of("success", false, "error", "License checker not available"));
}
// assume premium enabled when setting license key
applicationProperties.getPremium().setEnabled(true);
// Use existing LicenseKeyChecker to update and validate license
// Empty string will be evaluated as NORMAL license (free tier)
licenseKeyChecker.updateLicenseKey(licenseKey.trim());
// Get current license status
License license = licenseKeyChecker.getPremiumLicenseEnabledResult();
// Auto-enable premium features if license is valid
if (license != License.NORMAL) {
GeneralUtils.saveKeyToSettings("premium.enabled", true);
// Enable premium features
// Save maxUsers from license metadata
Integer maxUsers = applicationProperties.getPremium().getMaxUsers();
if (maxUsers != null) {
GeneralUtils.saveKeyToSettings("premium.maxUsers", maxUsers);
}
} else {
GeneralUtils.saveKeyToSettings("premium.enabled", false);
log.info("License key is not valid for premium features: type={}", license.name());
}
Map<String, Object> response = new HashMap<>();
response.put("success", true);
response.put("licenseType", license.name());
response.put("enabled", applicationProperties.getPremium().isEnabled());
response.put("maxUsers", applicationProperties.getPremium().getMaxUsers());
response.put("requiresRestart", false); // Dynamic evaluation works
response.put("message", "License key saved and activated");
log.info("License key saved and activated: type={}", license.name());
return ResponseEntity.ok(response);
} catch (Exception e) {
log.error("Failed to save license key", e);
return ResponseEntity.badRequest()
.body(
Map.of(
"success",
false,
"error",
"Failed to activate license: " + e.getMessage()));
}
}
/**
* Resync the current license with Keygen. This endpoint re-validates the existing license key
* and updates the max users setting. Used after subscription upgrades to sync the new license
* limits.
*
* @return Response with updated license information
*/
@PostMapping("/license/resync")
@Operation(
summary = "Resync license with Keygen",
description =
"Re-validates the existing license key with Keygen and updates local settings."
+ " Used after subscription upgrades.")
public ResponseEntity<Map<String, Object>> resyncLicense() {
try {
if (licenseKeyChecker == null) {
return ResponseEntity.internalServerError()
.body(Map.of("success", false, "error", "License checker not available"));
}
String currentKey = applicationProperties.getPremium().getKey();
if (currentKey == null || currentKey.trim().isEmpty()) {
return ResponseEntity.badRequest()
.body(Map.of("success", false, "error", "No license key configured"));
}
log.info("Resyncing license with Keygen");
// Re-validate license and sync settings
licenseKeyChecker.resyncLicense();
// Get updated license status
License license = licenseKeyChecker.getPremiumLicenseEnabledResult();
ApplicationProperties.Premium premium = applicationProperties.getPremium();
Map<String, Object> response = new HashMap<>();
response.put("success", true);
response.put("licenseType", license.name());
response.put("enabled", premium.isEnabled());
response.put("maxUsers", premium.getMaxUsers());
response.put("message", "License resynced successfully");
log.info(
"License resynced: type={}, maxUsers={}",
license.name(),
premium.getMaxUsers());
return ResponseEntity.ok(response);
} catch (Exception e) {
log.error("Failed to resync license", e);
return ResponseEntity.internalServerError()
.body(
Map.of(
"success",
false,
"error",
"Failed to resync license: " + e.getMessage()));
}
}
/**
* Get information about the current license key status, including license type, enabled status,
* and max users.
*
* @return Map containing license information
*/
@GetMapping("/license-info")
@Operation(
summary = "Get license information",
description =
"Returns information about the current license including type, enabled status,"
+ " and max users")
public ResponseEntity<Map<String, Object>> getLicenseInfo() {
try {
Map<String, Object> response = new HashMap<>();
if (licenseKeyChecker != null) {
License license = licenseKeyChecker.getPremiumLicenseEnabledResult();
response.put("licenseType", license.name());
} else {
response.put("licenseType", License.NORMAL.name());
}
ApplicationProperties.Premium premium = applicationProperties.getPremium();
response.put("enabled", premium.isEnabled());
response.put("maxUsers", premium.getMaxUsers());
response.put("hasKey", premium.getKey() != null && !premium.getKey().trim().isEmpty());
// Include license key for upgrades (admin-only endpoint)
if (premium.getKey() != null && !premium.getKey().trim().isEmpty()) {
response.put("licenseKey", premium.getKey());
}
return ResponseEntity.ok(response);
} catch (Exception e) {
log.error("Failed to get license info", e);
return ResponseEntity.internalServerError()
.body(Map.of("error", "Failed to retrieve license information"));
}
}
}
@@ -299,6 +299,16 @@ public class AdminSettingsController {
+ String.join(", ", VALID_SECTION_NAMES));
}
// Auto-enable premium features if license key is provided
if ("premium".equalsIgnoreCase(sectionName) && sectionData.containsKey("key")) {
Object keyValue = sectionData.get("key");
if (keyValue != null && !keyValue.toString().trim().isEmpty()) {
// Automatically set enabled to true when a key is provided
sectionData.put("enabled", true);
log.info("Auto-enabling premium features because license key was provided");
}
}
int updatedCount = 0;
for (Map.Entry<String, Object> entry : sectionData.entrySet()) {
String propertyKey = entry.getKey();
@@ -87,6 +87,19 @@ public class UserController {
.body(Map.of("error", "Password is required"));
}
if (licenseSettingsService.wouldExceedLimit(1)) {
long availableSlots = licenseSettingsService.getAvailableUserSlots();
int maxAllowed = licenseSettingsService.calculateMaxAllowedUsers();
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(
Map.of(
"error",
"Maximum number of users reached. Allowed: "
+ maxAllowed
+ ", Available slots: "
+ availableSlots));
}
Team team = teamRepository.findByName(TeamService.DEFAULT_TEAM_NAME).orElse(null);
User user =
userService.saveUser(
@@ -39,4 +39,28 @@ public interface UserRepository extends JpaRepository<User, Long> {
long countByTeam(Team team);
List<User> findAllByTeam(Team team);
// OAuth grandfathering queries
long countBySsoProviderIsNotNull();
long countByOauthGrandfatheredTrue();
List<User> findAllBySsoProviderIsNotNull();
/**
* Finds all SSO users - those with sso_provider set OR authenticationType is sso/oauth2/saml2.
* This catches V1 users who were created via SSO but never signed in (sso_provider is null).
*/
@Query(
"SELECT u FROM User u WHERE u.ssoProvider IS NOT NULL "
+ "OR LOWER(u.authenticationType) IN ('sso', 'oauth2', 'saml2')")
List<User> findAllSsoUsers();
/**
* Counts all SSO users - those with sso_provider set OR authenticationType is sso/oauth2/saml2.
*/
@Query(
"SELECT COUNT(u) FROM User u WHERE u.ssoProvider IS NOT NULL "
+ "OR LOWER(u.authenticationType) IN ('sso', 'oauth2', 'saml2')")
long countSsoUsers();
}
@@ -71,6 +71,9 @@ public class User implements UserDetails, Serializable {
@Column(name = "sso_provider")
private String ssoProvider;
@Column(name = "oauth_grandfathered")
private Boolean oauthGrandfathered = false;
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "user")
private Set<Authority> authorities = new HashSet<>();
@@ -135,4 +138,12 @@ public class User implements UserDetails, Serializable {
public boolean hasPassword() {
return this.password != null && !this.password.isEmpty();
}
public boolean isOauthGrandfathered() {
return oauthGrandfathered != null && oauthGrandfathered;
}
public void setOauthGrandfathered(boolean oauthGrandfathered) {
this.oauthGrandfathered = oauthGrandfathered;
}
}
@@ -50,6 +50,8 @@ public class CustomOAuth2AuthenticationSuccessHandler
private final ApplicationProperties.Security.OAUTH2 oauth2Properties;
private final UserService userService;
private final JwtServiceInterface jwtService;
private final stirling.software.proprietary.service.UserLicenseSettingsService
licenseSettingsService;
@Override
@Audited(type = AuditEventType.USER_LOGIN, level = AuditLevel.BASIC)
@@ -66,6 +68,25 @@ public class CustomOAuth2AuthenticationSuccessHandler
username = detailsUser.getUsername();
}
boolean userExists = userService.usernameExistsIgnoreCase(username);
// Check if user is eligible for OAuth (grandfathered or system has paid license)
if (userExists) {
stirling.software.proprietary.security.model.User user =
userService.findByUsernameIgnoreCase(username).orElse(null);
if (user != null && !licenseSettingsService.isOAuthEligible(user)) {
// User is not grandfathered and no paid license - block OAuth login
response.sendRedirect(
request.getContextPath() + "/logout?oAuth2RequiresLicense=true");
return;
}
} else if (!licenseSettingsService.isOAuthEligible(null)) {
// No existing user and no paid license -> block auto creation
response.sendRedirect(request.getContextPath() + "/logout?oAuth2RequiresLicense=true");
return;
}
// Get the saved request
HttpSession session = request.getSession(false);
String contextPath = request.getContextPath();
@@ -91,7 +112,7 @@ public class CustomOAuth2AuthenticationSuccessHandler
.sendRedirect(request, response, "/logout?userIsDisabled=true");
return;
}
if (userService.usernameExistsIgnoreCase(username)
if (userExists
&& userService.hasPassword(username)
&& (!userService.isAuthenticationTypeByUsername(username, SSO)
|| !userService.isAuthenticationTypeByUsername(username, OAUTH2))
@@ -106,6 +127,10 @@ public class CustomOAuth2AuthenticationSuccessHandler
response.sendRedirect(contextPath + "/logout?oAuth2AdminBlockedUser=true");
return;
}
if (!userExists && licenseSettingsService.wouldExceedLimit(1)) {
response.sendRedirect(contextPath + "/logout?maxUsersReached=true");
return;
}
if (principal instanceof OAuth2User oAuth2User) {
// Extract SSO provider information from OAuth2User
String ssoProviderId = oAuth2User.getAttribute("sub"); // OIDC ID
@@ -49,6 +49,8 @@ public class CustomSaml2AuthenticationSuccessHandler
private ApplicationProperties.Security.SAML2 saml2Properties;
private UserService userService;
private final JwtServiceInterface jwtService;
private final stirling.software.proprietary.service.UserLicenseSettingsService
licenseSettingsService;
@Override
@Audited(type = AuditEventType.USER_LOGIN, level = AuditLevel.BASIC)
@@ -63,6 +65,26 @@ public class CustomSaml2AuthenticationSuccessHandler
String username = saml2Principal.name();
log.debug("Authenticated principal found for user: {}", username);
boolean userExists = userService.usernameExistsIgnoreCase(username);
// Check if user is eligible for SAML (grandfathered or system has paid license)
if (userExists) {
stirling.software.proprietary.security.model.User user =
userService.findByUsernameIgnoreCase(username).orElse(null);
if (user != null && !licenseSettingsService.isOAuthEligible(user)) {
// User is not grandfathered and no paid license - block SAML login
response.sendRedirect(
request.getContextPath() + "/logout?saml2RequiresLicense=true");
return;
}
} else if (!licenseSettingsService.isOAuthEligible(null)) {
// No existing user and no paid license -> block auto creation
response.sendRedirect(
request.getContextPath() + "/logout?saml2RequiresLicense=true");
return;
}
HttpSession session = request.getSession(false);
String contextPath = request.getContextPath();
SavedRequest savedRequest =
@@ -96,7 +118,6 @@ public class CustomSaml2AuthenticationSuccessHandler
"Your account has been locked due to too many failed login attempts.");
}
boolean userExists = userService.usernameExistsIgnoreCase(username);
boolean hasPassword = userExists && userService.hasPassword(username);
boolean isSSOUser =
userExists && userService.isAuthenticationTypeByUsername(username, SSO);
@@ -129,6 +150,10 @@ public class CustomSaml2AuthenticationSuccessHandler
contextPath + "/login?errorOAuth=oAuth2AdminBlockedUser");
return;
}
if (!userExists && licenseSettingsService.wouldExceedLimit(1)) {
response.sendRedirect(contextPath + "/logout?maxUsersReached=true");
return;
}
// Extract SSO provider information from SAML2 assertion
String ssoProviderId = saml2Principal.nameId();
@@ -39,7 +39,7 @@ import stirling.software.proprietary.security.saml2.CustomSaml2AuthenticatedPrin
public class JwtService implements JwtServiceInterface {
private static final String ISSUER = "https://stirling.com";
private static final long EXPIRATION = 3600000;
private static final long EXPIRATION = 43200000;
private final KeyPersistenceServiceInterface keyPersistenceService;
private final boolean v2Enabled;
@@ -734,4 +734,48 @@ public class UserService implements UserServiceInterface {
public void saveAll(List<User> users) {
userRepository.saveAll(users);
}
/**
* Counts the number of OAuth/SAML users. Includes users with sso_provider set OR
* authenticationType is sso/oauth2/saml2 (catches V1 users who never signed in).
*
* @return Count of OAuth users
*/
public long countOAuthUsers() {
return userRepository.countSsoUsers();
}
/**
* Counts the number of OAuth users who are grandfathered.
*
* @return Count of grandfathered OAuth users
*/
public long countGrandfatheredOAuthUsers() {
return userRepository.countByOauthGrandfatheredTrue();
}
/**
* Grandfathers all existing OAuth/SAML users. This marks all users with an SSO provider as
* grandfathered, allowing them to keep OAuth access even without a paid license.
*
* @return Number of users updated
*/
@Transactional
public int grandfatherAllOAuthUsers() {
List<User> ssoUsers = userRepository.findAllSsoUsers();
int updated = 0;
for (User user : ssoUsers) {
if (!user.isOauthGrandfathered()) {
user.setOauthGrandfathered(true);
updated++;
}
}
if (updated > 0) {
userRepository.saveAll(ssoUsers);
}
return updated;
}
}
@@ -69,7 +69,7 @@ public class ServerCertificateService implements ServerCertificateServiceInterfa
private boolean hasProOrEnterpriseAccess() {
License license = licenseKeyChecker.getPremiumLicenseEnabledResult();
return license == License.PRO || license == License.ENTERPRISE;
return license == License.SERVER || license == License.ENTERPRISE;
}
public boolean isEnabled() {
@@ -10,6 +10,7 @@ import java.util.UUID;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -18,6 +19,8 @@ import lombok.extern.slf4j.Slf4j;
import stirling.software.common.model.ApplicationProperties;
import stirling.software.proprietary.model.UserLicenseSettings;
import stirling.software.proprietary.security.configuration.ee.KeygenLicenseVerifier.License;
import stirling.software.proprietary.security.configuration.ee.LicenseKeyChecker;
import stirling.software.proprietary.security.repository.UserLicenseSettingsRepository;
import stirling.software.proprietary.security.service.UserService;
@@ -45,6 +48,7 @@ public class UserLicenseSettingsService {
private final UserLicenseSettingsRepository settingsRepository;
private final UserService userService;
private final ApplicationProperties applicationProperties;
private final ObjectProvider<LicenseKeyChecker> licenseKeyChecker;
/**
* Gets the current user license settings, creating them if they don't exist.
@@ -151,7 +155,7 @@ public class UserLicenseSettingsService {
UserLicenseSettings settings = getOrCreateSettings();
int licenseMaxUsers = 0;
if (applicationProperties.getPremium().isEnabled()) {
if (hasPaidLicense()) {
licenseMaxUsers = applicationProperties.getPremium().getMaxUsers();
}
@@ -162,6 +166,40 @@ public class UserLicenseSettingsService {
}
}
/**
* Grandfathers existing OAuth users on first run. This is a one-time migration that marks all
* existing OAuth/SAML users as grandfathered, allowing them to keep OAuth access even without a
* paid license.
*
* <p>New users created after this migration will NOT be grandfathered and will require a paid
* license to use OAuth.
*/
@Transactional
public void grandfatherExistingOAuthUsers() {
UserLicenseSettings settings = getOrCreateSettings();
// Check if we've already run this migration
if (settings.getId() != null && settings.isGrandfatheringLocked()) {
// Migration should happen at the same time as grandfathering is locked
long oauthUsersCount = userService.countOAuthUsers();
long grandfatheredCount = userService.countGrandfatheredOAuthUsers();
if (oauthUsersCount > 0 && grandfatheredCount == 0) {
// We have OAuth users but none are grandfathered - this is first run after upgrade
int updated = userService.grandfatherAllOAuthUsers();
log.warn(
"OAuth GRANDFATHERING: Marked {} existing OAuth/SAML users as grandfathered. "
+ "They will retain OAuth access even without a paid license. "
+ "New users will require a paid license for OAuth.",
updated);
} else if (grandfatheredCount > 0) {
log.debug(
"OAuth grandfathering already completed: {} users grandfathered",
grandfatheredCount);
}
}
}
/**
* Validates and enforces the integrity of license settings. This ensures that even if someone
* manually modifies the database, the grandfathering rules are still enforced.
@@ -241,12 +279,15 @@ public class UserLicenseSettingsService {
* <p>Logic:
*
* <ul>
* <li>Grandfathered limit = max(5, existing user count at initialization)
* <li>If premium enabled: total limit = grandfathered limit + license maxUsers
* <li>If premium disabled: total limit = grandfathered limit
* <li>Grandfathered limit = max(5, existing user count at V1→V2 migration)
* <li>No license: Uses grandfathered limit only
* <li>SERVER license (maxUsers=0): Unlimited users (Integer.MAX_VALUE)
* <li>ENTERPRISE license (maxUsers>0): License seats only (NO grandfathering added)
* </ul>
*
* @return Maximum number of users allowed
* <p>IMPORTANT: Paid licenses REPLACE the limit, they don't add to grandfathering.
*
* @return Maximum number of users allowed (Integer.MAX_VALUE for unlimited)
*/
public int calculateMaxAllowedUsers() {
validateSettingsIntegrity();
@@ -259,20 +300,52 @@ public class UserLicenseSettingsService {
grandfatheredLimit = DEFAULT_USER_LIMIT;
}
int totalLimit = grandfatheredLimit;
if (applicationProperties.getPremium().isEnabled()) {
totalLimit = grandfatheredLimit + settings.getLicenseMaxUsers();
// No license: use grandfathered limit
if (!hasPaidLicense()) {
log.debug("No license: using grandfathered limit of {}", grandfatheredLimit);
return grandfatheredLimit;
}
log.debug(
"Calculated max allowed users: {} (grandfathered: {}, license: {}, premium enabled: {})",
totalLimit,
grandfatheredLimit,
settings.getLicenseMaxUsers(),
applicationProperties.getPremium().isEnabled());
int licenseMaxUsers = settings.getLicenseMaxUsers();
return totalLimit;
// SERVER license (maxUsers=0): unlimited users
if (licenseMaxUsers == 0) {
log.debug("SERVER license: unlimited users allowed");
return Integer.MAX_VALUE;
}
// ENTERPRISE license (maxUsers>0): license seats only (replaces grandfathering)
log.debug(
"ENTERPRISE license: {} seats (grandfathered {} not added)",
licenseMaxUsers,
grandfatheredLimit);
return licenseMaxUsers;
}
/**
* Checks if a user is eligible to use OAuth/SAML authentication.
*
* <p>A user is eligible if:
*
* <ul>
* <li>They are grandfathered for OAuth (existing user before policy change), OR
* <li>The system has an ENTERPRISE license (SSO is enterprise-only)
* </ul>
*
* @param user The user to check
* @return true if the user can use OAuth/SAML
*/
public boolean isOAuthEligible(stirling.software.proprietary.security.model.User user) {
// Grandfathered users always have OAuth access
if (user != null && user.isOauthGrandfathered()) {
log.debug("User {} is grandfathered for OAuth", user.getUsername());
return true;
}
// Users can use OAuth/SAML only if system has ENTERPRISE license
boolean hasEnterpriseLicense = hasEnterpriseLicense();
log.debug("OAuth eligibility check: hasEnterpriseLicense={}", hasEnterpriseLicense);
return hasEnterpriseLicense;
}
/**
@@ -408,4 +481,28 @@ public class UserLicenseSettingsService {
throw new IllegalStateException("Invalid key for grandfathered user signature", e);
}
}
private boolean hasPaidLicense() {
LicenseKeyChecker checker = licenseKeyChecker.getIfAvailable();
if (checker == null) {
return false;
}
License license = checker.getPremiumLicenseEnabledResult();
return license == License.SERVER || license == License.ENTERPRISE;
}
/**
* Checks if the system has an ENTERPRISE license. Used for enterprise-only features like SSO
* (OAuth/SAML).
*
* @return true if ENTERPRISE license is active
*/
private boolean hasEnterpriseLicense() {
LicenseKeyChecker checker = licenseKeyChecker.getIfAvailable();
if (checker == null) {
return false;
}
License license = checker.getPremiumLicenseEnabledResult();
return license == License.ENTERPRISE;
}
}
@@ -103,6 +103,9 @@ class CustomLogoutSuccessHandlerTest {
when(request.getParameter("errorOAuth")).thenReturn(null);
when(request.getParameter("oAuth2AutoCreateDisabled")).thenReturn(null);
when(request.getParameter("oAuth2AdminBlockedUser")).thenReturn(null);
when(request.getParameter("oAuth2RequiresLicense")).thenReturn(null);
when(request.getParameter("saml2RequiresLicense")).thenReturn(null);
when(request.getParameter("maxUsersReached")).thenReturn(null);
when(request.getParameter(error)).thenReturn("true");
when(request.getScheme()).thenReturn("http");
when(request.getServerName()).thenReturn("localhost");
@@ -208,6 +211,9 @@ class CustomLogoutSuccessHandlerTest {
when(request.getParameter("errorOAuth")).thenReturn(null);
when(request.getParameter("oAuth2AutoCreateDisabled")).thenReturn(null);
when(request.getParameter("oAuth2AdminBlockedUser")).thenReturn(null);
when(request.getParameter("oAuth2RequiresLicense")).thenReturn(null);
when(request.getParameter("saml2RequiresLicense")).thenReturn(null);
when(request.getParameter("maxUsersReached")).thenReturn(null);
when(request.getParameter("userIsDisabled")).thenReturn(null);
when(request.getParameter("error")).thenReturn("!@$!@£" + error + "£$%^*$");
when(request.getScheme()).thenReturn("http");
@@ -237,6 +243,9 @@ class CustomLogoutSuccessHandlerTest {
when(request.getParameter("errorOAuth")).thenReturn(null);
when(request.getParameter("oAuth2AutoCreateDisabled")).thenReturn(null);
when(request.getParameter("oAuth2AdminBlockedUser")).thenReturn(null);
when(request.getParameter("oAuth2RequiresLicense")).thenReturn(null);
when(request.getParameter("saml2RequiresLicense")).thenReturn(null);
when(request.getParameter("maxUsersReached")).thenReturn(null);
when(request.getParameter("userIsDisabled")).thenReturn(null);
when(request.getParameter("error")).thenReturn(null);
when(request.getParameter(error)).thenReturn("true");
@@ -44,13 +44,13 @@ class LicenseKeyCheckerTest {
ApplicationProperties props = new ApplicationProperties();
props.getPremium().setEnabled(true);
props.getPremium().setKey("abc");
when(verifier.verifyLicense("abc")).thenReturn(License.PRO);
when(verifier.verifyLicense("abc")).thenReturn(License.SERVER);
LicenseKeyChecker checker =
new LicenseKeyChecker(verifier, props, userLicenseSettingsService);
checker.init();
assertEquals(License.PRO, checker.getPremiumLicenseEnabledResult());
assertEquals(License.SERVER, checker.getPremiumLicenseEnabledResult());
verify(verifier).verifyLicense("abc");
}
@@ -0,0 +1,201 @@
package stirling.software.proprietary.service;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.quality.Strictness;
import org.springframework.beans.factory.ObjectProvider;
import stirling.software.common.model.ApplicationProperties;
import stirling.software.proprietary.model.UserLicenseSettings;
import stirling.software.proprietary.security.configuration.ee.KeygenLicenseVerifier.License;
import stirling.software.proprietary.security.configuration.ee.LicenseKeyChecker;
import stirling.software.proprietary.security.repository.UserLicenseSettingsRepository;
import stirling.software.proprietary.security.service.UserService;
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT)
class UserLicenseSettingsServiceTest {
@Mock private UserLicenseSettingsRepository settingsRepository;
@Mock private UserService userService;
@Mock private ApplicationProperties applicationProperties;
@Mock private ApplicationProperties.Premium premium;
@Mock private LicenseKeyChecker licenseKeyChecker;
@Mock private ObjectProvider<LicenseKeyChecker> licenseKeyCheckerProvider;
private UserLicenseSettingsService service;
private UserLicenseSettings mockSettings;
@BeforeEach
void setUp() {
mockSettings = new UserLicenseSettings();
mockSettings.setId(1L);
mockSettings.setGrandfatheredUserCount(80);
mockSettings.setGrandfatheringLocked(true);
mockSettings.setIntegritySalt("test-salt");
mockSettings.setGrandfatheredUserSignature("80:test-signature");
when(applicationProperties.getPremium()).thenReturn(premium);
when(settingsRepository.findSettings()).thenReturn(Optional.of(mockSettings));
when(userService.getTotalUsersCount()).thenReturn(80L);
when(settingsRepository.save(any(UserLicenseSettings.class)))
.thenAnswer(invocation -> invocation.getArgument(0));
when(licenseKeyChecker.getPremiumLicenseEnabledResult()).thenReturn(License.NORMAL);
when(licenseKeyCheckerProvider.getIfAvailable()).thenReturn(licenseKeyChecker);
// Create service with overridden validateSettingsIntegrity to bypass signature validation
service =
new UserLicenseSettingsService(
settingsRepository,
userService,
applicationProperties,
licenseKeyCheckerProvider) {
@Override
public void validateSettingsIntegrity() {
// Override to do nothing in tests - avoid HMAC signature validation
// complexity
}
};
}
@Test
void noLicense_returnsGrandfatheredLimit() {
// No license active
when(premium.isEnabled()).thenReturn(false);
when(licenseKeyChecker.getPremiumLicenseEnabledResult()).thenReturn(License.NORMAL);
int result = service.calculateMaxAllowedUsers();
assertEquals(80, result, "Should return grandfathered user count when no license");
}
@Test
void serverLicense_returnsUnlimited() {
// SERVER license with users=0
when(premium.isEnabled()).thenReturn(true);
when(licenseKeyChecker.getPremiumLicenseEnabledResult()).thenReturn(License.SERVER);
mockSettings.setLicenseMaxUsers(0);
int result = service.calculateMaxAllowedUsers();
assertEquals(Integer.MAX_VALUE, result, "SERVER license should return unlimited users");
}
@Test
void enterpriseLicense_returnsLicenseSeatsOnly() {
// ENTERPRISE license with 5 seats
when(premium.isEnabled()).thenReturn(true);
when(licenseKeyChecker.getPremiumLicenseEnabledResult()).thenReturn(License.ENTERPRISE);
mockSettings.setLicenseMaxUsers(5);
int result = service.calculateMaxAllowedUsers();
assertEquals(
5,
result,
"ENTERPRISE license should return license seats only (NOT grandfathered + seats)");
}
@Test
void enterpriseLicense_ignoresGrandfathering() {
// ENTERPRISE with 20 seats, grandfathered was 80
when(premium.isEnabled()).thenReturn(true);
when(licenseKeyChecker.getPremiumLicenseEnabledResult()).thenReturn(License.ENTERPRISE);
mockSettings.setLicenseMaxUsers(20);
mockSettings.setGrandfatheredUserCount(80); // This should be ignored
int result = service.calculateMaxAllowedUsers();
assertEquals(
20,
result,
"ENTERPRISE license should ignore grandfathering and use license seats only");
}
@Test
void freshInstall_noLicense_returnsFive() {
// Fresh install with default 5 users grandfathered
mockSettings.setGrandfatheredUserCount(5);
when(premium.isEnabled()).thenReturn(false);
int result = service.calculateMaxAllowedUsers();
assertEquals(5, result, "Fresh install with no license should return 5 users");
}
@Test
void freshInstall_serverLicense_returnsUnlimited() {
// Fresh install with SERVER license
mockSettings.setGrandfatheredUserCount(5);
when(premium.isEnabled()).thenReturn(true);
when(licenseKeyChecker.getPremiumLicenseEnabledResult()).thenReturn(License.SERVER);
mockSettings.setLicenseMaxUsers(0);
int result = service.calculateMaxAllowedUsers();
assertEquals(
Integer.MAX_VALUE,
result,
"Fresh install with SERVER license should return unlimited");
}
@Test
void freshInstall_enterpriseLicense_returnsLicenseSeats() {
// Fresh install with ENTERPRISE 10 seats
mockSettings.setGrandfatheredUserCount(5);
when(premium.isEnabled()).thenReturn(true);
when(licenseKeyChecker.getPremiumLicenseEnabledResult()).thenReturn(License.ENTERPRISE);
mockSettings.setLicenseMaxUsers(10);
int result = service.calculateMaxAllowedUsers();
assertEquals(
10, result, "Fresh install with ENTERPRISE license should return license seats");
}
@Test
void v1MigrationWith80Users_noLicense_returns80() {
// V1→V2 migration with 80 users, no paid license
mockSettings.setGrandfatheredUserCount(80);
when(premium.isEnabled()).thenReturn(false);
int result = service.calculateMaxAllowedUsers();
assertEquals(80, result, "V1→V2 migration should preserve 80 grandfathered users");
}
@Test
void v1MigrationWith80Users_thenEnterpriseWith5Seats_returns5() {
// V1→V2 with 80 users, then buy ENTERPRISE 5 seats
mockSettings.setGrandfatheredUserCount(80);
when(premium.isEnabled()).thenReturn(true);
when(licenseKeyChecker.getPremiumLicenseEnabledResult()).thenReturn(License.ENTERPRISE);
mockSettings.setLicenseMaxUsers(5);
int result = service.calculateMaxAllowedUsers();
assertEquals(
5, result, "ENTERPRISE 5 seats should override grandfathered 80 users (not 85)");
}
@Test
void zeroGrandfathered_fallsBackToDefault() {
// Edge case: grandfathered is 0 (should not happen)
mockSettings.setGrandfatheredUserCount(0);
when(premium.isEnabled()).thenReturn(false);
int result = service.calculateMaxAllowedUsers();
assertEquals(5, result, "Should fall back to default 5 users if grandfathered is 0");
}
}
-43
View File
@@ -1,43 +0,0 @@
import json
import sys
from pathlib import Path
if len(sys.argv) != 3:
print('Usage: compare_json.py <file1> <file2>')
sys.exit(1)
path1, path2 = map(Path, sys.argv[1:])
def load(path):
with path.open('r', encoding='utf-8') as fh:
return json.load(fh)
doc1 = load(path1)
doc2 = load(path2)
if doc1 == doc2:
print('Documents identical')
sys.exit(0)
pages1 = doc1.get('pages', [])
pages2 = doc2.get('pages', [])
for page_index, (p1, p2) in enumerate(zip(pages1, pages2), start=1):
elems1 = p1.get('textElements') or []
elems2 = p2.get('textElements') or []
if len(elems1) != len(elems2):
print(f'Page {page_index}: element count {len(elems1)} vs {len(elems2)}')
diff_found = False
for elem_index, (e1, e2) in enumerate(zip(elems1, elems2)):
if e1 == e2:
continue
diff_found = True
print(f'Page {page_index} element {elem_index} differs')
common_keys = sorted(set(e1) | set(e2))
for key in common_keys:
if e1.get(key) != e2.get(key):
print(f' {key}: {e1.get(key)!r} -> {e2.get(key)!r}')
break
if diff_found:
break
-6
View File
@@ -29,12 +29,6 @@ services:
METRICS_ENABLED: "true"
SYSTEM_GOOGLEVISIBILITY: "true"
SHOW_SURVEY: "true"
STIRLING_PDF_JSON_FONT_NORMALIZATION_ENABLED: "false"
STIRLING_PDF_JSON_CFF_CONVERTER_ENABLED: "true"
STIRLING_PDF_JSON_CFF_CONVERTER_METHOD: python
STIRLING_PDF_JSON_CFF_CONVERTER_PYTHON_COMMAND: /opt/venv/bin/python3
STIRLING_PDF_JSON_CFF_CONVERTER_PYTHON_SCRIPT: /scripts/convert_cff_to_ttf.py
LOGGING_LEVEL_stirling.software.SPDF.service.PdfJsonConversionService: TRACE
networks:
- stirling-network
-56
View File
@@ -1,56 +0,0 @@
# PDF Text Editor Backlog
- **Type3 Font Support (Text Additions)**
- Parse Type3 charprocs to extract glyph outlines, build a synthetic TrueType/OpenType font (FontTools, Ghostscript `ps2ttf`, etc.), and store it in `webProgram` / `pdfProgram` for client use.
- Preserve the original Type3 resources for round-trip fidelity; use the synthesized font only for edited elements while reusing the original stream elsewhere.
- Extend conversion logic so fallback kicks in only when conversion fails, and track which elements rely on the synthetic font to avoid mixing source glyphs (`PdfJsonConversionService.java:998-1090`, `1840-2012`).
- Update the viewer/renderer to surface conversion errors and block editing when no faithful font can be produced.
- **Lazy Fetch Endpoints**
- Provide separate endpoints to fetch:
1. Raw COS dictionaries/font programs when the user opens advanced panels.
2. Page-level raster/vector previews to avoid sending large `imageData` upfront.
- Reuse the existing job cache (`documentCache`) to serve these on demand and clean up after timeouts (`PdfJsonConversionService.java:3608-3687`).
- **Editor UX Safeguards**
- Mark groups using fallback glyphs so the UI can warn about possible appearance shifts. Font family matching is now implemented (Liberation fonts), but weight matching is still TODO, so bold/italic text using fallbacks may appear lighter than original.
- Surface when Type3 conversion was downgraded (e.g., rasterized glyphs) and limit editing to operations that keep the PDF stable.
- Reference: `frontend/src/proprietary/components/tools/pdfTextEditor/PdfTextEditorView.tsx:1260-1287`
- **Canonical Font Sharing**
- Emit fonts once per unique embedded program. Add a `canonicalFonts` array containing the full payload (program, ToUnicode, metadata) and a compact `fontAliases` mapping `{pageNumber, fontId, canonicalUid}` so text elements can still reference per-page IDs.
- Note: COS dictionaries are currently preserved for TrueType/Type0 fonts (needed for ToUnicode CMap). The canonical approach should maintain this preservation while deduplicating font programs.
- Update `buildFontMap` to resolve aliases when recreating PDFBox fonts, and adjust the front end to load programs via the canonical UID.
- Optional: expose a lazy endpoint for the original COS dictionary if the canonical record strips it, so export still reconstructs untouched fonts.
- **Font Weight Matching for Fallback Fonts** ✓ COMPLETED (January 2025)
- Font family matching is now implemented:
- Liberation fonts (metric-compatible with Microsoft core): Arial/Helvetica→LiberationSans, Times→LiberationSerif, Courier→LiberationMono
- DejaVu fonts (widely used open source): DejaVu→DejaVuSans, DejaVuSerif, DejaVuMono
- Noto fonts (Google universal font): Noto→NotoSans
- Font weight/style matching is now implemented for multiple font families:
- Liberation Sans/Serif/Mono: Regular, Bold, Italic, BoldItalic (full support)
- Noto Sans: Regular, Bold, Italic, BoldItalic (full support)
- DejaVu Sans/Serif/Mono: Regular, Bold, Italic/Oblique, BoldItalic/BoldOblique (full support)
- All font variants registered in `BUILT_IN_FALLBACK_FONTS` map (`PdfJsonFallbackFontService.java:63-267`)
- Weight/style detection implemented in `resolveFallbackFontId()`:
- `detectBold()`: Detects "bold", "heavy", "black", or numeric weights 600-900 (e.g., "700wght")
- `detectItalic()`: Detects "italic" or "oblique"
- `applyWeightStyle()`: Applies appropriate suffix (handles both "italic" and "oblique" naming)
- All fonts consolidated from Type3 library into main fonts directory for unified fallback support
- Benefits: Comprehensive visual consistency when editing text in bold/italic fonts across many font families
- **Font Text Color Support**
- Add support for reading and preserving text color information from PDF content streams
- Enable color editing in the editor UI
- Ensure proper round-trip conversion maintains color fidelity
- **Space Character Handling**
- Improve handling of space characters as proper text elements
- Ensure spaces are correctly preserved during text extraction and reconstruction
- Fix any issues with space positioning and width calculations
- **Textbox Selection Enhancement**
- Improve textbox selection behavior in the editor
- Enhance user experience for selecting and manipulating text boxes
- Address any selection precision or interaction issues
File diff suppressed because it is too large Load Diff
-443
View File
@@ -1,443 +0,0 @@
# PDF JSON Type3 Font System
## Overview
The PDF Text editor needs to handle **Type3 fonts** - custom vector fonts embedded in PDFs that don't follow standard font formats. These are common in PDFs generated by Matplotlib, LaTeX, scientific papers, and presentation tools.
When converting a PDF to JSON for editing, Type3 fonts present two challenges:
1. **No Unicode mapping** - Character codes don't map to standard Unicode characters
2. **Custom glyphs** - Each font contains vector drawing instructions unique to that PDF
This document explains how the system handles Type3 fonts during the full PDF → JSON → PDF workflow.
---
## Architecture Flow
### PDF → JSON Conversion Flow
```
┌─────────────┐
│ Input PDF │
└──────┬──────┘
│
▼
┌─────────────────────────────────┐
│ PDFBox Parsing │
│ - Extract text positions │
│ - Identify fonts │
└──────┬──────────────────────────┘
│
▼
┌─────────────────────────────────┐
│ Font Detection │
│ Is this a Type3 font? │
└──────┬──────────────────────────┘
│
├─── YES (Type3) ───────────────────────┐
│ │
▼ ▼
┌──────────────────────────┐ ┌──────────────────────────────┐
│ Type3FontConversion │ │ Extract Type3 Metadata │
│ Service │ │ - Glyph outlines (paths) │
│ │ │ - Character codes │
│ 1. Calculate signature │ │ - Font matrix │
│ 2. Match against │ │ - Bounding boxes │
│ library │ └──────────────────────────────┘
└──────┬───────────────────┘
│
▼
┌──────────────────────────────────────┐
│ Library Match? │
└──────┬───────────────────────────────┘
│
├─── FOUND ─────────────────────┐
│ │
│ ▼
│ ┌─────────────────────────────┐
│ │ Load Pre-built Font │
│ │ - TTF/OTF from library │
│ │ - Full Unicode mappings │
│ │ - Web + PDF payloads │
│ └──────────┬──────────────────┘
│ │
├─── NOT FOUND ──────────────────┘
│
▼
┌──────────────────────────────────────┐
│ Store Type3 Metadata in JSON │
│ - type3Glyphs: [{charCode, unicode, │
│ glyphName, outline}] │
│ - Original char codes preserved │
│ - Font marked as Type3 │
└──────┬───────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ PdfJsonDocument Output │
│ { │
│ fonts: [{ │
│ id: "F1", │
│ baseName: "ABCD+DejaVuSans", │
│ subtype: "Type3", │
│ type3Glyphs: [...], │
│ conversionCandidates: [{ │
│ strategyId: "type3-library", │
│ status: "SUCCESS", │
│ pdfProgram: "base64...", │
│ glyphCoverage: [65,66,67...] │
│ }] │
│ }], │
│ textElements: [{ │
│ text: "Hello", │
│ fontId: "F1", │
│ charCodes: [72,101,108,108,111]│
│ }] │
│ } │
└─────────────────────────────────────┘
```
### JSON → PDF Conversion Flow
```
┌─────────────────────────────────────┐
│ Input JSON (edited by user) │
└──────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Load Fonts from JSON │
│ - Check for conversionCandidates │
│ - Check for type3Glyphs │
└──────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Has conversionCandidates? │
└──────┬──────────────────────────────┘
│
├─── YES (Library Match) ───────┐
│ │
│ ▼
│ ┌─────────────────────────────┐
│ │ Load from Candidate │
│ │ 1. Decode base64 pdfProgram│
│ │ 2. Create PDType0Font │
│ │ 3. Embed in new PDF │
│ └──────────┬──────────────────┘
│ │
├─── NO (Use Type3 Metadata) ───┘
│
▼
┌──────────────────────────────────────┐
│ Text Rendering Strategy │
│ - Normalized Type3 fonts: │
│ Use original text (font has │
│ Unicode mappings) │
│ │
│ - Actual Type3 fonts: │
│ Use charCodes array │
│ │
│ - Other fonts: │
│ Standard encoding │
└──────┬───────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Generate PDF Content Streams │
│ - Set font: /F1 12 Tf │
│ - Position text: x y Td │
│ - Show text: (encoded) Tj │
└──────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Output PDF │
│ - Fonts embedded correctly │
│ - Text renders with proper glyphs │
│ - Preserves visual appearance │
└─────────────────────────────────────┘
```
---
## Key Components
### 1. Type3 Font Signature Matching
**Location:** `Type3FontSignatureCalculator.java`
**Purpose:** Creates a unique fingerprint of a Type3 font based on its glyph shapes.
**How it works:**
```java
// 1. Extract glyph outlines from Type3 font
List<Type3GlyphOutline> glyphs = extractor.extractGlyphs(document, font, fontId, pageNumber);
// 2. Normalize and hash the shapes
String signature = calculator.calculateSignature(glyphs);
// Result: "sha256:2be58b6ef1e29a83b8634d70b9e32c37a15dea2e..."
// 3. Look up in library
Optional<Match> match = library.findBySignature(signature);
```
**Signature includes:**
- Glyph outline paths (curves, lines)
- Glyph bounding boxes
- Advance widths
- Character code mappings
### 2. Type3 Font Library
**Location:** `app/core/src/main/resources/type3/library/`
**Structure:**
```
type3/library/
├── index.json # Font metadata and signatures
├── catalogue.json # Quick lookup of common fonts
└── fonts/
├── dejavu/
│ ├── DejaVuSans.ttf
│ ├── DejaVuSans-Bold.ttf
│ └── DejaVuSans-Oblique.ttf
├── cm/ # Computer Modern (LaTeX)
│ ├── cmr10.ttf
│ ├── cmmi10.ttf
│ └── cmsy10.ttf
├── stix/ # Scientific symbols
│ └── STIXSizeThreeSym-Regular.otf
└── scp/ # Monospace
└── SauceCodeProNerdFont-Regular.ttf
```
**index.json format:**
```json
[
{
"id": "dejavu-sans-bold",
"label": "DejaVu Sans Bold",
"aliases": [
"DejaVuSans-Bold",
"EVICAO+DejaVuSans-Bold",
"dejavusans-bold"
],
"signatures": [
"sha256:a1b2c3d4...",
"sha256:e5f6g7h8..."
],
"pdfProgram": {
"resource": "type3/library/fonts/dejavu/DejaVuSans-Bold.ttf",
"format": "ttf"
},
"glyphCoverage": [32, 33, 65, 66, 67, ...],
"source": "DejaVu Fonts 2.37"
}
]
```
### 3. Normalized vs Actual Type3 Fonts
The system handles two types of Type3 fonts differently:
**Normalized Type3 Fonts:**
- Original PDF has Type3 font
- Matched against library
- Replaced with standard TTF/OTF
- Font object is `PDType0Font` (not `PDType3Font`)
- Has proper Unicode mappings
**Actual Type3 Fonts:**
- Original PDF has Type3 font
- No library match found
- Keeps Type3 glyph data in JSON
- Font object is `PDType3Font`
- Uses character codes instead of Unicode
**Rendering logic (PdfJsonConversionService.java:2411-2463):**
```java
boolean isNormalizedType3 = !(run.font() instanceof PDType3Font)
&& runFontModel != null
&& runFontModel.getType3Glyphs() != null
&& !runFontModel.getType3Glyphs().isEmpty();
if (isNormalizedType3) {
// Font has Unicode mappings, use text directly
contentStream.showText(run.text());
} else {
// Use raw byte encoding (for Type3 or other fonts)
byte[] encoded = encodeTextWithFont(run.font(), fontModel, run.text(), charCodes);
contentStream.showText(new String(encoded, StandardCharsets.ISO_8859_1));
}
```
### 4. Character Code Preservation
**Why needed:** Type3 fonts often lack ToUnicode mappings. We preserve the original character codes so text can be reconstructed.
**Storage in JSON:**
```json
{
"text": "Hello",
"fontId": "F1",
"charCodes": [72, 101, 108, 108, 111]
}
```
**Extraction (PDF → JSON):**
```java
// TextCollectingStripper.java:4431-4443
if (pdfont instanceof PDType3Font) {
int[] codes = position.getCharacterCodes();
if (codes != null && codes.length > 0) {
element.setCharCodes(Arrays.stream(codes)
.boxed()
.collect(Collectors.toList()));
}
}
```
### 5. Font Embedding Strategies
When converting JSON → PDF, fonts are embedded based on their type:
| Font Type | Strategy | Implementation |
|-----------|----------|----------------|
| **Normalized Type3** | Load TTF/OTF from library, embed as PDType0Font | `conversionCandidates[0].pdfProgram` |
| **Standard fonts** | Use system fonts or embedded fonts from original | PDFBox standard loading |
| **CFF/Type1C fonts** | Wrap as OpenType-CFF for browser compatibility | Optional Python converter |
| **Actual Type3** | Keep original Type3 definition | Preserve from original PDF |
---
## Configuration
**settings.yml:**
```yaml
processing:
pdf-json:
fonts:
type3:
library:
enabled: true
index: classpath:/type3/library/index.json
```
**Environment variables:**
```bash
# Disable Type3 library matching
STIRLING_PDF_JSON_TYPE3_LIBRARY_ENABLED=false
# Use custom library
STIRLING_PDF_JSON_TYPE3_LIBRARY_INDEX=file:/path/to/custom/index.json
```
---
## Debugging
### View Type3 Font Information
**Backend logs** show signature matching:
```
[TYPE3] Strategy type3-library finished with status SUCCESS
(message: Matched DejaVu Sans Bold via alias:dejavusans-bold)
for font 1:F2
[TYPE3-RUNTIME] Loading library font F2 WITHOUT subsetting
(full glyph set) from candidate:type3-library:pdfProgram
```
### Check JSON Output
Look for `type3Glyphs` in font definitions:
```json
{
"id": "F1",
"baseName": "BMQQDV+DejaVuSans",
"subtype": "Type3",
"type3Glyphs": [
{
"charCode": 65,
"glyphName": "A",
"unicode": 65,
"advanceWidth": 684,
"bbox": [0, 0, 684, 729],
"outline": "M 72 0 L ..."
}
]
}
```
### Test Signature Calculation
Use the CLI tool to analyze any PDF:
```bash
./gradlew :proprietary:type3SignatureTool \
--args="--pdf sample.pdf --output analysis.json --pretty"
```
Output shows all Type3 fonts with their signatures and glyph coverage.
---
## Performance Considerations
### Memory Management
- **Type3 glyph data** can be large (detailed vector paths)
- **Font subsetting** not used for library fonts (full glyph set loaded)
- **Caching:** Library fonts are loaded once and cached per conversion
### File Size Impact
- **JSON size:** Type3 glyph data adds ~5-50KB per font
- **PDF size:** Embedding TTF/OTF fonts adds ~50-500KB per font
- **Optimization:** Use library matching to avoid storing raw Type3 data
---
## Limitations
1. **Library coverage:** Only common Type3 fonts are in the library
- Matplotlib (DejaVu Sans family)
- LaTeX (Computer Modern)
- STIX Math symbols
2. **Glyph accuracy:** Signature matching assumes exact glyph shapes
- Slight variations may not match
- Subset fonts may have different signatures
3. **Unicode mapping:** Unmatched Type3 fonts lose Unicode text
- Character codes preserved but not searchable
- Copy/paste may not work correctly
4. **No runtime synthesis:** Unlike earlier designs, no attempt to convert Type3 to TTF at runtime
- All conversions must be pre-built in library
- Unknown Type3 fonts keep their Type3 definition
---
## Related Files
### Backend (Java)
- `PdfJsonConversionService.java` - Main conversion logic
- `Type3FontConversionService.java` - Signature calculation and matching
- `Type3FontLibrary.java` - Library loading and lookup
- `Type3GlyphExtractor.java` - Extract glyph data from Type3 fonts
- `Type3FontSignatureCalculator.java` - Create font fingerprints
- `PdfJsonFontType3Glyph.java` - Model for Type3 glyph data
### Frontend (TypeScript)
- `pdfTextEditorTypes.ts` - Type definitions for JSON structure
- `pdfTextEditorUtils.ts` - Font handling utilities
### Resources
- `type3/library/index.json` - Font library metadata
- `type3/library/fonts/` - Actual font files (TTF/OTF)
- `settings.yml.template` - Configuration options
### Documentation
- `pdf_text_edit_flow.md` - Overall text editing architecture
- `type3_fallback_plan.md` - Original design and planning
-660
View File
@@ -1,660 +0,0 @@
# Type3 Font Library Management Guide
## Overview
This guide explains how to add new fonts to the Type3 font library, including:
1. Finding Type3 fonts in PDFs
2. Extracting and analyzing Type3 fonts
3. Adding pre-converted TTF/OTF fonts to the library
4. Importing fonts with example PDFs
---
## Two Approaches to Adding Fonts
### Approach 1: Import Existing TTF/OTF Files
**When to use:** You already have a TTF/OTF file that matches a Type3 font you encounter.
**Example:** You find a PDF with a Type3 font that's actually DejaVu Sans, and you have the official DejaVu Sans TTF file.
### Approach 2: Extract from Type3 PDFs
**When to use:** The Type3 font is unique to a PDF (no standard equivalent exists).
**Example:** Custom corporate fonts, specialized scientific notation, or generated fonts.
---
## Approach 1: Import Existing TTF/OTF Files
This is the **recommended approach** when possible, as it gives you the full font with proper Unicode mappings.
### Step 1: Find the Type3 Font Signature
Use the signature tool to analyze a PDF containing the Type3 font:
```bash
./gradlew :proprietary:type3SignatureTool \
--args="--pdf examples/matplotlib_chart.pdf --output matplotlib_fonts.json --pretty"
```
**Output (`matplotlib_fonts.json`):**
```json
{
"fonts": [
{
"fontId": "F1",
"pageNumber": 1,
"baseName": "BMQQDV+DejaVuSans",
"subtype": "Type3",
"signature": "sha256:2be58b6ef1e29a83b8634d70b9e32c37a15dea2e608894439ef7224c35b77f5d",
"glyphCount": 50,
"glyphs": [
{
"charCode": 65,
"glyphName": "A",
"unicode": 65,
"advanceWidth": 684,
"bbox": [0, 0, 684, 729]
}
]
}
]
}
```
**Key information:**
- `signature`: Unique fingerprint of this font
- `baseName`: Font name in the PDF (often subset like "BMQQDV+DejaVuSans")
- `glyphs`: Character codes and Unicode mappings
### Step 2: Obtain the Matching TTF/OTF File
**Sources:**
1. **System fonts:** Check if the font is already installed
- Windows: `C:\Windows\Fonts\`
- Linux: `/usr/share/fonts/`
- macOS: `/Library/Fonts/`
2. **Official font websites:**
- [DejaVu Fonts](https://dejavu-fonts.github.io/)
- [Computer Modern Unicode](https://www.fontsquirrel.com/fonts/computer-modern)
- [STIX Fonts](https://www.stixfonts.org/)
- [Google Fonts](https://fonts.google.com/)
3. **Font foundries:** If it's a commercial font, you'll need a license
**Example - Getting DejaVu Sans:**
```bash
# Download from official source
wget https://github.com/dejavu-fonts/dejavu-fonts/releases/download/version_2_37/dejavu-fonts-ttf-2.37.tar.bz2
# Extract
tar xjf dejavu-fonts-ttf-2.37.tar.bz2
# Copy the needed font
cp dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf app/core/src/main/resources/type3/library/fonts/dejavu/
```
### Step 3: Add Entry to Library Index
Edit `app/core/src/main/resources/type3/library/index.json`:
```json
[
{
"id": "dejavu-sans-regular",
"label": "DejaVu Sans",
"aliases": [
"DejaVuSans",
"BMQQDV+DejaVuSans",
"DejaVuSansDisplay",
"dejavusans"
],
"signatures": [
"sha256:2be58b6ef1e29a83b8634d70b9e32c37a15dea2e608894439ef7224c35b77f5d"
],
"pdfProgram": {
"resource": "type3/library/fonts/dejavu/DejaVuSans.ttf",
"format": "ttf"
},
"webProgram": {
"resource": "type3/library/fonts/dejavu/DejaVuSans.ttf",
"format": "ttf"
},
"glyphCoverage": [32, 33, 65, 66, 67, 68, 69, ...],
"source": "DejaVu Fonts 2.37"
}
]
```
**Field descriptions:**
| Field | Required | Description | Example |
|-------|----------|-------------|---------|
| `id` | ✅ | Unique identifier (lowercase, hyphenated) | `"dejavu-sans-bold"` |
| `label` | ✅ | Human-readable name | `"DejaVu Sans Bold"` |
| `aliases` | ✅ | Font name variations to match | `["DejaVuSans-Bold", "EVICAO+DejaVuSans-Bold"]` |
| `signatures` | ✅ | SHA256 hashes from signature tool | `["sha256:a1b2c3..."]` |
| `pdfProgram` | ✅ | Font file for PDF embedding | See below |
| `webProgram` | ⚠️ | Font file for browser preview (can be same as pdfProgram) | See below |
| `glyphCoverage` | ❌ | Unicode code points covered (optional) | `[65, 66, 67]` |
| `source` | ❌ | Attribution/version info (optional) | `"DejaVu Fonts 2.37"` |
**Program format:**
```json
"pdfProgram": {
"resource": "type3/library/fonts/dejavu/DejaVuSans.ttf",
"format": "ttf"
}
```
- `resource`: Path relative to classpath root (or absolute file:// path)
- `format`: `"ttf"` or `"otf"`
### Step 4: Add to Catalogue (Optional)
Edit `app/core/src/main/resources/type3/catalogue.json`:
```json
{
"fonts": [
{
"name": "DejaVuSans",
"source": "Matplotlib PDFs",
"variants": ["Regular", "Bold", "Oblique"],
"status": "complete"
}
]
}
```
### Step 5: Test the Font
1. **Rebuild the application:**
```bash
./gradlew clean build
```
2. **Convert a PDF with the Type3 font:**
```bash
curl -X POST http://localhost:8080/api/v1/convert/pdf/to-json \
-F file=@test.pdf \
-o output.json
```
3. **Check the JSON output:**
```bash
# Look for conversionCandidates
cat output.json | jq '.fonts[] | select(.baseName | contains("DejaVu"))'
```
4. **Expected output:**
```json
{
"id": "F1",
"baseName": "BMQQDV+DejaVuSans",
"subtype": "Type3",
"conversionCandidates": [
{
"strategyId": "type3-library",
"status": "SUCCESS",
"message": "Matched DejaVu Sans via alias:dejavusans",
"pdfProgram": "T1RUTwAJAIAAAwAQQ0ZGIHHwJ9o...",
"pdfProgramFormat": "ttf"
}
]
}
```
5. **Test round-trip conversion:**
```bash
# Convert back to PDF
curl -X POST http://localhost:8080/api/v1/convert/json/to-pdf \
-F file=@output.json \
-o roundtrip.pdf
# Verify text renders correctly
pdftotext roundtrip.pdf - | head
```
---
## Approach 2: Extract from Type3 PDFs
When no standard TTF/OTF exists, you can convert the Type3 font itself.
⚠️ **Note:** This produces a synthetic font that may not be perfect. Use Approach 1 whenever possible.
### Step 1: Extract Type3 Metadata
Same as Approach 1 - use the signature tool:
```bash
./gradlew :proprietary:type3SignatureTool \
--args="--pdf custom_font.pdf --output custom_font_analysis.json --pretty"
```
### Step 2: Convert Type3 to TTF Using Python Script
Use the included conversion script:
```bash
# Install fontTools if not already installed
pip install fonttools
# Convert the Type3 font
python scripts/type3_to_cff.py \
--input custom_font_analysis.json \
--output-cff custom_font.otf \
--output-ttf custom_font.ttf \
--font-name "CustomFont" \
--family-name "Custom Font Family"
```
**Script options:**
- `--input`: JSON file from signature tool
- `--output-cff`: OpenType-CFF output (best for PDF)
- `--output-ttf`: TrueType output (best for web)
- `--font-name`: PostScript name (no spaces)
- `--family-name`: Human-readable name
### Step 3: Copy Font to Library
```bash
# Create directory for custom fonts
mkdir -p app/core/src/main/resources/type3/library/fonts/custom/
# Copy the converted fonts
cp custom_font.otf app/core/src/main/resources/type3/library/fonts/custom/
cp custom_font.ttf app/core/src/main/resources/type3/library/fonts/custom/
```
### Step 4: Add to Library Index
Same as Approach 1, but note the synthetic nature:
```json
{
"id": "custom-font-regular",
"label": "Custom Font",
"aliases": ["CustomFont", "ABCDEF+CustomFont"],
"signatures": ["sha256:extracted-from-json"],
"pdfProgram": {
"resource": "type3/library/fonts/custom/custom_font.otf",
"format": "otf"
},
"webProgram": {
"resource": "type3/library/fonts/custom/custom_font.ttf",
"format": "ttf"
},
"source": "Converted from custom_font.pdf",
"glyphCoverage": [65, 66, 67, 68, 69]
}
```
### Step 5: Quality Check
Type3 → TTF conversion may have issues:
1. **Check glyph rendering:**
- Open the TTF in a font viewer (FontForge, FontDrop)
- Verify all glyphs look correct
2. **Check metrics:**
- Compare advance widths to original
- Verify bounding boxes
3. **Test in PDF:**
- Create a test document using the font
- Verify it renders the same as the original PDF
---
## Adding Fonts with Example PDFs
### Scenario: You Want to Support Matplotlib PDFs
Matplotlib uses DejaVu Sans fonts but embeds them as Type3 fonts with subset names.
### Step 1: Collect Example PDFs
```bash
# Create a samples directory
mkdir -p samples/matplotlib/
# Download or copy example PDFs
cp ~/Downloads/matplotlib_chart.pdf samples/matplotlib/01_chart.pdf
cp ~/Downloads/matplotlib_plot.pdf samples/matplotlib/02_plot.pdf
```
### Step 2: Batch Analyze Fonts
```bash
# Analyze all samples
for pdf in samples/matplotlib/*.pdf; do
basename=$(basename "$pdf" .pdf)
./gradlew :proprietary:type3SignatureTool \
--args="--pdf $pdf --output analysis_${basename}.json --pretty"
done
```
### Step 3: Identify Common Fonts
Use the summarize script to see what fonts appear:
```bash
python scripts/summarize_type3_signatures.py \
--signatures-dir . \
--output summary.md
```
**Output (`summary.md`):**
```markdown
# Type3 Font Signature Inventory
## Fonts by Signature
### sha256:2be58b6ef1e...
- **Alias:** DejaVuSans, BMQQDV+DejaVuSans
- **Seen in:** 01_chart.pdf, 02_plot.pdf
- **Status:** ✅ In library (dejavu-sans-regular)
### sha256:a1b2c3d4e5f6...
- **Alias:** DejaVuSans-Bold, EVICAO+DejaVuSans-Bold
- **Seen in:** 01_chart.pdf
- **Status:** ❌ Missing from library
```
### Step 4: Add Missing Fonts
For each missing font:
1. **Download the standard version:**
```bash
# DejaVu Sans Bold
wget https://github.com/dejavu-fonts/dejavu-fonts/releases/download/version_2_37/dejavu-fonts-ttf-2.37.tar.bz2
tar xjf dejavu-fonts-ttf-2.37.tar.bz2
cp dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Bold.ttf \
app/core/src/main/resources/type3/library/fonts/dejavu/
```
2. **Add to index.json:**
```json
{
"id": "dejavu-sans-bold",
"label": "DejaVu Sans Bold",
"aliases": [
"DejaVuSans-Bold",
"EVICAO+DejaVuSans-Bold",
"dejavusans-bold"
],
"signatures": [
"sha256:a1b2c3d4e5f6..."
],
"pdfProgram": {
"resource": "type3/library/fonts/dejavu/DejaVuSans-Bold.ttf",
"format": "ttf"
},
"webProgram": {
"resource": "type3/library/fonts/dejavu/DejaVuSans-Bold.ttf",
"format": "ttf"
},
"source": "DejaVu Fonts 2.37"
}
```
### Step 5: Update Library Automatically
Use the update script to sync signatures:
```bash
python scripts/update_type3_library.py \
--signatures-dir . \
--apply
```
This script:
- Reads all `analysis_*.json` files
- Matches them to library entries by alias
- Updates signatures and glyph coverage
- Writes back to `index.json`
### Step 6: Verify Coverage
Test with all your example PDFs:
```bash
for pdf in samples/matplotlib/*.pdf; do
echo "Testing $pdf..."
curl -X POST http://localhost:8080/api/v1/convert/pdf/to-json \
-F file=@"$pdf" \
-o test_output.json
# Check for successful matches
matches=$(cat test_output.json | jq '[.fonts[].conversionCandidates[] | select(.status == "SUCCESS")] | length')
total=$(cat test_output.json | jq '.fonts | length')
echo " Matched $matches of $total fonts"
done
```
---
## Common Fonts to Add
### Matplotlib (Python plotting library)
**Fonts used:** DejaVu Sans family
```bash
# Download DejaVu fonts
wget https://github.com/dejavu-fonts/dejavu-fonts/releases/download/version_2_37/dejavu-fonts-ttf-2.37.tar.bz2
tar xjf dejavu-fonts-ttf-2.37.tar.bz2
# Copy needed variants
cp dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf \
app/core/src/main/resources/type3/library/fonts/dejavu/
cp dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Bold.ttf \
app/core/src/main/resources/type3/library/fonts/dejavu/
cp dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Oblique.ttf \
app/core/src/main/resources/type3/library/fonts/dejavu/
cp dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf \
app/core/src/main/resources/type3/library/fonts/dejavu/
```
### LaTeX Documents
**Fonts used:** Computer Modern family
```bash
# Download Computer Modern Unicode
wget https://downloads.sourceforge.net/project/cm-unicode/cm-unicode/0.7.0/cm-unicode-0.7.0-ttf.tar.xz
tar xJf cm-unicode-0.7.0-ttf.tar.xz
# Copy common variants
cp cm-unicode-0.7.0/cmunrm.ttf \
app/core/src/main/resources/type3/library/fonts/cm/cmr10.ttf
cp cm-unicode-0.7.0/cmunti.ttf \
app/core/src/main/resources/type3/library/fonts/cm/cmmi10.ttf
cp cm-unicode-0.7.0/cmunsy.ttf \
app/core/src/main/resources/type3/library/fonts/cm/cmsy10.ttf
```
### Scientific Documents
**Fonts used:** STIX fonts
```bash
# Download STIX
wget https://github.com/stipub/stixfonts/raw/master/fonts/static_otf/STIXTwoText-Regular.otf
# Copy to library
cp STIXTwoText-Regular.otf \
app/core/src/main/resources/type3/library/fonts/stix/
```
---
## Troubleshooting
### Signature Doesn't Match
**Problem:** You added a font but PDFs still don't match.
**Causes:**
1. **Different font version:** The Type3 font in the PDF uses a different version
2. **Subset differences:** Subset fonts may have different signatures
3. **Alias mismatch:** Font name in PDF doesn't match any alias
**Solutions:**
1. **Check the PDF's font name:**
```bash
pdffonts sample.pdf
```
Output shows: `BMQQDV+DejaVuSans`
2. **Add the subset name as an alias:**
```json
"aliases": [
"DejaVuSans",
"BMQQDV+DejaVuSans", // Add this
"dejavusans"
]
```
3. **Add multiple signatures:**
```json
"signatures": [
"sha256:original-signature",
"sha256:subset-signature" // Add from your PDF
]
```
### Font Renders Incorrectly
**Problem:** Text appears but glyphs look wrong.
**Causes:**
1. **Wrong font file:** You matched a different font
2. **Glyph coverage mismatch:** Font doesn't have all the glyphs
3. **Encoding issues:** Character codes don't match
**Solutions:**
1. **Verify it's the right font:**
- Open both the Type3 PDF and your TTF in a font viewer
- Compare glyph shapes visually
2. **Check glyph coverage:**
```bash
# Extract glyphs from Type3
./gradlew :proprietary:type3SignatureTool \
--args="--pdf sample.pdf --output analysis.json"
# Compare to font file
ttfdump -t cmap your_font.ttf | grep "glyphID"
```
3. **Use a more complete font version:**
- Get the full font (not a subset)
- Ensure all Unicode ranges are covered
### Missing Glyphs
**Problem:** Some characters don't render.
**Cause:** The TTF/OTF file doesn't have all the glyphs that the Type3 font had.
**Solution:** You need a more complete font, or must use Approach 2 to convert the Type3 font itself.
---
## Library Maintenance Scripts
### `type3SignatureTool`
**Purpose:** Analyze Type3 fonts in a PDF
```bash
./gradlew :proprietary:type3SignatureTool \
--args="--pdf INPUT.pdf --output OUTPUT.json [--pretty]"
```
### `summarize_type3_signatures.py`
**Purpose:** Create an inventory of fonts across multiple PDFs
```bash
python scripts/summarize_type3_signatures.py \
--signatures-dir path/to/jsons/ \
--output inventory.md
```
### `update_type3_library.py`
**Purpose:** Sync signature JSON files with library index
```bash
# Dry run (show what would change)
python scripts/update_type3_library.py \
--signatures-dir analysis/
# Apply changes
python scripts/update_type3_library.py \
--signatures-dir analysis/ \
--apply
```
### `type3_to_cff.py`
**Purpose:** Convert Type3 glyph JSON to TTF/OTF
```bash
python scripts/type3_to_cff.py \
--input type3_data.json \
--output-cff font.otf \
--output-ttf font.ttf \
--font-name MyFont \
--family-name "My Font Family"
```
---
## Best Practices
1. **Always prefer official fonts** (Approach 1) over synthesized ones (Approach 2)
2. **Use multiple signatures** for fonts that appear in different PDFs with different subset names
3. **Test with real PDFs** before considering a font "done"
4. **Document the source** in the `source` field for attribution and versioning
5. **Keep example PDFs** for each font in case you need to debug later
6. **Version the library** - commit `index.json` changes with clear descriptions
---
## File Size Considerations
### Font File Sizes
Typical sizes:
- **DejaVu Sans:** ~750KB per variant
- **Computer Modern:** ~200-400KB per variant
- **STIX Math:** ~500KB-1MB per variant
### Library Size Management
Current library: **~3MB** (10 fonts)
To keep the library manageable:
1. **Only include common fonts** (used in >5% of PDFs you process)
2. **Don't include every variant** (e.g., skip "Ultra Light" if rarely used)
3. **Consider subsetting** for languages you don't support
4. **Use OTF/CFF over TTF** when possible (better compression for PDF)
---
## Related Documentation
- [PDF JSON Type3 Font System](pdf_json_type3_fonts.md) - Technical architecture
- [PDF Text Edit Flow](pdf_text_edit_flow.md) - Overall editing workflow
- [Type3 Fallback Plan](type3_fallback_plan.md) - Original design document
-50
View File
@@ -1,50 +0,0 @@
# PDF Text Edit Flow
This high-level diagram shows every major component involved when a user edits text inside a PDF via the JSON editor. It highlights where fonts (especially Type3) are captured, matched against the library, and re-applied during export.
```mermaid
flowchart TD
%% Upload & Extraction
A([Upload PDF]) --> B[PdfJsonConversionService]
B --> B1[Optional Ghostscript preflight]
B1 --> B2[Iterate pages & resources]
B2 --> B3[Extract text runs + fonts]
%% Font handling (serial tree)
B3 --> C{Font subtype?}
C -->|Type 0 / TrueType / CID| C1[Copy embedded program bytes]
C -->|Type3| C2[Type3FontConversionService]
C1 --> C4[Attach font payload + metadata]
C2 --> C21{Library match?}
C21 --|Yes|--> C22[Inject canonical TTF/OTF from library]
C21 --|No|--> C23[Mark unsupported<br/>& keep Type3 glyphs]
C2 --> C25[Record glyph charCodes + unicode mapping]
C22 --> C25
C23 --> C25
%% JSON output
C4 --> D[Build PdfJsonDocument (pages, fonts, elements)]
C25 --> D
D --> E([Send JSON to UI])
%% Edit round-trip
E --> F[User edits text/elements]
F --> G[Patched JSON POSTed back]
G --> H{Regeneration pipeline}
H --> H1[Resolve fonts + candidates]
H1 --> H11[Prefer library/embedded payloads]
H1 --> H12[Fallback font service for missing glyphs]
H --> H2{Can rewrite token stream?}
H2 -->|Yes| H21[Rewrite existing operators]
H2 -->|No| H22[Full page regeneration]
H22 --> H23[Embed canonical fonts + Type3 glyph codes]
H21 --> I[Apply annotations/metadata]
H23 --> I
I --> J([Download edited PDF])
```
**Key points**
- Type3 conversion happens entirely inside `Type3FontConversionService`. Matching entries pull canonical fonts from the library; when a signature is missing we simply keep the original Type3 glyph codes until a library entry is added.
- Raw Type3 char codes are preserved in `PdfJsonTextElement.charCodes` so edits can fall back to the original glyph sequence when users do not change the text.
- When the frontend submits changes, the backend preflights each text run, picks the proper font candidate (library > embedded > fallback), and rewrites the PDF with either token replacements or full page regeneration.
- Glyph coverage metadata from the Type3 library now informs which fonts can legitimately render new characters, so added text keeps using the original Type3 face whenever its coverage includes those code points.
File diff suppressed because it is too large Load Diff
-191
View File
@@ -1,191 +0,0 @@
# Type3 Signature Inventory
_Generated from `docs\type3\signatures`. Run `scripts/summarize_type3_signatures.py` after capturing new samples._
## Alias: `cmex10`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:bdff85a28d968fea7fbffcf4869b1a28bdd7eb8b73230a016b41bdcbe28de94b` | `01_Matplotlib.pdf` | 1 | 90 |
## Alias: `cmmi10`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:6c72170517812e39f970746f53a2ae08dafbbe7374c20bcb4d5a60adc49cb77b` | `01_Matplotlib.pdf` | 2 | 100, 120 |
## Alias: `cmr10`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:5b535a05c982fb8ff029dfbedd5e9d28c1c4379ebac259d207f65606a94e5b15` | `01_Matplotlib.pdf` | 3 | 48, 49, 53 |
## Alias: `cmsy10`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:1324cd8127143ef9023616b7911c570db3b1eb35758cdc9258ec16c0f4587775` | `01_Matplotlib.pdf` | 1 | 48 |
| `sha256:2832e219b2db3bacf0d5a147d4b74ad5226fdf7562c395ef3fb12937633e037d` | `01_Matplotlib.pdf` | 1 | 8734 |
## Alias: `dejavusans`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:2be58b6ef1e29a83b8634d70b9e32c37a15dea2e608894439ef7224c35b77f5d` | `01_Matplotlib.pdf` | 7 | 46, 48, 49, 50, 52, 53, 55 |
| `sha256:994c963d70041eee141fd275fa22c525a71283de2b4a952814d02e0bbfa8caea` | `01_Matplotlib.pdf` | 4 | 46, 48, 49, 53 |
| `sha256:93573cb1ab32b9cb09378298fb120de079f6a309908d2ee86f91392a6aba5c31` | `01_Matplotlib.pdf` | 30 | 32, 45, 48, 49, 50, 51, 52, 53, 54, 55 |
| `sha256:4febfad91e0141f9658506a0bf8fc2a449f0ea7d97b44e95fc9a970c77af4b0a` | `01_Matplotlib.pdf` | 7 | 48, 49, 50, 51, 52, 53, 54 |
| `sha256:0386e5811612ba4b998d57cd3869d7fbc48092a79d436deda774af107a4af813` | `01_Matplotlib.pdf` | 9 | 46, 48, 49, 50, 51, 52, 53, 54, 55 |
| `sha256:b95fa2a272cbc950b81320790d04fcf19ebb24050fa2139ba6a474172cac596b` | `01_Matplotlib.pdf` | 20 | 32, 40, 41, 48, 50, 52, 54, 56, 83, 85 |
| `sha256:d034d16ac69e3e1c5008e77c4c24dc3179308a2742601e89d5c8ab327e4040dd` | `01_Matplotlib.pdf` | 15 | 43, 48, 49, 50, 51, 56, 61, 97, 98, 105 |
| `sha256:85e16e36ed0290c149647be7e468a7c46e7b66fd290131213040f7bad905aa44` | `01_Matplotlib.pdf` | 25 | 32, 45, 46, 48, 49, 50, 52, 53, 54, 56 |
| `sha256:85e16e36ed0290c149647be7e468a7c46e7b66fd290131213040f7bad905aa44` | `01_Matplotlib.pdf` | 25 | 32, 45, 46, 48, 49, 50, 52, 53, 54, 56 |
| `sha256:3654d4d9bcbbf6ad51628082203094069a17aad3a5e6f5c7972833566e42ab6b` | `01_Matplotlib.pdf` | 29 | 32, 46, 48, 49, 50, 51, 52, 53, 54, 55 |
| `sha256:d0c6cddc416d130701395246621a0f669fc292df4097a7a74395602faf4475df` | `01_Matplotlib.pdf` | 17 | 48, 49, 53, 97, 100, 101, 102, 103, 105, 108 |
| `sha256:cadf43a2df81340368af44c76b499223931d78dcc76c70cf4b4a93d133e368af` | `01_Matplotlib.pdf` | 27 | 32, 46, 48, 49, 50, 52, 54, 56, 84, 97 |
| `sha256:f1a874c4268b1bffffc99acabbe0a60aa662611b4bac0e688e4fc0ae3f2033bb` | `01_Matplotlib.pdf` | 7 | 46, 48, 49, 50, 52, 54, 56 |
| `sha256:e3d87c113463c8642a4f22943064fd75c133ad31fe5efebf6de6abf211b74b5a` | `01_Matplotlib.pdf` | 7 | 48, 49, 50, 51, 52, 54, 56 |
| `sha256:d47afb7581e98f588f0e70953e8692249aaa2ec3df36fbd90985f27b1ce1cf50` | `01_Matplotlib.pdf` | 12 | 46, 48, 49, 50, 51, 52, 53, 54, 55, 97 |
| `sha256:e47b8f112a875361a43bcb6d9c6467e0296412d29e417e58a0e60c90b664d281` | `01_Matplotlib.pdf` | 9 | 46, 48, 50, 97, 99, 105, 108, 115, 118 |
| `sha256:9c67df2ac5c3dcf957dfb0cd048fa450322a72b5a2dfb05f816c536b3b090607` | `01_Matplotlib.pdf` | 19 | 32, 39, 46, 48, 49, 50, 53, 58, 97, 99 |
| `sha256:3ee773a0af6fdedb9853dca9f4d8b80a421a0024bdf06bea41f15d58e3b90c87` | `01_Matplotlib.pdf` | 13 | 46, 48, 49, 50, 52, 54, 56, 97, 99, 105 |
| `sha256:4fa06c90399d80b41cb718163a5d78af2b203df6b6579246fb0b24d349b7a591` | `01_Matplotlib.pdf` | 15 | 46, 48, 49, 50, 52, 53, 54, 56, 97, 98 |
| `sha256:e47b8f112a875361a43bcb6d9c6467e0296412d29e417e58a0e60c90b664d281` | `01_Matplotlib.pdf` | 9 | 46, 48, 50, 97, 99, 105, 108, 115, 118 |
| `sha256:ac6756c76d6e43b771cc1e643dfc7891dfaaac05aa5e302190d0a662838ab031` | `01_Matplotlib.pdf` | 13 | 46, 48, 49, 50, 51, 53, 55, 97, 99, 105 |
| `sha256:bf7b95498f7d00d228c5c155db62b6c1aa7e0215cca1690c9fdb0adcfd496b10` | `01_Matplotlib.pdf` | 14 | 46, 48, 49, 50, 65, 66, 67, 68, 97, 99 |
| `sha256:39b8e5ec8e20a788cd45166baf0ab796397f152c9cd8dec1f882c635380cad92` | `01_Matplotlib.pdf` | 13 | 46, 48, 49, 50, 52, 53, 54, 97, 99, 105 |
| `sha256:27b98489865df8df55f19e4505c093501f236465885ca3bf5b66b6f047a85bb2` | `01_Matplotlib.pdf` | 19 | 46, 48, 49, 50, 51, 52, 68, 70, 72, 76 |
| `sha256:497ddd27e1f56ef6504c61613e3a159bab13314a4970a3be13b3a556648964da` | `01_Matplotlib.pdf` | 12 | 46, 48, 49, 50, 51, 97, 98, 99, 105, 108 |
| `sha256:3b41f9e5f3a7ffa6f4cdffa2a46f02781ec1b2b0c99994707cfb139aa15a11e2` | `01_Matplotlib.pdf` | 5 | 32, 48, 49, 50, 53 |
| `sha256:93723fe436a1aa654db56caf133f56280444b9dc0682af50b83787c3e49ee3ec` | `01_Matplotlib.pdf` | 16 | 32, 48, 49, 50, 52, 53, 54, 56, 58, 97 |
| `sha256:a648cb0524465bcb3bf4a2f65e0761cfc5167b1871a7db9488bee11b56062727` | `01_Matplotlib.pdf` | 14 | 32, 46, 48, 49, 50, 52, 53, 54, 56, 58 |
| `sha256:2f18ed7f982aeb954aaae388ba0c75e3c676717ca324156b42bb17f3f20ef403` | `01_Matplotlib.pdf` | 18 | 46, 48, 49, 50, 52, 54, 97, 99, 101, 102 |
| `sha256:18ce863feb57f42f2b92ac85a8c55ef3eeaa15488c5d6cd8c724b085994c64fa` | `01_Matplotlib.pdf` | 12 | 46, 48, 49, 50, 51, 52, 97, 99, 105, 108 |
| `sha256:a3eb7054e426aad7d1fac1f39ad6d3f886e34c04f780def5cf22b53cb3a45b46` | `01_Matplotlib.pdf` | 15 | 46, 48, 49, 50, 52, 53, 54, 55, 56, 97 |
| `sha256:edd22119635bfb0f2bff750137c6c6400a7fae4ff80cc252d2e6f2ca88f599a7` | `01_Matplotlib.pdf` | 15 | 46, 48, 49, 50, 51, 52, 53, 54, 56, 97 |
| `sha256:aae1797f3e3ff55d71b02590333aff86663d6bb4a5768bed7550e5987f40afe8` | `01_Matplotlib.pdf` | 14 | 46, 48, 49, 50, 52, 53, 54, 56, 97, 99 |
| `sha256:0165552fad28860f2ea6079be7a87ea0833acde99309b3ef619c8f81707c46a3` | `01_Matplotlib.pdf` | 14 | 46, 48, 49, 50, 51, 52, 54, 97, 99, 105 |
| `sha256:792a1c5aaa1743ab203a363a8f6cd07c3b043e33c72e97c4ea21f5862158e6c1` | `01_Matplotlib.pdf` | 17 | 43, 46, 48, 49, 50, 51, 52, 53, 54, 56 |
| `sha256:f4bfd64f36bf33dea79800561a67f78d5ccdb436363574abf0892f58b376a2e6` | `01_Matplotlib.pdf` | 25 | 32, 46, 48, 49, 50, 51, 52, 53, 54, 85 |
| `sha256:119da04d962622c8aa46d77f6bdfccb5d4a4ef7173775275b046efd59098e5d9` | `01_Matplotlib.pdf` | 17 | 46, 48, 49, 50, 53, 55, 97, 101, 103, 105 |
| `sha256:003af1c45e3a5ab09544e226eba25e3a70abfe6e36dd48584474cc7a497685f6` | `01_Matplotlib.pdf` | 28 | 32, 40, 41, 46, 48, 49, 50, 52, 54, 56 |
| `sha256:88b3471db1978cc83233f249453806a8369c766b089b424c86c2584196ed5dbf` | `01_Matplotlib.pdf` | 14 | 46, 48, 49, 50, 52, 54, 56, 100, 101, 102 |
| `sha256:a15cc90b7fc110cef4f07fe8a692d572e1289a9ee29c95732294662fded4e042` | `01_Matplotlib.pdf` | 16 | 32, 46, 48, 49, 50, 51, 53, 79, 83, 97 |
| `sha256:fb54c23aa081562ac114676ffe43032c9c0fb63af3e5b7b3441b88872d1f2e7a` | `01_Matplotlib.pdf` | 16 | 46, 48, 49, 50, 52, 53, 54, 56, 66, 72 |
| `sha256:4b553d51d58f5891af071359fb016caf1c6137778da129a6b208dcc8cb0c4635` | `01_Matplotlib.pdf` | 9 | 46, 48, 49, 50, 51, 52, 53, 54, 56 |
| `sha256:93573cb1ab32b9cb09378298fb120de079f6a309908d2ee86f91392a6aba5c31` | `01_Matplotlib.pdf` | 30 | 32, 45, 48, 49, 50, 51, 52, 53, 54, 55 |
| `sha256:4febfad91e0141f9658506a0bf8fc2a449f0ea7d97b44e95fc9a970c77af4b0a` | `01_Matplotlib.pdf` | 7 | 48, 49, 50, 51, 52, 53, 54 |
| `sha256:0386e5811612ba4b998d57cd3869d7fbc48092a79d436deda774af107a4af813` | `01_Matplotlib.pdf` | 9 | 46, 48, 49, 50, 51, 52, 53, 54, 55 |
| `sha256:b95fa2a272cbc950b81320790d04fcf19ebb24050fa2139ba6a474172cac596b` | `01_Matplotlib.pdf` | 20 | 32, 40, 41, 48, 50, 52, 54, 56, 83, 85 |
| `sha256:b318f65b9dc209eb6f004e3a6c20a772ebbca3d752adc10c66a6a8a479da2838` | `01_Matplotlib.pdf` | 20 | 32, 40, 41, 46, 48, 49, 50, 52, 53, 54 |
| `sha256:64f725573c1f5d90196e94ed338a7af06baf274420414befeb9693c80acd0f77` | `01_Matplotlib.pdf` | 23 | 32, 46, 48, 49, 50, 51, 52, 53, 55, 57 |
| `sha256:9a701e082ba5a779e2b20b8de0c7844b3f7838ba8cd4bd7ef366893761fb994d` | `01_Matplotlib.pdf` | 10 | 46, 48, 49, 50, 51, 52, 53, 54, 55, 56 |
| `sha256:2f6f8d63ff6235f3b7cd6f5eba8076854892037afa2ea6962953b3e7cda3736e` | `01_Matplotlib.pdf` | 31 | 32, 40, 41, 44, 61, 65, 66, 67, 68, 70 |
| `sha256:f17b5eb0ee996d1388c548f79fa50fa2d8c6076959eff189bb745d156d54547f` | `01_Matplotlib.pdf` | 26 | 32, 39, 65, 66, 67, 68, 73, 97, 98, 100 |
| `sha256:f22c75548364bb25fc3efbe11f05c56e29f07c15c3046ddbc85a64e5cc5a97bd` | `01_Matplotlib.pdf` | 21 | 32, 48, 49, 50, 72, 80, 91, 93, 99, 100 |
| `sha256:54a6c2e4bc290b48e21eece7f81cb6633c4b53a91f198fdaabfc73743b0e4499` | `01_Matplotlib.pdf` | 15 | 48, 49, 50, 51, 52, 53, 54, 97, 100, 101 |
| `sha256:059af9dbaaab27c1d660ef00de6d4fd6e1687cfe2abca0a4c07265c2b2b450c6` | `01_Matplotlib.pdf` | 22 | 32, 46, 48, 49, 50, 51, 53, 55, 68, 77 |
| `sha256:6651550d7b913850087244b7a70961989c2efc6d8c8d060d8663ff087b7723f6` | `01_Matplotlib.pdf` | 20 | 32, 46, 48, 49, 50, 52, 54, 56, 97, 100 |
| `sha256:4d4ee6f04f57a40a589741df4747990ed485c192b0fc179a415aba822f352a8d` | `01_Matplotlib.pdf` | 26 | 32, 45, 48, 49, 50, 51, 52, 53, 56, 65 |
| `sha256:4febfad91e0141f9658506a0bf8fc2a449f0ea7d97b44e95fc9a970c77af4b0a` | `01_Matplotlib.pdf` | 7 | 48, 49, 50, 51, 52, 53, 54 |
| `sha256:e808a8ecba94bf0190ab7218bb0702698125ee2e456e82e00da709e8188e2bf8` | `01_Matplotlib.pdf` | 28 | 32, 46, 48, 49, 50, 53, 54, 70, 83, 84 |
| `sha256:b5064b202eb1dae41545eddf674ee23bd82176e76aac8eb749540c2689f2e3ec` | `01_Matplotlib.pdf` | 33 | 32, 33, 37, 48, 49, 50, 52, 53, 54, 68 |
| `sha256:f8f14410ec170248916e19f9d09120cfd786c47906b7c3735781d24e944b094e` | `01_Matplotlib.pdf` | 11 | 32, 83, 84, 101, 109, 110, 111, 115, 116, 119 |
| `sha256:2be58b6ef1e29a83b8634d70b9e32c37a15dea2e608894439ef7224c35b77f5d` | `01_Matplotlib.pdf` | 7 | 46, 48, 49, 50, 52, 53, 55 |
| `sha256:994c963d70041eee141fd275fa22c525a71283de2b4a952814d02e0bbfa8caea` | `01_Matplotlib.pdf` | 4 | 46, 48, 49, 53 |
| `sha256:c43134bebeaf8328ac299ba978d7e663e2dc4fe99463b9d7f72f72f77936204e` | `01_Matplotlib.pdf` | 9 | 48, 49, 50, 51, 52, 53, 54, 55, 56 |
| `sha256:4f763d5e2cd0bdcd4650936ac505bd0e011899712ffe80ffa4b4d43f42941327` | `01_Matplotlib.pdf` | 10 | 46, 48, 49, 50, 52, 54, 56, 98, 103, 114 |
| `sha256:2be58b6ef1e29a83b8634d70b9e32c37a15dea2e608894439ef7224c35b77f5d` | `01_Matplotlib.pdf` | 7 | 46, 48, 49, 50, 52, 53, 55 |
| `sha256:cb72de0c6105b9802d360c47a292a1f7bc344939a6801b879ea09dae4e45e863` | `01_Matplotlib.pdf` | 7 | 46, 48, 49, 50, 51, 52, 53 |
| `sha256:2add5b5ad6e536f3614b75e246b49a006edbbecdd309d24bd42c874a3ae3c8ed` | `01_Matplotlib.pdf` | 21 | 45, 48, 49, 50, 51, 52, 97, 99, 100, 101 |
| `sha256:85e16e36ed0290c149647be7e468a7c46e7b66fd290131213040f7bad905aa44` | `02_Matplotlib.pdf` | 25 | 32, 45, 46, 48, 49, 50, 52, 53, 54, 56 |
| `sha256:85e16e36ed0290c149647be7e468a7c46e7b66fd290131213040f7bad905aa44` | `02_Matplotlib.pdf` | 25 | 32, 45, 46, 48, 49, 50, 52, 53, 54, 56 |
| `sha256:059af9dbaaab27c1d660ef00de6d4fd6e1687cfe2abca0a4c07265c2b2b450c6` | `02_Matplotlib.pdf` | 22 | 32, 46, 48, 49, 50, 51, 53, 55, 68, 77 |
| `sha256:9a701e082ba5a779e2b20b8de0c7844b3f7838ba8cd4bd7ef366893761fb994d` | `02_Matplotlib.pdf` | 10 | 46, 48, 49, 50, 51, 52, 53, 54, 55, 56 |
| `sha256:2f6f8d63ff6235f3b7cd6f5eba8076854892037afa2ea6962953b3e7cda3736e` | `02_Matplotlib.pdf` | 31 | 32, 40, 41, 44, 61, 65, 66, 67, 68, 70 |
| `sha256:f17b5eb0ee996d1388c548f79fa50fa2d8c6076959eff189bb745d156d54547f` | `02_Matplotlib.pdf` | 26 | 32, 39, 65, 66, 67, 68, 73, 97, 98, 100 |
| `sha256:6651550d7b913850087244b7a70961989c2efc6d8c8d060d8663ff087b7723f6` | `02_Matplotlib.pdf` | 20 | 32, 46, 48, 49, 50, 52, 54, 56, 97, 100 |
| `sha256:4febfad91e0141f9658506a0bf8fc2a449f0ea7d97b44e95fc9a970c77af4b0a` | `02_Matplotlib.pdf` | 7 | 48, 49, 50, 51, 52, 53, 54 |
| `sha256:e808a8ecba94bf0190ab7218bb0702698125ee2e456e82e00da709e8188e2bf8` | `02_Matplotlib.pdf` | 28 | 32, 46, 48, 49, 50, 53, 54, 70, 83, 84 |
| `sha256:b5064b202eb1dae41545eddf674ee23bd82176e76aac8eb749540c2689f2e3ec` | `02_Matplotlib.pdf` | 33 | 32, 33, 37, 48, 49, 50, 52, 53, 54, 68 |
| `sha256:f8f14410ec170248916e19f9d09120cfd786c47906b7c3735781d24e944b094e` | `02_Matplotlib.pdf` | 11 | 32, 83, 84, 101, 109, 110, 111, 115, 116, 119 |
| `sha256:2be58b6ef1e29a83b8634d70b9e32c37a15dea2e608894439ef7224c35b77f5d` | `02_Matplotlib.pdf` | 7 | 46, 48, 49, 50, 52, 53, 55 |
| `sha256:994c963d70041eee141fd275fa22c525a71283de2b4a952814d02e0bbfa8caea` | `02_Matplotlib.pdf` | 4 | 46, 48, 49, 53 |
| `sha256:c43134bebeaf8328ac299ba978d7e663e2dc4fe99463b9d7f72f72f77936204e` | `02_Matplotlib.pdf` | 9 | 48, 49, 50, 51, 52, 53, 54, 55, 56 |
| `sha256:4f763d5e2cd0bdcd4650936ac505bd0e011899712ffe80ffa4b4d43f42941327` | `02_Matplotlib.pdf` | 10 | 46, 48, 49, 50, 52, 54, 56, 98, 103, 114 |
| `sha256:2be58b6ef1e29a83b8634d70b9e32c37a15dea2e608894439ef7224c35b77f5d` | `02_Matplotlib.pdf` | 7 | 46, 48, 49, 50, 52, 53, 55 |
| `sha256:cb72de0c6105b9802d360c47a292a1f7bc344939a6801b879ea09dae4e45e863` | `02_Matplotlib.pdf` | 7 | 46, 48, 49, 50, 51, 52, 53 |
| `sha256:31d0e67bc63a816302c9ff6ad9c19e17603aef1a4c3677b81b1d9084caa86e03` | `03_handout-beginner.pdf` | 6 | 46, 48, 49, 50, 51, 53 |
| `sha256:4b509d2ae2cfab89783a73df2c66f0fd50949f97696079cb58f1e58b81daaa07` | `03_handout-beginner.pdf` | 4 | 84, 101, 105, 109 |
| `sha256:831f7012db360331ffb5a5de6a6d6e03ffaad29f48d81cabe9fc613b25aad818` | `04_handout-intermediate.pdf` | 43 | 32, 40, 41, 46, 48, 49, 50, 51, 52, 53 |
| `sha256:bf790625423c5ebdf94760eb796c847af885b930d3a30861509b07f1c77c3f60` | `04_handout-intermediate.pdf` | 9 | 46, 48, 49, 50, 51, 52, 53, 54, 56 |
| `sha256:f7c3be2199c397a4c702dd434ac63fc9e046d749eff8cede4513fbc2774751b4` | `04_handout-intermediate.pdf` | 5 | 48, 49, 50, 51, 53 |
| `sha256:8f7bf7a6382e8a762c5a84f19f84f0675f61eb1b34bd42562c0b3ac6712e29ef` | `04_handout-intermediate.pdf` | 2 | 48, 49 |
| `sha256:dfaf8075e13be0e51f72485f9d825cea9ad077eb2dd9d63b9922add67d7d2761` | `04_handout-intermediate.pdf` | 12 | 32, 48, 49, 50, 51, 53, 80, 100, 101, 105 |
| `sha256:853422e67ac88fe7ae28d5c459dc9f5a84f24e7840eeb2d82a00719032119326` | `04_handout-intermediate.pdf` | 10 | 32, 67, 83, 97, 100, 101, 105, 110, 111, 115 |
| `sha256:b42182c55ec4bd53ab0698bee5f92945921dbccb534fdb5c6b41f1782e1fe88e` | `04_handout-intermediate.pdf` | 7 | 32, 48, 49, 50, 51, 53, 65 |
| `sha256:75466035ac34f2523215e599452e32d796d7d02bc7122ed3d02fe91ebe064c25` | `04_handout-intermediate.pdf` | 6 | 48, 49, 50, 52, 54, 56 |
| `sha256:75466035ac34f2523215e599452e32d796d7d02bc7122ed3d02fe91ebe064c25` | `04_handout-intermediate.pdf` | 6 | 48, 49, 50, 52, 54, 56 |
## Alias: `dejavusans-bold`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:dc03917f2edd92a7a68a46ad36f65a908e4feb85e61cb37e9026205f3986574a` | `01_Matplotlib.pdf` | 7 | 65, 87, 100, 101, 103, 105, 116 |
| `sha256:dc03917f2edd92a7a68a46ad36f65a908e4feb85e61cb37e9026205f3986574a` | `02_Matplotlib.pdf` | 7 | 65, 87, 100, 101, 103, 105, 116 |
| `sha256:c845063bef18f173afbfcb90fbf6773f43648c5f0666ecfa0132afe4e164068d` | `03_handout-beginner.pdf` | 9 | 32, 65, 83, 97, 101, 105, 110, 118, 119 |
## Alias: `dejavusans-oblique`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:81cd2d4d9353ee02c7ed80c2892658072b2a8bbd9ed1832b474129dfbe35d5d8` | `01_Matplotlib.pdf` | 13 | 70, 71, 85, 87, 100, 101, 103, 109, 112, 114 |
| `sha256:08864aa8e8d17cead6059d5b4f1b1eea2053fa0ea3ca64e885d6eaacb78bccaf` | `01_Matplotlib.pdf` | 2 | 100, 120 |
## Alias: `dejavusansdisplay`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:ae77c4eb2c49f72c616272f3d7ac624ddb0b4db1c77acbe6b9d13531f68e1d5d` | `01_Matplotlib.pdf` | 0 | |
| `sha256:ae77c4eb2c49f72c616272f3d7ac624ddb0b4db1c77acbe6b9d13531f68e1d5d` | `01_Matplotlib.pdf` | 0 | |
## Alias: `dejavusansmono`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:88758adf0b41a81204ed3ad63463f5d15c7c2f80e8942cee501d06fa7274dc4e` | `01_Matplotlib.pdf` | 8 | 97, 98, 105, 108, 109, 111, 112, 116 |
| `sha256:74e60bcb2d7975b0c7b372aca9fc25f55c9018005425a741830e7c4370b8d593` | `01_Matplotlib.pdf` | 24 | 35, 39, 48, 49, 50, 51, 52, 53, 54, 55 |
## Alias: `f36`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:72c7041f938222b87ce2d9295547f8c19edf250af538160b69be35a968d76ea7` | `08_matplotlib.pdf` | 1 | 136 |
## Alias: `f59`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:d5942c0913ef64ae862556a746b28dac1a621caa5e05973e16881c8e8e15e329` | `08_matplotlib.pdf` | 1 | 42 |
## Alias: `sourcecodepro-regular`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:96ba693001b2ab224ad5b5a7464cecd4d33e68f30fb23f78a8473dbb031ce246` | `04_handout-intermediate.pdf` | 11 | 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 |
| `sha256:72fca14e9e44fc41b0cdb1c6a088f0b07f882f9f04c51a0145f43cf8b285c5b6` | `04_handout-intermediate.pdf` | 11 | 46, 48, 49, 50, 51, 52, 53, 54, 55, 56 |
## Alias: `stixsizethreesym-regular`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:33d0ab9d9d72c1aed1edfc9b815dd6a2d618cbbe9084309c7f2de0f3df3073d7` | `01_Matplotlib.pdf` | 2 | 91, 93 |
## Alias: `unknown`
| Signature | Samples | Glyph Count | Coverage (first 10) |
| --- | --- | --- | --- |
| `sha256:23e4b174e951cd6135e229fb397db4ff518021cf14d5f817031b9f754841e511` | `07_matplotlib.pdf` | 11 | 0, 46, 97, 98, 105, 108, 109, 111, 112, 116 |
| `sha256:f6112d6a35d5fdf5d6431b3156b713020953154042814ad12d2b81731c97250b` | `07_matplotlib.pdf` | 13 | 0, 32, 37, 97, 98, 101, 105, 108, 109, 110 |
| `sha256:7e05c074b630c0f3e1fc23537c22bf4b6191c783601e534cd156f71c1827702c` | `07_matplotlib.pdf` | 42 | 0, 32, 34, 37, 39, 40, 41, 42, 44, 46 |
| `sha256:9958bc1f309f6bafb55834e271bb0b337704fcac51f6d989abe9553fcffa103d` | `07_matplotlib.pdf` | 15 | 0, 46, 97, 98, 105, 108, 109, 110, 111, 112 |
+2 -2
View File
@@ -3,14 +3,14 @@
<head>
<meta charset="UTF-8" />
<base href="%BASE_URL%" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" href="/modern-logo/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="The Free Adobe Acrobat alternative (10M+ Downloads)"
/>
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="apple-touch-icon" href="/modern-logo/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<title>Stirling PDF</title>
+788 -604
View File
File diff suppressed because it is too large Load Diff
+10 -5
View File
@@ -10,6 +10,7 @@
"@embedpdf/core": "^1.4.1",
"@embedpdf/engines": "^1.4.1",
"@embedpdf/plugin-annotation": "^1.4.1",
"@embedpdf/plugin-bookmark": "^1.4.1",
"@embedpdf/plugin-export": "^1.4.1",
"@embedpdf/plugin-history": "^1.4.1",
"@embedpdf/plugin-interaction-manager": "^1.4.1",
@@ -26,8 +27,6 @@
"@embedpdf/plugin-viewport": "^1.4.1",
"@embedpdf/plugin-zoom": "^1.4.1",
"@emotion/react": "^11.14.0",
"@tauri-apps/api": "^2.5.0",
"@tauri-apps/plugin-fs": "^2.4.0",
"@emotion/styled": "^11.14.1",
"@iconify/react": "^6.0.2",
"@mantine/core": "^8.3.1",
@@ -37,8 +36,14 @@
"@mui/icons-material": "^7.3.2",
"@mui/material": "^7.3.2",
"@reactour/tour": "^3.8.0",
"@stripe/react-stripe-js": "^4.0.2",
"@stripe/stripe-js": "^7.9.0",
"@supabase/supabase-js": "^2.47.13",
"@tailwindcss/postcss": "^4.1.13",
"@tanstack/react-virtual": "^3.13.12",
"@tauri-apps/api": "^2.5.0",
"@tauri-apps/plugin-fs": "^2.4.0",
"@tauri-apps/plugin-http": "^2.5.4",
"autoprefixer": "^10.4.21",
"axios": "^1.12.2",
"globals": "^16.4.0",
@@ -52,8 +57,8 @@
"posthog-js": "^1.268.0",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-rnd": "^10.5.2",
"react-i18next": "^15.7.3",
"react-rnd": "^10.5.2",
"react-router-dom": "^7.9.1",
"signature_pad": "^5.0.4",
"tailwindcss": "^4.1.13",
@@ -111,11 +116,11 @@
]
},
"devDependencies": {
"@tauri-apps/cli": "^2.5.0",
"@eslint/js": "^9.36.0",
"@iconify-json/material-symbols": "^1.2.37",
"@iconify-json/material-symbols": "^1.2.48",
"@iconify/utils": "^3.0.2",
"@playwright/test": "^1.55.0",
"@tauri-apps/cli": "^2.5.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.8.0",
"@testing-library/react": "^16.3.0",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" id="Layer_1" x="0" y="0" version="1.1" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512" xml:space="preserve"><defs id="defs173"><linearGradient id="XMLID_5_" x1="304.496" x2="316.036" y1="422.91" y2="326.263" gradientUnits="userSpaceOnUse"><stop offset="0" style="stop-color:#dcf1f3" id="stop156"/><stop offset="1" style="stop-color:#c2c2c9" id="stop158"/></linearGradient></defs><style id="style150" type="text/css">.st1{fill:#c02223}.st2{fill:#882425}.st3{fill:url(#XMLID_5_)}.st4{fill:url(#XMLID_7_)}</style><g id="XMLID_4_"><path id="XMLID_131_" d="M 347.01402,14.355825 98.978019,69.02261 C 73.825483,74.547445 55.942464,96.792175 55.942464,122.52628 v 315.06096 c 0,22.39012 16.719895,41.14548 38.819234,43.76251 L 224.8861,498.36042 339.48636,384.26465 455.76603,265.15425 453.73057,84.870162 C 453.43979,62.916214 433.08513,46.632491 411.71274,51.284984 l -28.78729,6.251786 0.14539,-13.666697 C 383.36162,24.678542 365.62399,10.284894 347.01402,14.355825 Z" class="st1" style="stroke-width:1.45391"/><path id="XMLID_117_" d="m 383.21622,57.53677 v 285.8375 L 456.05681,265.00885 454.02135,78.763767 C 453.87595,59.863016 436.28372,45.905539 417.81914,49.97647 Z" class="st2" style="stroke-width:1.45391"/><polygon id="XMLID_18_" points="234.7 422.6 368.5 387.7 393.5 262.2" class="st3" style="fill:url(#XMLID_5_)" transform="matrix(1.4556308,0,0,1.4548265,-116.73161,-116.45231)"/><linearGradient id="XMLID_7_" x1="223.084" x2="241.417" y1="372.756" y2="114.557" gradientTransform="matrix(1.4539039,0,0,1.4539039,-116.19976,-116.20474)" gradientUnits="userSpaceOnUse"><stop offset="0" style="stop-color:#dcf1f3" id="stop163"/><stop offset="1" style="stop-color:#c2c2c9" id="stop165"/></linearGradient><path id="XMLID_6_" d="m 282.89686,214.84917 c 0,0 -22.24473,-28.93269 -38.67384,-36.78377 -10.46811,-4.94327 -26.02489,-6.83335 -38.23768,-0.72695 -18.02841,9.0142 -19.91848,34.31213 -3.34397,44.34406 3.92553,2.47165 9.15959,4.50711 15.99294,6.10641 36.63838,8.43264 97.12077,25.87949 89.70587,96.10304 0,0 -4.21633,65.86185 -73.56753,73.42215 -12.2128,1.30851 -24.57098,0.43617 -36.493,-2.32625 -16.42911,-3.63476 -45.50719,-11.04967 -59.75545,-19.91849 l -2.61703,-75.16682 h 6.97875 c 0,0 13.81208,33.43978 53.06749,49.57812 7.26952,2.90781 15.26599,4.07093 22.97168,2.90781 9.74116,-1.45391 21.22699,-6.68796 25.87949,-22.53551 0,0 7.85108,-23.11707 -32.85823,-35.76604 -32.56744,-10.17733 -63.24481,-20.64543 -75.89378,-54.95757 -5.961,-16.28371 -6.97874,-34.31212 -2.90781,-51.61358 5.37944,-22.53551 20.79082,-54.23062 64.40794,-67.89732 0,0 57.28381,-15.55677 96.53922,5.52484 l -1.74468,89.70587 z" class="st4" style="fill:url(#XMLID_7_);stroke-width:1.45391"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

@@ -0,0 +1,33 @@
<svg width="82" height="92" viewBox="0 0 82 92" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_dddd_3933_98714)">
<path d="M33.0874 84.4375L70.2191 75.6383L77.157 43.9963L33.0874 84.4375Z" fill="#D0DBDC"/>
<path d="M56.3682 0.557473C59.916 -0.147829 63.2976 2.34683 63.2422 5.67271L63.2139 8.04087L68.7031 6.95689C72.7776 6.15095 76.6575 8.97364 76.7129 12.7782L77.1016 44.0213L54.9326 64.6639L33.084 84.4374L8.27637 81.4891C4.06313 81.0356 0.875008 77.7854 0.875 73.9051V19.3036C0.875108 14.8438 4.28482 10.9886 9.08008 10.0311L56.3682 0.557473ZM46.2773 19.7586C38.7933 16.1052 27.8721 18.8006 27.8721 18.8006C19.5566 21.1692 16.6184 26.6627 15.5928 30.5682C14.8168 33.5665 15.0111 36.6907 16.1475 39.5126C18.559 45.4589 24.4073 47.2732 30.6162 49.037C38.3528 51.2221 36.8902 55.2099 36.8809 55.2352C35.9939 57.9815 33.8044 58.8885 31.9473 59.1405C30.4782 59.3421 28.9533 59.1405 27.5674 58.6366C20.0835 55.8397 17.4502 50.0448 17.4502 50.0448H16.1191L16.6182 63.0711C19.3345 64.6081 24.8785 65.8934 28.0107 66.5233C30.2837 67.002 32.6404 67.1534 34.9688 66.9266C48.1902 65.6162 48.9941 54.202 48.9941 54.202C50.4076 42.0323 38.8767 39.0091 31.8916 37.5477C30.589 37.2706 29.5911 36.9174 28.8428 36.4891C25.6828 34.7505 26.0434 30.3658 29.4805 28.8036C31.8088 27.7456 34.7749 28.0729 36.7705 28.9295C39.9027 30.2903 44.1436 35.3045 44.1436 35.3045H45.9453L46.2773 19.7586Z" fill="white"/>
<path d="M63.2779 8.03641L63.2781 57.7846L77.1651 44.2035L76.7771 11.9265C76.7494 8.65091 73.3953 6.02067 69.875 6.72618L63.2779 8.03641Z" fill="#D3D3D3"/>
</g>
<defs>
<filter id="filter0_dddd_3933_98714" x="-8.34465e-07" y="-4.17233e-07" width="81.1025" height="91.875" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="0.4375"/>
<feGaussianBlur stdDeviation="0.4375"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_3933_98714"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="0.4375" dy="1.3125"/>
<feGaussianBlur stdDeviation="0.656251"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.09 0"/>
<feBlend mode="normal" in2="effect1_dropShadow_3933_98714" result="effect2_dropShadow_3933_98714"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="0.875001" dy="3.0625"/>
<feGaussianBlur stdDeviation="0.875001"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0"/>
<feBlend mode="normal" in2="effect2_dropShadow_3933_98714" result="effect3_dropShadow_3933_98714"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="1.75" dy="5.25"/>
<feGaussianBlur stdDeviation="1.09375"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.01 0"/>
<feBlend mode="normal" in2="effect3_dropShadow_3933_98714" result="effect4_dropShadow_3933_98714"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect4_dropShadow_3933_98714" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

@@ -0,0 +1,34 @@
<svg width="82" height="92" viewBox="0 0 82 92" fill="none" xmlns="http://www.w3.org/2000/svg">
<g opacity="0.2" filter="url(#filter0_dddd_3933_98709)">
<path d="M56.3678 0.557543L9.07973 10.0315C4.2844 10.989 0.875 14.8441 0.875 19.3039V73.9053C0.875 77.7856 4.06265 81.0359 8.27589 81.4895L33.0841 84.4375L54.9327 64.6642L77.1014 44.0219L76.7133 12.778C76.6579 8.97326 72.7773 6.15122 68.7027 6.95752L63.2143 8.04098L63.2421 5.67248C63.2975 2.34651 59.9158 -0.147965 56.3678 0.557543Z" fill="#FF4B4B"/>
<path d="M63.269 8.04043V57.5772L77.1561 43.9962L76.7681 11.7192C76.7403 8.44358 73.3864 6.02469 69.8661 6.7302L63.269 8.04043Z" fill="#545454"/>
<path d="M33.0873 84.4375L70.2189 75.6383L77.1569 43.9963L33.0873 84.4375Z" fill="#D0DBDC"/>
<path d="M44.1432 35.3049C44.1432 35.3049 39.9022 30.2907 36.77 28.9301C34.7743 28.0734 31.8084 27.7459 29.48 28.8041C26.0429 30.3663 25.6826 34.7506 28.8425 36.4891C29.5909 36.9175 30.5888 37.2702 31.8915 37.5474C38.8767 39.0088 50.4076 42.0324 48.994 54.2024C48.994 54.2024 48.1901 65.6166 34.9683 66.9268C32.6399 67.1536 30.2839 67.0024 28.0109 66.5236C24.8787 65.8937 19.335 64.6087 16.6185 63.0717L16.1196 50.045H17.4501C17.4501 50.045 20.0834 55.8402 27.5674 58.6371C28.9534 59.141 30.4779 59.3426 31.947 59.141C33.8041 58.889 35.9939 57.982 36.8809 55.2355C36.8809 55.2355 38.3777 51.2292 30.6165 49.0371C24.4075 47.2733 18.5589 45.4592 16.1473 39.5127C15.0109 36.6907 14.8168 33.5663 15.593 30.5679C16.6185 26.6624 19.5567 21.1695 27.8723 18.801C27.8723 18.801 38.7935 16.105 46.2776 19.7585L45.9449 35.3049H44.1432Z" fill="white"/>
</g>
<defs>
<filter id="filter0_dddd_3933_98709" x="-8.34465e-07" y="-4.17233e-07" width="81.0944" height="91.875" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="0.4375"/>
<feGaussianBlur stdDeviation="0.4375"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_3933_98709"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="0.4375" dy="1.3125"/>
<feGaussianBlur stdDeviation="0.656251"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.09 0"/>
<feBlend mode="normal" in2="effect1_dropShadow_3933_98709" result="effect2_dropShadow_3933_98709"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="0.875001" dy="3.0625"/>
<feGaussianBlur stdDeviation="0.875001"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0"/>
<feBlend mode="normal" in2="effect2_dropShadow_3933_98709" result="effect3_dropShadow_3933_98709"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="1.75" dy="5.25"/>
<feGaussianBlur stdDeviation="1.09375"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.01 0"/>
<feBlend mode="normal" in2="effect3_dropShadow_3933_98709" result="effect4_dropShadow_3933_98709"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect4_dropShadow_3933_98709" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@@ -0,0 +1,5 @@
<svg width="77" height="84" viewBox="0 0 77 84" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M32.2124 83.9997L69.3441 75.2005L76.282 43.5585L32.2124 83.9997Z" fill="#D0DBDC"/>
<path d="M55.4932 0.119995C59.0409 -0.585293 62.4223 1.9086 62.3672 5.23425L62.3389 7.60339L67.8281 6.51941C71.9024 5.71349 75.7821 8.53542 75.8379 12.3397L76.2266 43.5839L54.0576 64.2264L32.209 83.9999L7.40137 81.0516C3.18818 80.5981 8.70906e-05 77.3479 0 73.4677V18.8661C3.4631e-05 14.4063 3.40977 10.5511 8.20508 9.59363L55.4932 0.119995ZM45.4023 19.3212C37.9183 15.6676 26.9971 18.3632 26.9971 18.3632C18.6818 20.7316 15.7434 26.2243 14.7178 30.1298C13.9417 33.1282 14.136 36.253 15.2725 39.0751C17.684 45.0213 23.5324 46.8357 29.7412 48.5995C37.5024 50.7916 36.0059 54.7977 36.0059 54.7977C35.1189 57.544 32.9294 58.451 31.0723 58.703C29.6032 58.9046 28.0783 58.703 26.6924 58.1991C19.2266 55.4091 16.588 49.6354 16.5752 49.6073H15.2441L15.7432 62.6337C18.4595 64.1706 24.0035 65.4559 27.1357 66.0858C29.4087 66.5646 31.7654 66.7159 34.0938 66.4891C47.3152 65.1787 48.1191 53.7645 48.1191 53.7645C49.5327 41.5946 38.0017 38.5707 31.0166 37.1093C29.714 36.8321 28.7161 36.4799 27.9678 36.0516C24.8078 34.3131 25.1684 29.9283 28.6055 28.3661C30.9338 27.3081 33.8999 27.6354 35.8955 28.4921C39.0277 29.8529 43.2686 34.8671 43.2686 34.8671H45.0703L45.4023 19.3212Z" fill="white"/>
<path d="M62.394 7.60263V57.1394L76.2811 43.5584L75.8931 11.2814C75.8653 8.00577 72.5114 5.58689 68.9911 6.2924L62.394 7.60263Z" fill="#EEEEEE"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More