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.
Get PDF file
Signature
function 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>;2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Parameters
Parameter | Type | Description |
|---|---|---|
fileName | string | (Optional) File name |
outputMethod | (Optional) Output method. ADD since EDA v4.2 | |
contentConfig | { displayAttributesAsMenu: boolean; showOutlineOnly: boolean } | (Optional) Content configuration. 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) Watermark. ADD since EDA v4.2 |
graphPageConfig | Array<Record<string, any>> | (Optional) Graph page configuration. ADD since EDA v4.2 |
Returns
Promise<File | undefined>
PDF file data (or archive)
Remarks
You can use SYS_FileSystem.saveFile() API export the file to the local file system
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