feat: add "Add Page Labels" tool to the application

- Introduced a new tool for adding page labels to PDF documents, allowing users to apply Roman numerals, prefixes, and custom numbering ranges.
- Created a new HTML page for the tool with a user-friendly interface for file upload and label rule configuration.
- Implemented logic for handling file uploads, processing PDF files, and applying page labels based on user-defined rules.
- Added necessary types and utility functions for managing page label styles and normalization of start values.
- Updated main application configuration to include the new tool in the navigation.
- Added tests for page label utilities to ensure correct functionality.
This commit is contained in:
alam00000
2026-03-16 14:34:27 +05:30
parent 31f43b557f
commit 477839f106
27 changed files with 2318 additions and 0 deletions

View File

@@ -86,6 +86,65 @@
"name": "页码",
"subtitle": "将页码插入到您的文档中。"
},
"addPageLabels": {
"name": "添加页面标签",
"subtitle": "使用罗马数字、前缀和自定义起始值应用 PDF 页面标签。",
"uploadHint": "PDF 文件",
"howLabelsWorkTitle": "页面标签的工作方式",
"howLabelsWorkStep1": "将页面范围留空即可为所有页面添加标签。",
"howLabelsWorkStep2": "前置页可使用罗马数字,正文部分可使用十进制编号等样式。",
"howLabelsWorkStep3": "将前缀与起始值 0 结合使用,可创建 A-0、A-1、A-2 之类的标签。",
"howLabelsWorkStep4": "当某条规则使用 1-9,30-40 或奇数页之类的不连续范围时,请启用连续编号。",
"labelRulesTitle": "标签规则",
"addRule": "添加规则",
"removeExistingLabels": "应用这些规则前先移除现有页面标签",
"cpdfNote": "此工具会在您的浏览器中使用 CoherentPDF。如果尚未配置 CoherentPDF系统会提示您在 WASM 设置中完成配置。",
"processButton": "添加页面标签",
"howItWorksUploadTitle": "上传文件",
"howItWorksUploadDescription": "选择您想重新标记的 PDF 文件。",
"howItWorksDefineTitle": "定义规则",
"howItWorksDefineDescription": "设置一条或多条页面标签规则,包括页面范围、样式、前缀和起始值。",
"howItWorksDownloadTitle": "下载",
"howItWorksDownloadDescription": "保存带有新页面标签的更新后 PDF。",
"relatedToolsTitle": "相关 PDF 工具",
"faqWhatIsQuestion": "什么是页面标签?",
"faqWhatIsAnswer": "页面标签是 PDF 阅读器在缩略图、页面导航和打印对话框中显示的编号。它不会在页面上额外打印新文字。",
"faqMixQuestion": "我可以混用罗马数字和普通数字吗?",
"faqMixAnswer": "可以。您可以添加多条规则,例如 1-4 使用 LowercaseRoman5-20 使用 DecimalArabic。",
"faqPrivacyQuestion": "我的文件会保持私密吗?",
"faqPrivacyAnswer": "会。处理过程在您的浏览器中使用 CoherentPDF WASM 完成,您的 PDF 不会离开您的设备。",
"invalidFileTitle": "无效文件",
"invalidFileMessage": "请上传有效的 PDF 文件。",
"loadingPdf": "正在加载 PDF...",
"protectedPdfTitle": "受保护的 PDF",
"protectedPdfMessage": "此 PDF 受密码保护。请先使用解密或更改权限工具。",
"loadErrorMessage": "无法加载 PDF 文件。该文件可能无效、损坏或受密码保护。",
"fileMeta": "{{size}} • {{count}} 页",
"ruleTitle": "标签规则 {{number}}",
"pageRangeLabel": "页面范围",
"pageRangePlaceholder": "所有页面,或例如 1-4、7、奇数页",
"labelStyleLabel": "标签样式",
"labelPrefixLabel": "标签前缀",
"labelPrefixPlaceholder": "可选前缀,例如 A-",
"startValueLabel": "起始值",
"continueNumbering": "在不连续范围中继续编号",
"examplesNote": "示例1-4 用于罗马数字前言部分15-20 使用前缀 A- 且起始值为 0或者启用连续编号的奇数页。",
"uploadFirstMessage": "请先上传 PDF 文件。",
"applyingLabels": "正在应用页面标签...",
"invalidRangeMessage": "规则 {{number}} 的页面范围无效:{{range}}",
"allPages": "所有页面",
"emptyOutputMessage": "CoherentPDF 生成了一个空文件。",
"successMessage": "页面标签添加成功!",
"processErrorMessage": "无法添加页面标签。",
"styleOptions": {
"DecimalArabic": "十进制数字",
"LowercaseRoman": "小写罗马数字",
"UppercaseRoman": "大写罗马数字",
"LowercaseLetters": "小写字母",
"UppercaseLetters": "大写字母",
"NoLabelPrefixOnly": "仅前缀,无编号"
}
},
"batesNumbering": {
"name": "Bates编号",
"subtitle": "在一个或多个PDF文件中添加连续的Bates编号。"