Feature/docs generator (#11858)

### Type of change

- [x] New Feature (non-breaking change which adds functionality)


### What problem does this PR solve?

This PR introduces a new Docs Generator agent component for producing
downloadable PDF, DOCX, or TXT files from Markdown content generated
within a RAGFlow workflow.

### **Key Features**

**Backend**

- New component: DocsGenerator (agent/component/docs_generator.py)
- 
- Markdown → PDF/DOCX/TXT conversion
- 
- Supports tables, lists, code blocks, headings, and rich formatting
- 
- Configurable document style (fonts, margins, colors, page size,
orientation)
- 
- Optional header logo and footer with page numbers/timestamps
- 

**Frontend**

- New configuration UI for the Docs Generator
- 
- Download button integrated into the chat interface
- 
- Output wired to the Message component
- 
- Full i18n support

**Documentation**

Added component guide:
docs/guides/agent/agent_component_reference/docs_generator.md

**Usage**

Add the Docs Generator to a workflow, connect Markdown output from an
upstream component, configure metadata/style, and feed its output into
the Message component. Users will see a document download button
directly in the chat.

**Contributor Note**

We have been following RAGFlow since more than a year and half now and
have worked extensively on personalizing the framework and integrating
it into several of our internal systems. Over the past year and a half,
we have built multiple platforms that rely on RAGFlow as a core
component, which has given us a strong appreciation for how flexible and
powerful the project is.

We also previously contributed the full Italian translation, and we were
glad to see it accepted. This new Docs Generator component was created
for our own production needs, and we believe that it may be useful for
many others in the community as well.

We want to sincerely thank the entire RAGFlow team for the remarkable
work you have done and continue to do. If there are opportunities to
contribute further, we would be glad to help whenever we have time
available. It would be a pleasure to support the project in any way we
can.

If appropriate, we would be glad to be listed among the project’s
contributors, but in any case we look forward to continuing to support
and contribute to the project.

PentaFrame Development Team

---------

Co-authored-by: PentaFrame <info@pentaframe.it>
Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
PentaFDevs
2025-12-12 07:59:43 +01:00
committed by GitHub
parent 6560388f2b
commit f9510edbbc
29 changed files with 3043 additions and 102 deletions

View File

@ -849,15 +849,31 @@ export default {
baiduDescription: `此組件用於取得www.baidu.com的搜尋結果一般作為知識庫的補充Top N指定需要採納的搜尋結果數。`,
duckDuckGo: 'DuckDuckGo',
duckDuckGoDescription:
'此件用於從 www.duckduckgo.com 取得搜尋結果通常,它作為知識庫的補充。 Top N 指定您需要採用的搜尋結果。',
'此件用於從 www.duckduckgo.com 取得搜尋結果通常充當知識庫的補充。Top N 指定搜尋結果的數量。',
searXNG: 'SearXNG',
searXNGDescription:
'組件過您提供的 SearXNG 實例地址進行搜。請設 Top N 和實例 URL。',
channel: '頻道',
channelTip: '針對該組件的輸入進行文字搜尋或新聞搜索',
text: '文字',
news: '新聞',
messageHistoryWindowSize: '歷史訊息視窗大小',
'組件過您提供的 SearXNG 實例 URL 進行搜。請設 Top N 和實例 URL。',
pdfGenerator: '文檔生成器',
pPDFGenerator: '文檔生成器',
pdfGeneratorDescription: `該組件從 markdown 格式的內容生成文檔PDF、DOCX、TXT支援自定義樣式、圖片和表格。支援**粗體**、*斜體*、# 標題、- 列表、使用 | 語法的表格。`,
pPDFGeneratorDescription: `該組件從 markdown 格式的內容生成文檔PDF、DOCX、TXT支援自定義樣式、圖片和表格。支援**粗體**、*斜體*、# 標題、- 列表、使用 | 語法的表格。`,
subtitle: '副標題',
logoImage: '標誌圖片',
logoPosition: '標誌位置',
logoWidth: '標誌寬度',
logoHeight: '標誌高度',
fontFamily: '字體系列',
fontSize: '字體大小',
titleFontSize: '標題字體大小',
pageSize: '頁面大小',
orientation: '方向',
marginTop: '上邊距',
marginBottom: '下邊距',
filename: '檔名',
outputDirectory: '輸出目錄',
addPageNumbers: '添加頁碼',
addTimestamp: '添加時間戳',
watermarkText: '浮水印文字',
messageHistoryWindowSizeTip:
'LLM 需要查看的對話歷史視窗大小。越大越好,但要注意 LLM 的最大 Token 數。',
wikipedia: '維基百科',