Home > SCH_ManufactureData > getExportDocumentFile
SCH_ManufactureData.getExportDocumentFile() 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.
Warning: This API is now obsolete.
- DEPRECATED since EDA v4.1
Get Export document file
Signature
function getExportDocumentFile(
fileName?: string,
fileType?: ESCH_ExportDocumentFileType,
typeSpecificParams?: {
theme?: undefined | 'Default' | 'White on Black' | 'Black on White';
lineWidth?: undefined | 'Default' | 'Always 1px' | 'Follow the Zoom Change';
displayAttributesAsMenu?: undefined | false | true;
size?:
| undefined
| string
| { width: number; height: number; unit: ESYS_Unit.MILLIMETER | ESYS_Unit.INCH };
},
object?: 'All Schematic' | 'Current Schematic' | 'Current Schematic Page' | string,
objectSpecificParams?: {
range?: undefined | 'All' | any;
outputMethod?: undefined | 'Merged sheet' | 'Separated sheet';
},
): Promise<File | undefined>;2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Parameters
Parameter | Type | Description |
|---|---|---|
fileName | string | (Optional) File name |
fileType | (Optional) File type | |
typeSpecificParams | { theme?: undefined | 'Default' | 'White on Black' | 'Black on White'; lineWidth?: undefined | 'Default' | 'Always 1px' | 'Follow the Zoom Change'; displayAttributesAsMenu?: undefined | false | true; size?: undefined | string | { width: number; height: number; unit: ESYS_Unit.MILLIMETER | ESYS_Unit.INCH } } | (Optional) Type-specific parameters |
object | 'All Schematic' | 'Current Schematic' | 'Current Schematic Page' | string | (Optional) Object |
objectSpecificParams | { range?: undefined | 'All' | any; outputMethod?: undefined | 'Merged sheet' | 'Separated sheet' } | (Optional) Object-specific parameters |
Returns
Promise<File | undefined>
Exported document file data (or archive)
Remarks
You can use SYS_FileSystem.saveFile() API export the file to the local file system
Example
// 1. 把当前图页导出为 PDF('PDF' 对应 ESCH_ExportDocumentFileType.PDF)
// const pdfFile = await eda.sch_ManufactureData.getExportDocumentFile(
// '嘉立创示例_原理图',
// 'PDF',
// undefined,
// 'Current Schematic Page'
// );
// console.log('导出文件名:', pdfFile?.name);
// 2. 也可以导出 PNG 位图,并通过类型特定参数控制主题和线宽
// const pngFile = await eda.sch_ManufactureData.getExportDocumentFile(
// '嘉立创示例_原理图',
// 'PNG',
// { theme: 'Black on White', lineWidth: 'Always 1px' },
// 'All Schematic',
// { outputMethod: 'Separated sheet' } // 多图页时逐页分张输出
// );
// console.log('导出文件名:', pngFile?.name);
// 3. 拿到文件后用 sys_FileSystem.saveFile() 保存到本地
console.log('演示调用:getExportDocumentFile(文件名, 文件类型, 显示参数, 导出范围, 多页参数)');2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19