empf-generator
v1.1.0
Published
A module to generate .empf files compatible with eufyMake Studio.
Readme
.empf Generator
A module to generate .empf files compatible with eufyMake Studio.
Programmatically create print files for your eufyMake E1 UV printer!
Install
npm install empf-generatorExample
const {EmpfGenerator, InkModeEnum, PrintBedEnum} = require("empf-generator");
const fs = require("fs");
const imagePath = "./image.png";
const outPath = "./output.empf";
(async () => {
const image = fs.readFileSync(imagePath);
const generator = new EmpfGenerator({
printBed: PrintBedEnum.standardFlatbed,
projectName: "Test Project"
});
await generator.addImage(image, 0, 0, 8.5 * 25.4, 11 * 25.4, {
inkMode: InkModeEnum.white_cmyk,
whiteLayers: 2,
cmykLayers: 1
});
await generator.export(outPath);
})();API
EmpfGenerator
Class for generating .empf files
Kind: global class
new EmpfGenerator([options])
Creates a new EmpfGenerator.
| Param | Type | Default | Description | | --- | --- | --- | --- | | [options] | Object | | The generator options. | | [options.printBed] | PrintBedEnum | PrintBedEnum.standardFlatbed | The print bed to use. | | [options.projectName] | string | "Untitled Design" | The name of the project. | | [options.canvasBackground] | string | "#ffffff" | The canvas background color, as a hex code. |
empfGenerator.addImage(imageBuf, x_mm, y_mm, width_mm, height_mm, [options])
Adds an image to the canvas.
Kind: instance method of EmpfGenerator
| Param | Type | Default | Description | | --- | --- | --- | --- | | imageBuf | Buffer | | The image Buffer to add. | | x_mm | number | | The x-coordinate to place the bottom right corner of the image, in mm. | | y_mm | number | | The y-coordinate to place the bottom right corner of the image, in mm. | | width_mm | number | | The width of the image, in mm. | | height_mm | number | | The height of the image, in mm. | | [options] | Object | | Additional options. | | [options.inkMode] | InkModeEnum | InkModeEnum.white_cmyk | The ink mode to use. | | [options.whiteLayers] | number | 1 | The number of white layers to use, if applicable for the ink mode. | | [options.cmykLayers] | number | 1 | The number of CMYK layers to use, if applicable for the ink mode. | | [options.glossLayers] | number | 1 | The number of gloss layers to use, if applicable for the ink mode. | | [options.angle] | number | 0 | The rotation angle. | | [options.flipX] | boolean | false | Whether to flip the image horizontally. | | [options.flipY] | boolean | false | Whether to flip the image vertically. | | [options.opacity] | number | 1 | The opacity of the image. | | [options.layerName] | string | "Image Layer" | The name of the image layer. | | [options.lock] | boolean | false | Whether the image is locked. | | [options.visible] | boolean | true | Whether the image is visible. | | [options.skipPrint] | boolean | false | Whether to skip printing the image. |
empfGenerator.export(outPath)
Exports the canvas to a .empf file.
Kind: instance method of EmpfGenerator
| Param | Type | Description | | --- | --- | --- | | outPath | string | The output path to export to. |
InkModeEnum : enum
Enum for ink modes.
Kind: global enum
Read only: true
Properties
| Name | Type | Default | | --- | --- | --- | | white_cmyk | number | 0 | | cmyk | number | 1 | | gloss | number | 2 | | white | number | 3 | | cmyk_white | number | 4 | | cmyk_white_cmyk | number | 5 | | cmyk_gloss | number | 6 | | white_cmyk_gloss | number | 7 | | sticker | number | 111 |
PrintBedEnum : enum
Enum for print beds.
Kind: global enum
Read only: true
Properties
| Name | Type | Default | | --- | --- | --- | | standardFlatbed | string | "standardFlatbed" | | miniFlatbed | string | "miniFlatbed" |
