这是indexloc提供的服务,不要输入任何密码
Skip to content

Feat:Add a way to preview office file #8598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

huang-aoqin
Copy link
Contributor

@huang-aoqin huang-aoqin commented Jul 1, 2025

What problem does this PR solve?

To solve #7696 , While parse document,allowed read ‘parser_config‘.'pdf_converter' field,if it's true,convert file to pdf.
Then add new preview interface for frontend use to preview office file.

Type of change

  • New Feature (non-breaking change which adds functionality)

- 将 convert_to_pdf函数的输入参数从文件路径改为字节流,提高灵活性和兼容性
- 优化 PDF转换过程,使用临时文件替代临时目录
- 更新 task_executor.py 中的 convert2pdf 任务处理逻辑
- 通过这些改动,提高了代码的可维护性和性能
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 💞 feature Feature request, pull request that fullfill a new feature. labels Jul 1, 2025
@KevinHuSh KevinHuSh requested a review from asiroliu July 1, 2025 06:05
@yingfeng yingfeng added the ci Continue Integration label Jul 1, 2025
@yingfeng
Copy link
Member

yingfeng commented Jul 1, 2025

Thank you, pls fix the static check error reported by CI

-Modify the convert_to-pdf function to return the content of the PDF file instead of the file path
-Directly process PDF conversion results in File2DDocumentService, reducing the creation and deletion of temporary files
-Optimize exception handling to improve code robustness
@huang-aoqin
Copy link
Contributor Author

fixed

-Remove the LD_LIBRRY-PATH environment variable setting from Dockerfile
-set the LD_LIBRRY-PATH environment variable in the convert_to-pdf function
@asiroliu
Copy link
Contributor

asiroliu commented Jul 4, 2025

The original requirement specified ​​frontend preview capability​​, but your commit only addresses backend implementations.

@huang-aoqin
Copy link
Contributor Author

Sorry,I'm not good at frontend,The only thing frontend need to do is use /preview interface

- 将下载附件的名称从 doc[0].name 更改为 doc_location
-确保用户下载的合同文件具有正确的名称
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continue Integration 💞 feature Feature request, pull request that fullfill a new feature. size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants