feat(est): save print settings to ESTX
This commit is contained in:
@@ -3,6 +3,7 @@ const { importEstx, unzip, Values, memoryRows } = require("./import-estx.cjs");
|
||||
const { pack } = require("./archive.cjs");
|
||||
const { updateOptions } = require("./export-options.cjs");
|
||||
const { updateQuantities } = require("./export-quantity.cjs");
|
||||
const { updatePrintOptions } = require("./export-print.cjs");
|
||||
const signature = Buffer.from("068abe8e592364cb403d71d2e3bc64d0", "hex");
|
||||
const same = (a, b) => JSON.stringify(a ?? null) === JSON.stringify(b ?? null);
|
||||
let characters;
|
||||
@@ -169,6 +170,12 @@ function exportEstx(project) {
|
||||
if (!same(project.quantitySheets || [], base.quantitySheets || []))
|
||||
project = updateQuantities(project, base, cp949, memory);
|
||||
let changed = 0;
|
||||
if (project.nativePrintChanges && Object.keys(project.nativePrintChanges).length) {
|
||||
const print = files.get("datprintoption.opt");
|
||||
if (!print) throw Error("ESTX 원본 인쇄 설정 파일 없음");
|
||||
files.set("datprintoption.opt", updatePrintOptions(print, project.nativePrintChanges));
|
||||
changed++;
|
||||
}
|
||||
if (Object.keys(optionChanges).length) {
|
||||
const options = files.get("datestoption.opt");
|
||||
if (!options) throw Error("ESTX 원본 옵션 파일 없음");
|
||||
|
||||
Reference in New Issue
Block a user