Home > PCB_ManufactureData > getPdfFile
PCB_ManufactureData.getPdfFile() 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.
获取 PDF 文件
Signature
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>;Parameters
Parameter | Type | Description |
|---|---|---|
fileName | string | (Optional) 文件名 |
outputMethod | (Optional) 输出方式 ADD since EDA v4.2 | |
contentConfig | { displayAttributesAsMenu: boolean; showOutlineOnly: boolean } | (Optional) 内容配置 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' } } | (Optional) 水印 ADD since EDA v4.2 |
graphPageConfig | Array<Record<string, any>> | (Optional) 图页配置 ADD since EDA v4.2 |
Returns
Promise<File | undefined>
PDF 文件数据(或压缩包)
Remarks
可以使用 SYS_FileSystem.saveFile() 接口将文件导出到本地文件系统
REFACTOR since EDA v4.2
Example
// 导出多页 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