Home > SYS_FileManager > getDocumentSource
SYS_FileManager.getDocumentSource() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Get Document source code
Signature
typescript
function getDocumentSource(): Promise<string | undefined>;1
Returns
Promise<string | undefined>
Document source code data, undefined indicates that it is currently not open document or data retrieval failed
Example
javascript
// 1. 读取当前文档源码
const source = await eda.sys_FileManager.getDocumentSource();
// 2. 输出源码长度与前 60 字符预览(DOCHEAD 开头的 JSON 分段结构)
console.log('源码长度:', source.length);
console.log('源码预览:', source.slice(0, 60));1
2
3
4
5
6
2
3
4
5
6