Feature/v2/remove pages (#4445)

# Description of Changes

- Addition of the remove pages tool
- Addition of the remove blank pages tool

---

## Checklist

### General

- [ ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

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

### Testing (if applicable)

- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing)
for more details.
This commit is contained in:
EthanHealy01
2025-09-18 09:51:55 +01:00
committed by GitHub
parent 7ff1c66d09
commit 756cbc4780
14 changed files with 626 additions and 20 deletions

View File

@@ -1125,15 +1125,46 @@
"removePages": {
"tags": "Remove pages,delete pages",
"title": "Remove Pages",
"pageNumbers": "Pages to Remove",
"pageNumbersPlaceholder": "e.g. 1,3,5-7",
"pageNumbersHelp": "Enter page numbers separated by commas, or ranges like 1-5. Example: 1,3,5-7",
"pageNumbers": {
"label": "Pages to Remove",
"placeholder": "e.g., 1,3,5-8,10",
"error": "Invalid page number format. Use numbers, ranges (1-5), or mathematical expressions (2n+1)"
},
"filenamePrefix": "pages_removed",
"files": {
"placeholder": "Select a PDF file in the main view to get started"
},
"settings": {
"title": "Page Selection"
"title": "Settings"
},
"tooltip": {
"header": {
"title": "Remove Pages Settings"
},
"pageNumbers": {
"title": "Page Selection",
"text": "Specify which pages to remove from your PDF. You can select individual pages, ranges, or use mathematical expressions.",
"bullet1": "Individual pages: 1,3,5 (removes pages 1, 3, and 5)",
"bullet2": "Page ranges: 1-5,10-15 (removes pages 1-5 and 10-15)",
"bullet3": "Mathematical: 2n+1 (removes odd pages)",
"bullet4": "Open ranges: 5- (removes from page 5 to end)"
},
"examples": {
"title": "Common Examples",
"text": "Here are some common page selection patterns:",
"bullet1": "Remove first page: 1",
"bullet2": "Remove last 3 pages: -3",
"bullet3": "Remove every other page: 2n",
"bullet4": "Remove specific scattered pages: 1,5,10,15"
},
"safety": {
"title": "Safety Tips",
"text": "Important considerations when removing pages:",
"bullet1": "Always preview your selection before processing",
"bullet2": "Keep a backup of your original file",
"bullet3": "Page numbers start from 1, not 0",
"bullet4": "Invalid page numbers will be ignored"
}
},
"error": {
"failed": "An error occurred whilst removing pages."
@@ -1492,11 +1523,46 @@
"tags": "cleanup,streamline,non-content,organize",
"title": "Remove Blanks",
"header": "Remove Blank Pages",
"threshold": "Pixel Whiteness Threshold:",
"thresholdDesc": "Threshold for determining how white a white pixel must be to be classed as 'White'. 0 = Black, 255 pure white.",
"whitePercent": "White Percent (%):",
"whitePercentDesc": "Percent of page that must be 'white' pixels to be removed",
"submit": "Remove Blanks"
"settings": {
"title": "Settings"
},
"threshold": {
"label": "Pixel Whiteness Threshold"
},
"whitePercent": {
"label": "White Percentage Threshold",
"unit": "%"
},
"includeBlankPages": {
"label": "Include detected blank pages"
},
"tooltip": {
"header": {
"title": "Remove Blank Pages Settings"
},
"threshold": {
"title": "Pixel Whiteness Threshold",
"text": "Controls how white a pixel must be to be considered 'white'. This helps determine what counts as a blank area on the page.",
"bullet1": "0 = Pure black (most restrictive)",
"bullet2": "128 = Medium grey",
"bullet3": "255 = Pure white (least restrictive)"
},
"whitePercent": {
"title": "White Percentage Threshold",
"text": "Sets the minimum percentage of white pixels required for a page to be considered blank and removed.",
"bullet1": "Lower values (e.g., 80%) = More pages removed",
"bullet2": "Higher values (e.g., 95%) = Only very blank pages removed",
"bullet3": "Use higher values for documents with light backgrounds"
},
"includeBlankPages": {
"title": "Include Detected Blank Pages",
"text": "When enabled, creates a separate PDF containing all the blank pages that were detected and removed from the original document.",
"bullet1": "Useful for reviewing what was removed",
"bullet2": "Helps verify the detection accuracy",
"bullet3": "Can be disabled to reduce output file size"
}
},
"submit": "Remove blank pages"
},
"removeAnnotations": {
"tags": "comments,highlight,notes,markup,remove",

View File

@@ -745,15 +745,46 @@
"removePages": {
"tags": "Remove pages,delete pages",
"title": "Remove Pages",
"pageNumbers": "Pages to Remove",
"pageNumbersPlaceholder": "e.g. 1,3,5-7",
"pageNumbersHelp": "Enter page numbers separated by commas, or ranges like 1-5. Example: 1,3,5-7",
"pageNumbers": {
"label": "Pages to Remove",
"placeholder": "e.g., 1,3,5-8,10",
"error": "Invalid page number format. Use numbers, ranges (1-5), or mathematical expressions (2n+1)"
},
"filenamePrefix": "pages_removed",
"files": {
"placeholder": "Select a PDF file in the main view to get started"
},
"settings": {
"title": "Page Selection"
"title": "Settings"
},
"tooltip": {
"header": {
"title": "Remove Pages Settings"
},
"pageNumbers": {
"title": "Page Selection",
"text": "Specify which pages to remove from your PDF. You can select individual pages, ranges, or use mathematical expressions.",
"bullet1": "Individual pages: 1,3,5 (removes pages 1, 3, and 5)",
"bullet2": "Page ranges: 1-5,10-15 (removes pages 1-5 and 10-15)",
"bullet3": "Mathematical: 2n+1 (removes odd pages)",
"bullet4": "Open ranges: 5- (removes from page 5 to end)"
},
"examples": {
"title": "Common Examples",
"text": "Here are some common page selection patterns:",
"bullet1": "Remove first page: 1",
"bullet2": "Remove last 3 pages: -3",
"bullet3": "Remove every other page: 2n",
"bullet4": "Remove specific scattered pages: 1,5,10,15"
},
"safety": {
"title": "Safety Tips",
"text": "Important considerations when removing pages:",
"bullet1": "Always preview your selection before processing",
"bullet2": "Keep a backup of your original file",
"bullet3": "Page numbers start from 1, not 0",
"bullet4": "Invalid page numbers will be ignored"
}
},
"error": {
"failed": "An error occurred while removing pages."
@@ -1013,11 +1044,46 @@
"tags": "cleanup,streamline,non-content,organize",
"title": "Remove Blanks",
"header": "Remove Blank Pages",
"threshold": "Pixel Whiteness Threshold:",
"thresholdDesc": "Threshold for determining how white a white pixel must be to be classed as 'White'. 0 = Black, 255 pure white.",
"whitePercent": "White Percent (%):",
"whitePercentDesc": "Percent of page that must be 'white' pixels to be removed",
"submit": "Remove Blanks"
"settings": {
"title": "Settings"
},
"threshold": {
"label": "Pixel Whiteness Threshold"
},
"whitePercent": {
"label": "White Percentage Threshold",
"unit": "%"
},
"includeBlankPages": {
"label": "Include detected blank pages"
},
"tooltip": {
"header": {
"title": "Remove Blank Pages Settings"
},
"threshold": {
"title": "Pixel Whiteness Threshold",
"text": "Controls how white a pixel must be to be considered 'white'. This helps determine what counts as a blank area on the page.",
"bullet1": "0 = Pure black (most restrictive)",
"bullet2": "128 = Medium gray",
"bullet3": "255 = Pure white (least restrictive)"
},
"whitePercent": {
"title": "White Percentage Threshold",
"text": "Sets the minimum percentage of white pixels required for a page to be considered blank and removed.",
"bullet1": "Lower values (e.g., 80%) = More pages removed",
"bullet2": "Higher values (e.g., 95%) = Only very blank pages removed",
"bullet3": "Use higher values for documents with light backgrounds"
},
"includeBlankPages": {
"title": "Include Detected Blank Pages",
"text": "When enabled, creates a separate PDF containing all the blank pages that were detected and removed from the original document.",
"bullet1": "Useful for reviewing what was removed",
"bullet2": "Helps verify the detection accuracy",
"bullet3": "Can be disabled to reduce output file size"
}
},
"submit": "Remove blank pages"
},
"removeAnnotations": {
"tags": "comments,highlight,notes,markup,remove",