lightpdf-aipdf-mcp 0.1.89__py3-none-any.whl → 0.1.90__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lightpdf_aipdf_mcp/converter.py +17 -1
- {lightpdf_aipdf_mcp-0.1.89.dist-info → lightpdf_aipdf_mcp-0.1.90.dist-info}/METADATA +1 -1
- {lightpdf_aipdf_mcp-0.1.89.dist-info → lightpdf_aipdf_mcp-0.1.90.dist-info}/RECORD +5 -5
- {lightpdf_aipdf_mcp-0.1.89.dist-info → lightpdf_aipdf_mcp-0.1.90.dist-info}/WHEEL +0 -0
- {lightpdf_aipdf_mcp-0.1.89.dist-info → lightpdf_aipdf_mcp-0.1.90.dist-info}/entry_points.txt +0 -0
lightpdf_aipdf_mcp/converter.py
CHANGED
@@ -171,7 +171,7 @@ class Converter(BaseApiClient):
|
|
171
171
|
return ConversionResult(success=False, file_path=file_path, error_message="未找到API_KEY", original_name=original_name)
|
172
172
|
|
173
173
|
# 特殊格式:doc-repair用于去除水印,number-pdf用于添加页码,输出均为PDF
|
174
|
-
is_special_operation = format in ["doc-repair", "number-pdf"]
|
174
|
+
is_special_operation = format in ["doc-repair", "number-pdf", "flatten-pdf", "resize-pdf"]
|
175
175
|
actual_output_format = "pdf" if is_special_operation else format
|
176
176
|
|
177
177
|
# 检查是否为URL或OSS路径,如果是则跳过文件格式检查
|
@@ -198,6 +198,18 @@ class Converter(BaseApiClient):
|
|
198
198
|
error_msg = "添加页码功能仅支持PDF文件"
|
199
199
|
await self.logger.error(error_msg)
|
200
200
|
return ConversionResult(success=False, file_path=file_path, error_message=error_msg, original_name=original_name)
|
201
|
+
|
202
|
+
# 如果是展平PDF操作,检查是否PDF文件
|
203
|
+
if format == "flatten-pdf" and input_format != InputFormat.PDF:
|
204
|
+
error_msg = "展平PDF功能仅支持PDF文件"
|
205
|
+
await self.logger.error(error_msg)
|
206
|
+
return ConversionResult(success=False, file_path=file_path, error_message=error_msg, original_name=original_name)
|
207
|
+
|
208
|
+
# 如果是调整PDF大小操作,检查是否PDF文件
|
209
|
+
if format == "resize-pdf" and input_format != InputFormat.PDF:
|
210
|
+
error_msg = "调整PDF大小功能仅支持PDF文件"
|
211
|
+
await self.logger.error(error_msg)
|
212
|
+
return ConversionResult(success=False, file_path=file_path, error_message=error_msg, original_name=original_name)
|
201
213
|
|
202
214
|
# 验证输出格式(除去特殊操作外)
|
203
215
|
if not is_special_operation:
|
@@ -233,6 +245,10 @@ class Converter(BaseApiClient):
|
|
233
245
|
operation_desc = "去除水印"
|
234
246
|
elif format == "number-pdf":
|
235
247
|
operation_desc = "添加页码"
|
248
|
+
elif format == "flatten-pdf":
|
249
|
+
operation_desc = "展平PDF"
|
250
|
+
elif format == "resize-pdf":
|
251
|
+
operation_desc = "调整PDF大小"
|
236
252
|
else:
|
237
253
|
if is_remote_path:
|
238
254
|
operation_desc = f"转换为 {output_format.value.upper()} 格式"
|
@@ -1,10 +1,10 @@
|
|
1
1
|
lightpdf_aipdf_mcp/__init__.py,sha256=PPnAgpvJLYLVOTxnHDmJAulFnHJD6wuTwS6tRGjqq6s,141
|
2
2
|
lightpdf_aipdf_mcp/common.py,sha256=_UO1f6S9Qr_3k6u5iBpdVDpvTK5U-tHEpu9KsDGqV8Y,6635
|
3
|
-
lightpdf_aipdf_mcp/converter.py,sha256=
|
3
|
+
lightpdf_aipdf_mcp/converter.py,sha256=Q_4vXcysqcJ7w6bUKY9JhoBDlCRcAJSpW7p0jh5qekU,16120
|
4
4
|
lightpdf_aipdf_mcp/editor.py,sha256=9teOqi2y2JbjcCI-kUhYpSXL-F75i7Mfr9E20KKyZP0,29909
|
5
5
|
lightpdf_aipdf_mcp/server.py,sha256=uLb_gOB1uP6eN53BDMp2qLXQk_9GjKJjYJDSjb75iyo,62324
|
6
6
|
lightpdf_aipdf_mcp/translator.py,sha256=NbFDz-mZSD4qCNQVyV0W_0x6xXwbqs_7FiBU13JAxZs,4243
|
7
|
-
lightpdf_aipdf_mcp-0.1.
|
8
|
-
lightpdf_aipdf_mcp-0.1.
|
9
|
-
lightpdf_aipdf_mcp-0.1.
|
10
|
-
lightpdf_aipdf_mcp-0.1.
|
7
|
+
lightpdf_aipdf_mcp-0.1.90.dist-info/METADATA,sha256=jHqG5XdMATbeDUTBlhhRygdzAU45er5yBrZNBbw0yVc,8119
|
8
|
+
lightpdf_aipdf_mcp-0.1.90.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
lightpdf_aipdf_mcp-0.1.90.dist-info/entry_points.txt,sha256=X7TGUe52N4sYH-tYt0YUGApeJgw-efQlZA6uAZmlmr4,63
|
10
|
+
lightpdf_aipdf_mcp-0.1.90.dist-info/RECORD,,
|
File without changes
|
{lightpdf_aipdf_mcp-0.1.89.dist-info → lightpdf_aipdf_mcp-0.1.90.dist-info}/entry_points.txt
RENAMED
File without changes
|