@mlightcad/cad-pdf-plugin 1.7.8 → 1.8.0-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +186 -180
- package/dist/cad-pdf-plugin.js +3381 -3552
- package/dist/cad-pdf-plugin.umd.cjs +11 -11
- package/lib/AcApConvertToPdfCmd.d.ts +5 -0
- package/lib/AcApConvertToPdfCmd.d.ts.map +1 -1
- package/lib/AcApConvertToPdfCmd.js +47 -2
- package/lib/AcApConvertToPdfCmd.js.map +1 -1
- package/lib/AcApPdfConvertor.d.ts +7 -7
- package/lib/AcApPdfConvertor.d.ts.map +1 -1
- package/lib/AcApPdfConvertor.js +23 -32
- package/lib/AcApPdfConvertor.js.map +1 -1
- package/lib/AcApPdfExportOptions.d.ts +19 -26
- package/lib/AcApPdfExportOptions.d.ts.map +1 -1
- package/lib/AcApPdfExportOptions.js +5 -5
- package/lib/AcApPdfExportOptions.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +11 -9
- package/lib/AcApPdfGlyphProvider.d.ts +0 -15
- package/lib/AcApPdfGlyphProvider.d.ts.map +0 -1
- package/lib/AcApPdfGlyphProvider.js +0 -425
- package/lib/AcApPdfGlyphProvider.js.map +0 -1
|
@@ -14,6 +14,11 @@ export declare class AcApConvertToPdfCmd extends AcEdCommand {
|
|
|
14
14
|
*/
|
|
15
15
|
execute(context: AcApContext): Promise<void>;
|
|
16
16
|
private promptOptions;
|
|
17
|
+
/**
|
|
18
|
+
* Prompts the colour treatment: keep entity colours, or black drawing
|
|
19
|
+
* content on white paper (monochrome).
|
|
20
|
+
*/
|
|
21
|
+
private promptColorMode;
|
|
17
22
|
/**
|
|
18
23
|
* Prompts how text is painted: real PDF text (small file, selectable) or
|
|
19
24
|
* vector glyph outlines (current behaviour).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApConvertToPdfCmd.d.ts","sourceRoot":"","sources":["../src/AcApConvertToPdfCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGX,WAAW,EAGZ,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"AcApConvertToPdfCmd.d.ts","sourceRoot":"","sources":["../src/AcApConvertToPdfCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGX,WAAW,EAGZ,MAAM,8BAA8B,CAAA;AAUrC;;;;;;GAMG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;YAUpB,aAAa;IAkC3B;;;OAGG;YACW,eAAe;IAsC7B;;;OAGG;YACW,cAAc;YAqCd,mBAAmB;YAwCnB,WAAW;CAoC1B"}
|
|
@@ -91,7 +91,7 @@ var AcApConvertToPdfCmd = /** @class */ (function (_super) {
|
|
|
91
91
|
};
|
|
92
92
|
AcApConvertToPdfCmd.prototype.promptOptions = function () {
|
|
93
93
|
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
-
var defaults, modelSpaceFit, exportLayouts, textMode;
|
|
94
|
+
var defaults, modelSpaceFit, exportLayouts, textMode, colorMode;
|
|
95
95
|
return __generator(this, function (_a) {
|
|
96
96
|
switch (_a.label) {
|
|
97
97
|
case 0:
|
|
@@ -114,15 +114,60 @@ var AcApConvertToPdfCmd = /** @class */ (function (_super) {
|
|
|
114
114
|
if (textMode === undefined) {
|
|
115
115
|
return [2 /*return*/, undefined];
|
|
116
116
|
}
|
|
117
|
+
return [4 /*yield*/, this.promptColorMode()];
|
|
118
|
+
case 4:
|
|
119
|
+
colorMode = _a.sent();
|
|
120
|
+
if (colorMode === undefined) {
|
|
121
|
+
return [2 /*return*/, undefined];
|
|
122
|
+
}
|
|
117
123
|
return [2 /*return*/, resolveAcApPdfExportOptions({
|
|
118
124
|
modelSpaceFit: modelSpaceFit,
|
|
119
125
|
exportLayouts: exportLayouts,
|
|
120
|
-
textMode: textMode
|
|
126
|
+
textMode: textMode,
|
|
127
|
+
colorMode: colorMode
|
|
121
128
|
})];
|
|
122
129
|
}
|
|
123
130
|
});
|
|
124
131
|
});
|
|
125
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* Prompts the colour treatment: keep entity colours, or black drawing
|
|
135
|
+
* content on white paper (monochrome).
|
|
136
|
+
*/
|
|
137
|
+
AcApConvertToPdfCmd.prototype.promptColorMode = function () {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
+
var defaults, prompt, color, monochrome, result;
|
|
140
|
+
return __generator(this, function (_a) {
|
|
141
|
+
switch (_a.label) {
|
|
142
|
+
case 0:
|
|
143
|
+
defaults = resolveAcApPdfExportOptions();
|
|
144
|
+
prompt = new AcEdPromptKeywordOptions(AcApI18n.t('jig.cpdf.colorMode'));
|
|
145
|
+
prompt.allowNone = true;
|
|
146
|
+
color = prompt.keywords.add(AcApI18n.t('jig.cpdf.keywords.color.display'), AcApI18n.t('jig.cpdf.keywords.color.global'), AcApI18n.t('jig.cpdf.keywords.color.local'));
|
|
147
|
+
monochrome = prompt.keywords.add(AcApI18n.t('jig.cpdf.keywords.monochrome.display'), AcApI18n.t('jig.cpdf.keywords.monochrome.global'), AcApI18n.t('jig.cpdf.keywords.monochrome.local'));
|
|
148
|
+
prompt.keywords.default =
|
|
149
|
+
defaults.colorMode === 'monochrome' ? monochrome : color;
|
|
150
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getKeywords(prompt)];
|
|
151
|
+
case 1:
|
|
152
|
+
result = _a.sent();
|
|
153
|
+
if (result.status === AcEdPromptStatus.Cancel) {
|
|
154
|
+
return [2 /*return*/, undefined];
|
|
155
|
+
}
|
|
156
|
+
if (result.status === AcEdPromptStatus.None) {
|
|
157
|
+
return [2 /*return*/, defaults.colorMode];
|
|
158
|
+
}
|
|
159
|
+
if (result.status === AcEdPromptStatus.OK ||
|
|
160
|
+
result.status === AcEdPromptStatus.Keyword) {
|
|
161
|
+
if (!result.stringResult) {
|
|
162
|
+
return [2 /*return*/, defaults.colorMode];
|
|
163
|
+
}
|
|
164
|
+
return [2 /*return*/, result.stringResult === 'Monochrome' ? 'monochrome' : 'color'];
|
|
165
|
+
}
|
|
166
|
+
return [2 /*return*/, undefined];
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
};
|
|
126
171
|
/**
|
|
127
172
|
* Prompts how text is painted: real PDF text (small file, selectable) or
|
|
128
173
|
* vector glyph outlines (current behaviour).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApConvertToPdfCmd.js","sourceRoot":"","sources":["../src/AcApConvertToPdfCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAEL,cAAc,EACd,QAAQ,EACR,WAAW,EACX,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"AcApConvertToPdfCmd.js","sourceRoot":"","sources":["../src/AcApConvertToPdfCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAEL,cAAc,EACd,QAAQ,EACR,WAAW,EACX,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAIL,2BAA2B,EAC5B,MAAM,wBAAwB,CAAA;AAE/B;;;;;;GAMG;AACH;IAAyC,uCAAW;IAApD;;IAiNA,CAAC;IAhNC;;;;OAIG;IACG,qCAAO,GAAb,UAAc,OAAoB;;;;;4BAChB,qBAAM,IAAI,CAAC,aAAa,EAAE,EAAA;;wBAApC,OAAO,GA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AC,EAAE,CAAA;wBAEhC,qBAAM,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,EAAA;;wBAAjE,MAAM,GAAG,SAAwD;wBACvE,IAAI,MAAM,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,EAAE,CAAC;4BAC9C,sBAAO,SAAS,EAAA;wBAClB,CAAC;wBACD,IAAI,MAAM,CAAC,MAAM,KAAK,gBAAgB,CAAC,IAAI,EAAE,CAAC;4BAC5C,sBAAO,UAAU,EAAA;wBACnB,CAAC;wBACD,IACE,MAAM,CAAC,MAAM,KAAK,gBAAgB,CAAC,EAAE;4BACrC,MAAM,CAAC,MAAM,KAAK,gBAAgB,CAAC,OAAO,EAC1C,CAAC;4BACD,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;gCACzB,sBAAO,UAAU,EAAA;4BACnB,CAAC;4BACD,sBAAO,MAAM,CAAC,YAAY,KAAK,KAAK,EAAA;wBACtC,CAAC;wBACD,sBAAO,SAAS,EAAA;;;;KACjB;IACH,0BAAC;AAAD,CAAC,AAjND,CAAyC,WAAW,GAiNnD"}
|
|
@@ -3,21 +3,21 @@ import { type AcApPdfExportOptions } from './AcApPdfExportOptions';
|
|
|
3
3
|
/**
|
|
4
4
|
* Converts the current CAD drawing to a vector PDF and downloads it.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Rendering is delegated to `@mlightcad/cad-pdf-core` (shared with the
|
|
7
|
+
* headless `cad-pdf-exporter`); this class only supplies viewer services —
|
|
8
|
+
* the live view box for `'display'` framing, the viewer font mapping and
|
|
9
|
+
* catalog-backed font embedding — and triggers the browser download.
|
|
9
10
|
*
|
|
10
11
|
* When {@link AcApPdfExportOptions.exportLayouts} is true, every layout becomes
|
|
11
|
-
* one PDF page.
|
|
12
|
-
*
|
|
13
|
-
* for the duration.
|
|
12
|
+
* one PDF page. {@link AcApPdfExportOptions.colorMode} `'monochrome'` exports
|
|
13
|
+
* black content on white paper. A busy indicator is shown for the duration.
|
|
14
14
|
*/
|
|
15
15
|
export declare class AcApPdfConvertor {
|
|
16
16
|
/**
|
|
17
17
|
* Renders the current drawing to PDF and triggers a browser download.
|
|
18
18
|
*
|
|
19
19
|
* @param context - Active document context
|
|
20
|
-
* @param options - Export framing and
|
|
20
|
+
* @param options - Export framing, layout, text and colour options
|
|
21
21
|
*/
|
|
22
22
|
convert(context: AcApContext, options?: AcApPdfExportOptions): Promise<void>;
|
|
23
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApPdfConvertor.d.ts","sourceRoot":"","sources":["../src/AcApPdfConvertor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcApPdfConvertor.d.ts","sourceRoot":"","sources":["../src/AcApPdfConvertor.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAMjB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,wBAAwB,CAAA;AAG/B;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAgB;IAC3B;;;;;OAKG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,oBAAyB;IAuBtE;;OAEG;IACH,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,aAAa;CAYtB"}
|
package/lib/AcApPdfConvertor.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
13
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
14
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -34,22 +45,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
46
|
}
|
|
36
47
|
};
|
|
48
|
+
import { acexPdfExportDatabase } from '@mlightcad/cad-pdf-core';
|
|
37
49
|
import { AcApDocManager, AcApI18n, AcApSettingManager, resolveExportDownloadName } from '@mlightcad/cad-simple-viewer';
|
|
38
|
-
import { exportDatabaseToPdf } from '@mlightcad/pdf-renderer';
|
|
39
50
|
import { resolveAcApPdfExportOptions } from './AcApPdfExportOptions';
|
|
40
51
|
import { resolveViewerTextFont } from './AcApPdfFontResolver';
|
|
41
|
-
import { createViewerPdfGlyphProvider } from './AcApPdfGlyphProvider';
|
|
42
52
|
/**
|
|
43
53
|
* Converts the current CAD drawing to a vector PDF and downloads it.
|
|
44
54
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
55
|
+
* Rendering is delegated to `@mlightcad/cad-pdf-core` (shared with the
|
|
56
|
+
* headless `cad-pdf-exporter`); this class only supplies viewer services —
|
|
57
|
+
* the live view box for `'display'` framing, the viewer font mapping and
|
|
58
|
+
* catalog-backed font embedding — and triggers the browser download.
|
|
48
59
|
*
|
|
49
60
|
* When {@link AcApPdfExportOptions.exportLayouts} is true, every layout becomes
|
|
50
|
-
* one PDF page.
|
|
51
|
-
*
|
|
52
|
-
* for the duration.
|
|
61
|
+
* one PDF page. {@link AcApPdfExportOptions.colorMode} `'monochrome'` exports
|
|
62
|
+
* black content on white paper. A busy indicator is shown for the duration.
|
|
53
63
|
*/
|
|
54
64
|
var AcApPdfConvertor = /** @class */ (function () {
|
|
55
65
|
function AcApPdfConvertor() {
|
|
@@ -58,7 +68,7 @@ var AcApPdfConvertor = /** @class */ (function () {
|
|
|
58
68
|
* Renders the current drawing to PDF and triggers a browser download.
|
|
59
69
|
*
|
|
60
70
|
* @param context - Active document context
|
|
61
|
-
* @param options - Export framing and
|
|
71
|
+
* @param options - Export framing, layout, text and colour options
|
|
62
72
|
*/
|
|
63
73
|
AcApPdfConvertor.prototype.convert = function (context_1) {
|
|
64
74
|
return __awaiter(this, arguments, void 0, function (context, options) {
|
|
@@ -70,33 +80,14 @@ var AcApPdfConvertor = /** @class */ (function () {
|
|
|
70
80
|
case 0:
|
|
71
81
|
resolved = resolveAcApPdfExportOptions(options);
|
|
72
82
|
return [4 /*yield*/, AcApDocManager.instance.withBusyIndicator(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
73
|
-
var db,
|
|
83
|
+
var db, bytes, downloadName;
|
|
74
84
|
return __generator(this, function (_a) {
|
|
75
85
|
switch (_a.label) {
|
|
76
86
|
case 0:
|
|
77
87
|
db = context.doc.database;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
celtscale: db.celtscale,
|
|
82
|
-
showLineWeight: !!db.lwdisplay,
|
|
83
|
-
fontMapping: AcApSettingManager.instance.fontMapping,
|
|
84
|
-
background: 'none',
|
|
85
|
-
fit: resolved.modelSpaceFit === 'display' ? 'current' : 'extents',
|
|
86
|
-
layouts: resolved.exportLayouts ? 'all' : 'current',
|
|
87
|
-
glyphProvider: createViewerPdfGlyphProvider(),
|
|
88
|
-
textMode: resolved.textMode
|
|
89
|
-
};
|
|
90
|
-
if (resolved.textMode === 'text') {
|
|
91
|
-
pdfOptions.textFontResolver = resolveViewerTextFont;
|
|
92
|
-
}
|
|
93
|
-
if (resolved.modelSpaceFit === 'display') {
|
|
94
|
-
inModelSpace = db.currentSpaceId === db.tables.blockTable.modelSpace.objectId;
|
|
95
|
-
if (inModelSpace || !resolved.exportLayouts) {
|
|
96
|
-
pdfOptions.fitBox = this.captureFitBox(context.view);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return [4 /*yield*/, exportDatabaseToPdf(db, pdfOptions)];
|
|
88
|
+
return [4 /*yield*/, acexPdfExportDatabase(db, __assign(__assign({}, resolved), { title: context.doc.fileName || context.doc.docTitle, fontMapping: AcApSettingManager.instance.fontMapping, displayBox: resolved.modelSpaceFit === 'display'
|
|
89
|
+
? this.captureFitBox(context.view)
|
|
90
|
+
: undefined, textFontResolver: resolveViewerTextFont }))];
|
|
100
91
|
case 1:
|
|
101
92
|
bytes = _a.sent();
|
|
102
93
|
downloadName = resolveExportDownloadName(context.doc.fileName || context.doc.docTitle, 'pdf');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApPdfConvertor.js","sourceRoot":"","sources":["../src/AcApPdfConvertor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcApPdfConvertor.js","sourceRoot":"","sources":["../src/AcApPdfConvertor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,qBAAqB,EAAsB,MAAM,yBAAyB,CAAA;AACnF,OAAO,EAEL,cAAc,EACd,QAAQ,EACR,kBAAkB,EAElB,yBAAyB,EAC1B,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAE7D;;;;;;;;;;;GAWG;AACH;IAAA;IA+DA,CAAC;IA9DC;;;;;OAKG;IACG,kCAAO,GAAb;4DAAc,OAAoB,EAAE,OAAkC;;;YAAlC,wBAAA,EAAA,YAAkC;;;;wBAC9D,QAAQ,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAA;wBAErD,qBAAM,cAAc,CAAC,QAAQ,CAAC,iBAAiB,CAAC;;;;;4CACxC,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAA;4CACjB,qBAAM,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,CAAC,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;gBACrC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;aACtC;SACF,CAAA;IACH,CAAC;IAEO,wCAAa,GAArB,UAAsB,KAAiB,EAAE,YAAoB;QAC3D,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,KAAiB,CAAC,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAA;QACvE,IAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;QACrC,IAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QACf,IAAI,CAAC,QAAQ,GAAG,YAAY,IAAI,aAAa,CAAA;QAC7C,IAAI,CAAC,GAAG,GAAG,UAAU,CAAA;QACrB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QAC/B,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QAC/B,MAAM,CAAC,UAAU,CAAC,cAAM,OAAA,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,EAAxB,CAAwB,EAAE,KAAM,CAAC,CAAA;IAC3D,CAAC;IACH,uBAAC;AAAD,CAAC,AA/DD,IA+DC"}
|
|
@@ -1,38 +1,31 @@
|
|
|
1
|
+
import { type AcExPdfColorMode, type AcExPdfExportOptions, type AcExPdfModelSpaceFit, type AcExPdfTextMode } from '@mlightcad/cad-pdf-core';
|
|
1
2
|
/**
|
|
2
3
|
* Model-space page framing for PDF export.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
* - `extents` — fit drawable geometry in the current space.
|
|
5
|
+
* Alias of {@link AcExPdfModelSpaceFit} from `@mlightcad/cad-pdf-core`.
|
|
6
6
|
*/
|
|
7
|
-
export type AcApPdfModelSpaceFit =
|
|
7
|
+
export type AcApPdfModelSpaceFit = AcExPdfModelSpaceFit;
|
|
8
|
+
/**
|
|
9
|
+
* How MTEXT/TEXT are painted. Alias of {@link AcExPdfTextMode}.
|
|
10
|
+
*/
|
|
11
|
+
export type AcApPdfTextMode = AcExPdfTextMode;
|
|
12
|
+
/**
|
|
13
|
+
* Colour treatment of the exported PDF (`'color'` or black-on-white
|
|
14
|
+
* `'monochrome'`). Alias of {@link AcExPdfColorMode}.
|
|
15
|
+
*/
|
|
16
|
+
export type AcApPdfColorMode = AcExPdfColorMode;
|
|
8
17
|
/**
|
|
9
18
|
* User-configurable options for PDF export (`cpdf` dialog, `-cpdf`, and API).
|
|
19
|
+
*
|
|
20
|
+
* Alias of {@link AcExPdfExportOptions} from `@mlightcad/cad-pdf-core`, shared
|
|
21
|
+
* with the headless `@mlightcad/cad-pdf-exporter`.
|
|
10
22
|
*/
|
|
11
|
-
export
|
|
12
|
-
/**
|
|
13
|
-
* How to frame model-space pages. Defaults to `'extents'`.
|
|
14
|
-
* Paper-space pages always use their own drawable extents / paper size.
|
|
15
|
-
*/
|
|
16
|
-
modelSpaceFit?: AcApPdfModelSpaceFit;
|
|
17
|
-
/**
|
|
18
|
-
* When `true`, every layout (model + paper space) becomes a PDF page.
|
|
19
|
-
* When `false`, only the current space is exported. Defaults to `true`.
|
|
20
|
-
*/
|
|
21
|
-
exportLayouts?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* How MTEXT/TEXT are painted.
|
|
24
|
-
*
|
|
25
|
-
* - `'text'` (default): laid-out text is painted as real PDF text through
|
|
26
|
-
* fonts resolved from the viewer font catalog — text stays
|
|
27
|
-
* selectable/searchable and the file shrinks dramatically. Texts whose
|
|
28
|
-
* font is SHX or cannot be embedded fall back to vector glyphs.
|
|
29
|
-
* - `'vector'`: glyphs are tessellated into line/fill geometry
|
|
30
|
-
* (self-contained, but dense text dominates the file size).
|
|
31
|
-
*/
|
|
32
|
-
textMode?: 'vector' | 'text';
|
|
33
|
-
}
|
|
23
|
+
export type AcApPdfExportOptions = AcExPdfExportOptions;
|
|
34
24
|
/**
|
|
35
25
|
* Resolves PDF export options with package defaults.
|
|
26
|
+
*
|
|
27
|
+
* @param options - Partial options
|
|
28
|
+
* @returns Fully populated options
|
|
36
29
|
*/
|
|
37
30
|
export declare function resolveAcApPdfExportOptions(options?: AcApPdfExportOptions): Required<AcApPdfExportOptions>;
|
|
38
31
|
//# sourceMappingURL=AcApPdfExportOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApPdfExportOptions.d.ts","sourceRoot":"","sources":["../src/AcApPdfExportOptions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AcApPdfExportOptions.d.ts","sourceRoot":"","sources":["../src/AcApPdfExportOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAEzB,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAA;AAEhC;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAA;AAEvD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,CAAA;AAE7C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAA;AAE/C;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAA;AAEvD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,oBAAyB,GACjC,QAAQ,CAAC,oBAAoB,CAAC,CAEhC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { acexPdfResolveExportOptions } from '@mlightcad/cad-pdf-core';
|
|
1
2
|
/**
|
|
2
3
|
* Resolves PDF export options with package defaults.
|
|
4
|
+
*
|
|
5
|
+
* @param options - Partial options
|
|
6
|
+
* @returns Fully populated options
|
|
3
7
|
*/
|
|
4
8
|
export function resolveAcApPdfExportOptions(options) {
|
|
5
9
|
if (options === void 0) { options = {}; }
|
|
6
|
-
return
|
|
7
|
-
modelSpaceFit: options.modelSpaceFit === 'display' ? 'display' : 'extents',
|
|
8
|
-
exportLayouts: options.exportLayouts !== false,
|
|
9
|
-
textMode: options.textMode === 'vector' ? 'vector' : 'text'
|
|
10
|
-
};
|
|
10
|
+
return acexPdfResolveExportOptions(options);
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=AcApPdfExportOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApPdfExportOptions.js","sourceRoot":"","sources":["../src/AcApPdfExportOptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcApPdfExportOptions.js","sourceRoot":"","sources":["../src/AcApPdfExportOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,2BAA2B,EAE5B,MAAM,yBAAyB,CAAA;AA4BhC;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,OAAkC;IAAlC,wBAAA,EAAA,YAAkC;IAElC,OAAO,2BAA2B,CAAC,OAAO,CAAC,CAAA;AAC7C,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { AcApConvertToPdfCmd } from './AcApConvertToPdfCmd';
|
|
|
7
7
|
export { AcApImportPdfCmd } from './AcApImportPdfCmd';
|
|
8
8
|
export { AcApPdfConvertor } from './AcApPdfConvertor';
|
|
9
9
|
export { resolveViewerTextFont } from './AcApPdfFontResolver';
|
|
10
|
-
export { type AcApPdfExportOptions, type AcApPdfModelSpaceFit, resolveAcApPdfExportOptions } from './AcApPdfExportOptions';
|
|
10
|
+
export { type AcApPdfColorMode, type AcApPdfExportOptions, type AcApPdfModelSpaceFit, type AcApPdfTextMode, resolveAcApPdfExportOptions } from './AcApPdfExportOptions';
|
|
11
11
|
export { AcApPdfImportConvertor } from './AcApPdfImportConvertor';
|
|
12
12
|
export type { AcApPdfPluginOptions } from './AcApPdfPlugin';
|
|
13
13
|
export { AcApPdfPlugin } from './AcApPdfPlugin';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,2BAA2B,EAC5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,2BAA2B,EAC5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAKL,2BAA2B,EAC5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlightcad/cad-pdf-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-preview.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -37,19 +37,21 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@mlightcad/data-model": "1.15.
|
|
40
|
+
"@mlightcad/data-model": "1.15.22",
|
|
41
41
|
"@mlightcad/mtext-parser": "1.5.7",
|
|
42
42
|
"pdfjs-dist": "^5.6.205",
|
|
43
|
-
"@mlightcad/three-renderer": "1.
|
|
44
|
-
"@mlightcad/
|
|
45
|
-
"@mlightcad/
|
|
43
|
+
"@mlightcad/three-renderer": "1.8.0-preview.0",
|
|
44
|
+
"@mlightcad/pdf-renderer": "1.8.0-preview.0",
|
|
45
|
+
"@mlightcad/cad-simple-viewer": "1.8.0-preview.0",
|
|
46
|
+
"@mlightcad/cad-pdf-core": "1.8.0-preview.0"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
|
-
"@mlightcad/data-model": "1.15.
|
|
49
|
+
"@mlightcad/data-model": "1.15.22",
|
|
49
50
|
"@mlightcad/mtext-parser": "1.5.7",
|
|
50
|
-
"@mlightcad/cad-
|
|
51
|
-
"@mlightcad/
|
|
52
|
-
"@mlightcad/pdf-renderer": "1.
|
|
51
|
+
"@mlightcad/cad-pdf-core": "^1.8.0-preview.0",
|
|
52
|
+
"@mlightcad/cad-simple-viewer": "^1.8.0-preview.0",
|
|
53
|
+
"@mlightcad/pdf-renderer": "^1.8.0-preview.0",
|
|
54
|
+
"@mlightcad/three-renderer": "^1.8.0-preview.0"
|
|
53
55
|
},
|
|
54
56
|
"scripts": {
|
|
55
57
|
"clean": "rimraf dist lib tsconfig.tsbuildinfo",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { AcPdfGlyphProvider } from '@mlightcad/pdf-renderer';
|
|
2
|
-
/**
|
|
3
|
-
* Turns the viewer's already-initialized mtext renderer into PDF glyph
|
|
4
|
-
* geometry so TEXT/MTEXT are not dropped during export.
|
|
5
|
-
*
|
|
6
|
-
* Geometry is emitted as flat float32 buffers relative to the text's own
|
|
7
|
-
* insertion point. Large drawings carry tens of thousands of MTEXT instances;
|
|
8
|
-
* the previous per-triangle object graphs (`{x, y}` points inside
|
|
9
|
-
* per-primitive arrays) retained ~25 objects per triangle in the renderer's
|
|
10
|
-
* glyph cache and exhausted the tab's heap. Buffers are shared by reference
|
|
11
|
-
* across identical texts, so a drawing's unique text content costs ~24 bytes
|
|
12
|
-
* per triangle.
|
|
13
|
-
*/
|
|
14
|
-
export declare function createViewerPdfGlyphProvider(): AcPdfGlyphProvider;
|
|
15
|
-
//# sourceMappingURL=AcApPdfGlyphProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AcApPdfGlyphProvider.d.ts","sourceRoot":"","sources":["../src/AcApPdfGlyphProvider.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAKV,kBAAkB,EACnB,MAAM,yBAAyB,CAAA;AA+BhC;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,IAAI,kBAAkB,CAqEjE"}
|