输出的文档使用新的文件名
This commit is contained in:
@@ -261,18 +261,19 @@ async def edit_docx(input_docx_path: str, replacements: Optional[List[Dict[str,
|
|||||||
img_pairs.append((idx, local_img))
|
img_pairs.append((idx, local_img))
|
||||||
|
|
||||||
# 复用原始处理函数
|
# 复用原始处理函数
|
||||||
|
output_docx = local_input.replace(".docx", "_output.docx")
|
||||||
process(
|
process(
|
||||||
input_docx=local_input,
|
input_docx=local_input,
|
||||||
output_docx=local_input,
|
output_docx=output_docx,
|
||||||
replacements=rep_pairs,
|
replacements=rep_pairs,
|
||||||
image_replacements=img_pairs,
|
image_replacements=img_pairs,
|
||||||
color_keywords=color_keywords,
|
color_keywords=color_keywords,
|
||||||
)
|
)
|
||||||
|
|
||||||
abs_out = os.path.abspath(local_input)
|
abs_out = os.path.abspath(output_docx)
|
||||||
return {
|
return {
|
||||||
"output_path": abs_out,
|
"output_path": output_docx,
|
||||||
"output_url": _build_output_url(abs_out),
|
"output_url": _build_output_url(output_docx),
|
||||||
}
|
}
|
||||||
finally:
|
finally:
|
||||||
if tmp_input and os.path.exists(tmp_input):
|
if tmp_input and os.path.exists(tmp_input):
|
||||||
|
|||||||
Reference in New Issue
Block a user