Home > PCB_ManufactureData > getPdfFile
PCB_ManufactureData.getPdfFile() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
获取 PDF 文件
签名
public getPdfFile(fileName?: string, outputMethod?: EPCB_PdfOutputMethod, contentConfig?: { displayAttributesAsMenu: boolean; showOutlineOnly: boolean }, watermark?: { show?: undefined | false | true; content?: undefined | string; styleConfig?: undefined | { color: string; transparency: 'Opaque' | '75%' | '50%' | '25%'; font: string; fontSize: { unit: ESYS_Unit.MILLIMETER | ESYS_Unit.INCH | ESYS_Unit.MIL; value: number }; style: { bold: boolean; italic: boolean; underline: boolean }; slope: 0 | 45 | 90; denseness: 'Single' | 'Sparse' | 'Std' | 'Dense' } }, graphPageConfig?: Array<Record<string, any>>): Promise<File | undefined>;参数名
参数 | 类型 | 描述 |
|---|---|---|
fileName | string | (可选) 文件名 |
outputMethod | (可选) 输出方式 ADD since EDA v4.2 | |
contentConfig | { displayAttributesAsMenu: boolean; showOutlineOnly: boolean } | (可选) 内容配置 ADD since EDA v4.2 |
watermark | { show?: undefined | false | true; content?: undefined | string; styleConfig?: undefined | { color: string; transparency: 'Opaque' | '75%' | '50%' | '25%'; font: string; fontSize: { unit: ESYS_Unit.MILLIMETER | ESYS_Unit.INCH | ESYS_Unit.MIL; value: number }; style: { bold: boolean; italic: boolean; underline: boolean }; slope: 0 | 45 | 90; denseness: 'Single' | 'Sparse' | 'Std' | 'Dense' } } | (可选) 水印 ADD since EDA v4.2 |
graphPageConfig | Array<Record<string, any>> | (可选) 图页配置 ADD since EDA v4.2 |
返回值
Promise<File | undefined>
PDF 文件数据(或压缩包)
备注
可以使用 SYS_FileSystem.saveFile() 接口将文件导出到本地文件系统
REFACTOR since EDA v4.2
示例
// 导出多页 PDF(包含所有图层)
const pdfFile = await eda.pcb_ManufactureData.getPdfFile(
'PCB_Documentation',
EPCB_PdfOutputMethod.MULTI_PAGE_PDF
);
if (pdfFile) {
await eda.sys_FileSystem.saveFile(pdfFile);
}2
3
4
5
6
7
8