@mlightcad/cad-pdf-plugin 1.8.0-preview.3 → 1.8.0-preview.4
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 +280 -186
- package/dist/cad-pdf-plugin-register.js +29 -11
- package/dist/cad-pdf-plugin-register.umd.cjs +1 -1
- package/dist/cad-pdf-plugin.js +17568 -8428
- package/dist/cad-pdf-plugin.umd.cjs +847 -13
- package/lib/AcApConvertToPdfCmd.d.ts.map +1 -1
- package/lib/AcApConvertToPdfCmd.js +14 -3
- package/lib/AcApConvertToPdfCmd.js.map +1 -1
- package/lib/AcApImportPdfCmd.d.ts +5 -3
- package/lib/AcApImportPdfCmd.d.ts.map +1 -1
- package/lib/AcApImportPdfCmd.js +5 -3
- package/lib/AcApImportPdfCmd.js.map +1 -1
- package/lib/AcApImportPdfPromptCmd.d.ts +16 -0
- package/lib/AcApImportPdfPromptCmd.d.ts.map +1 -0
- package/lib/AcApImportPdfPromptCmd.js +89 -0
- package/lib/AcApImportPdfPromptCmd.js.map +1 -0
- package/lib/AcApPdfBlockCmd.d.ts +15 -0
- package/lib/AcApPdfBlockCmd.d.ts.map +1 -0
- package/lib/AcApPdfBlockCmd.js +75 -0
- package/lib/AcApPdfBlockCmd.js.map +1 -0
- package/lib/AcApPdfDimCmd.d.ts +20 -0
- package/lib/AcApPdfDimCmd.d.ts.map +1 -0
- package/lib/AcApPdfDimCmd.js +413 -0
- package/lib/AcApPdfDimCmd.js.map +1 -0
- package/lib/AcApPdfDimSession.d.ts +82 -0
- package/lib/AcApPdfDimSession.d.ts.map +1 -0
- package/lib/AcApPdfDimSession.js +252 -0
- package/lib/AcApPdfDimSession.js.map +1 -0
- package/lib/AcApPdfFontResolver.d.ts.map +1 -1
- package/lib/AcApPdfFontResolver.js +2 -5
- package/lib/AcApPdfFontResolver.js.map +1 -1
- package/lib/AcApPdfHatchCmd.d.ts +33 -0
- package/lib/AcApPdfHatchCmd.d.ts.map +1 -0
- package/lib/AcApPdfHatchCmd.js +411 -0
- package/lib/AcApPdfHatchCmd.js.map +1 -0
- package/lib/AcApPdfHatchSession.d.ts +122 -0
- package/lib/AcApPdfHatchSession.d.ts.map +1 -0
- package/lib/AcApPdfHatchSession.js +357 -0
- package/lib/AcApPdfHatchSession.js.map +1 -0
- package/lib/AcApPdfImportConvertor.d.ts +47 -5
- package/lib/AcApPdfImportConvertor.d.ts.map +1 -1
- package/lib/AcApPdfImportConvertor.js +999 -108
- package/lib/AcApPdfImportConvertor.js.map +1 -1
- package/lib/AcApPdfImportOptions.d.ts +116 -0
- package/lib/AcApPdfImportOptions.d.ts.map +1 -0
- package/lib/AcApPdfImportOptions.js +31 -0
- package/lib/AcApPdfImportOptions.js.map +1 -0
- package/lib/AcApPdfImportResources.d.ts +41 -0
- package/lib/AcApPdfImportResources.d.ts.map +1 -0
- package/lib/AcApPdfImportResources.js +52 -0
- package/lib/AcApPdfImportResources.js.map +1 -0
- package/lib/AcApPdfPlugin.d.ts +3 -3
- package/lib/AcApPdfPlugin.d.ts.map +1 -1
- package/lib/AcApPdfPlugin.js +23 -5
- package/lib/AcApPdfPlugin.js.map +1 -1
- package/lib/AcApPdfScaleCmd.d.ts +22 -0
- package/lib/AcApPdfScaleCmd.d.ts.map +1 -0
- package/lib/AcApPdfScaleCmd.js +185 -0
- package/lib/AcApPdfScaleCmd.js.map +1 -0
- package/lib/AcApPdfTextCmd.d.ts +73 -0
- package/lib/AcApPdfTextCmd.d.ts.map +1 -0
- package/lib/AcApPdfTextCmd.js +777 -0
- package/lib/AcApPdfTextCmd.js.map +1 -0
- package/lib/AcApPdfTextSession.d.ts +232 -0
- package/lib/AcApPdfTextSession.d.ts.map +1 -0
- package/lib/AcApPdfTextSession.js +826 -0
- package/lib/AcApPdfTextSession.js.map +1 -0
- package/lib/acapPdfI18n.d.ts +11 -0
- package/lib/acapPdfI18n.d.ts.map +1 -0
- package/lib/acapPdfI18n.js +57 -0
- package/lib/acapPdfI18n.js.map +1 -0
- package/lib/acapPdfPrompts.d.ts +12 -0
- package/lib/acapPdfPrompts.d.ts.map +1 -0
- package/lib/acapPdfPrompts.js +100 -0
- package/lib/acapPdfPrompts.js.map +1 -0
- package/lib/index.d.ts +28 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +28 -0
- package/lib/index.js.map +1 -1
- package/lib/pdfDeprecatedMatching.d.ts +27 -0
- package/lib/pdfDeprecatedMatching.d.ts.map +1 -0
- package/lib/pdfDeprecatedMatching.js +20 -0
- package/lib/pdfDeprecatedMatching.js.map +1 -0
- package/lib/pdfDimStrokeTexts.d.ts +55 -0
- package/lib/pdfDimStrokeTexts.d.ts.map +1 -0
- package/lib/pdfDimStrokeTexts.js +274 -0
- package/lib/pdfDimStrokeTexts.js.map +1 -0
- package/lib/pdfDimensionConvert.d.ts +80 -0
- package/lib/pdfDimensionConvert.d.ts.map +1 -0
- package/lib/pdfDimensionConvert.js +566 -0
- package/lib/pdfDimensionConvert.js.map +1 -0
- package/lib/pdfEntityStrokes.d.ts +13 -0
- package/lib/pdfEntityStrokes.d.ts.map +1 -0
- package/lib/pdfEntityStrokes.js +86 -0
- package/lib/pdfEntityStrokes.js.map +1 -0
- package/lib/pdfHatchRecover.d.ts +57 -0
- package/lib/pdfHatchRecover.d.ts.map +1 -0
- package/lib/pdfHatchRecover.js +315 -0
- package/lib/pdfHatchRecover.js.map +1 -0
- package/lib/pdfImportAppend.d.ts +24 -0
- package/lib/pdfImportAppend.d.ts.map +1 -0
- package/lib/pdfImportAppend.js +35 -0
- package/lib/pdfImportAppend.js.map +1 -0
- package/lib/pdfImportEntities.d.ts +63 -0
- package/lib/pdfImportEntities.d.ts.map +1 -0
- package/lib/pdfImportEntities.js +307 -0
- package/lib/pdfImportEntities.js.map +1 -0
- package/lib/pdfImportImages.d.ts +90 -0
- package/lib/pdfImportImages.d.ts.map +1 -0
- package/lib/pdfImportImages.js +294 -0
- package/lib/pdfImportImages.js.map +1 -0
- package/lib/pdfImportShapes.d.ts +63 -0
- package/lib/pdfImportShapes.d.ts.map +1 -0
- package/lib/pdfImportShapes.js +248 -0
- package/lib/pdfImportShapes.js.map +1 -0
- package/lib/pdfVectorImport.d.ts +218 -5
- package/lib/pdfVectorImport.d.ts.map +1 -1
- package/lib/pdfVectorImport.js +566 -98
- package/lib/pdfVectorImport.js.map +1 -1
- package/lib/recognition/pdfCurveRecognition.d.ts +91 -0
- package/lib/recognition/pdfCurveRecognition.d.ts.map +1 -0
- package/lib/recognition/pdfCurveRecognition.js +506 -0
- package/lib/recognition/pdfCurveRecognition.js.map +1 -0
- package/lib/recognition/pdfDimDigitRecognition.d.ts +18 -0
- package/lib/recognition/pdfDimDigitRecognition.d.ts.map +1 -0
- package/lib/recognition/pdfDimDigitRecognition.js +520 -0
- package/lib/recognition/pdfDimDigitRecognition.js.map +1 -0
- package/lib/recognition/pdfDimensionPattern.d.ts +173 -0
- package/lib/recognition/pdfDimensionPattern.d.ts.map +1 -0
- package/lib/recognition/pdfDimensionPattern.js +1023 -0
- package/lib/recognition/pdfDimensionPattern.js.map +1 -0
- package/lib/recognition/pdfFormBlocks.d.ts +58 -0
- package/lib/recognition/pdfFormBlocks.d.ts.map +1 -0
- package/lib/recognition/pdfFormBlocks.js +260 -0
- package/lib/recognition/pdfFormBlocks.js.map +1 -0
- package/lib/recognition/pdfGlyphClustering.d.ts +81 -0
- package/lib/recognition/pdfGlyphClustering.d.ts.map +1 -0
- package/lib/recognition/pdfGlyphClustering.js +1005 -0
- package/lib/recognition/pdfGlyphClustering.js.map +1 -0
- package/lib/recognition/pdfGlyphDictionary.d.ts +49 -0
- package/lib/recognition/pdfGlyphDictionary.d.ts.map +1 -0
- package/lib/recognition/pdfGlyphDictionary.js +188 -0
- package/lib/recognition/pdfGlyphDictionary.js.map +1 -0
- package/lib/recognition/pdfHatchFaces.d.ts +84 -0
- package/lib/recognition/pdfHatchFaces.d.ts.map +1 -0
- package/lib/recognition/pdfHatchFaces.js +1285 -0
- package/lib/recognition/pdfHatchFaces.js.map +1 -0
- package/lib/recognition/pdfHatchRecognition.d.ts +222 -0
- package/lib/recognition/pdfHatchRecognition.d.ts.map +1 -0
- package/lib/recognition/pdfHatchRecognition.js +3781 -0
- package/lib/recognition/pdfHatchRecognition.js.map +1 -0
- package/lib/recognition/pdfRecGeometry.d.ts +67 -0
- package/lib/recognition/pdfRecGeometry.d.ts.map +1 -0
- package/lib/recognition/pdfRecGeometry.js +365 -0
- package/lib/recognition/pdfRecGeometry.js.map +1 -0
- package/lib/recognition/pdfTextFontKind.d.ts +16 -0
- package/lib/recognition/pdfTextFontKind.d.ts.map +1 -0
- package/lib/recognition/pdfTextFontKind.js +51 -0
- package/lib/recognition/pdfTextFontKind.js.map +1 -0
- package/lib/recognition/pdfTextMerge.d.ts +71 -0
- package/lib/recognition/pdfTextMerge.d.ts.map +1 -0
- package/lib/recognition/pdfTextMerge.js +382 -0
- package/lib/recognition/pdfTextMerge.js.map +1 -0
- package/lib/recognition/pdfTextRunMerge.d.ts +28 -0
- package/lib/recognition/pdfTextRunMerge.d.ts.map +1 -0
- package/lib/recognition/pdfTextRunMerge.js +90 -0
- package/lib/recognition/pdfTextRunMerge.js.map +1 -0
- package/lib/register.d.ts +8 -2
- package/lib/register.d.ts.map +1 -1
- package/lib/register.js +29 -4
- package/lib/register.js.map +1 -1
- package/lib/ui/AcUiPdfDimPanel.d.ts +55 -0
- package/lib/ui/AcUiPdfDimPanel.d.ts.map +1 -0
- package/lib/ui/AcUiPdfDimPanel.js +347 -0
- package/lib/ui/AcUiPdfDimPanel.js.map +1 -0
- package/lib/ui/AcUiPdfHatchPanel.d.ts +57 -0
- package/lib/ui/AcUiPdfHatchPanel.d.ts.map +1 -0
- package/lib/ui/AcUiPdfHatchPanel.js +420 -0
- package/lib/ui/AcUiPdfHatchPanel.js.map +1 -0
- package/lib/ui/AcUiPdfImportDialog.d.ts +120 -0
- package/lib/ui/AcUiPdfImportDialog.d.ts.map +1 -0
- package/lib/ui/AcUiPdfImportDialog.js +673 -0
- package/lib/ui/AcUiPdfImportDialog.js.map +1 -0
- package/lib/ui/AcUiPdfTextPanel.d.ts +95 -0
- package/lib/ui/AcUiPdfTextPanel.d.ts.map +1 -0
- package/lib/ui/AcUiPdfTextPanel.js +775 -0
- package/lib/ui/AcUiPdfTextPanel.js.map +1 -0
- package/package.json +11 -11
|
@@ -0,0 +1,252 @@
|
|
|
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
|
+
};
|
|
12
|
+
var __values = (this && this.__values) || function(o) {
|
|
13
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
14
|
+
if (m) return m.call(o);
|
|
15
|
+
if (o && typeof o.length === "number") return {
|
|
16
|
+
next: function () {
|
|
17
|
+
if (o && i >= o.length) o = void 0;
|
|
18
|
+
return { value: o && o[i++], done: !o };
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
22
|
+
};
|
|
23
|
+
import { readDimStyleFields, writeDimStyleFields } from '@mlightcad/cad-simple-viewer';
|
|
24
|
+
import { AcDbDimStyleTableRecord } from '@mlightcad/data-model';
|
|
25
|
+
import { acapPdfDimStyleMetrics, acapPdfEnsureDimStyle, acapPdfNiceScale, PDF_DIM_STYLE } from './pdfDimensionConvert';
|
|
26
|
+
import { suggestPdfDimensionScale } from './recognition/pdfDimensionPattern';
|
|
27
|
+
export { PDF_DIM_STYLE };
|
|
28
|
+
/**
|
|
29
|
+
* State of a `pdfdim` review: recovered dimensions, editable texts, and the
|
|
30
|
+
* dim style to create them with. UI-free so the panel stays a thin view.
|
|
31
|
+
*/
|
|
32
|
+
var AcApPdfDimSession = /** @class */ (function () {
|
|
33
|
+
function AcApPdfDimSession(options) {
|
|
34
|
+
var e_1, _a;
|
|
35
|
+
var _b;
|
|
36
|
+
this.rows = [];
|
|
37
|
+
this.nextKey = 0;
|
|
38
|
+
this._isNewStyle = false;
|
|
39
|
+
this.db = options.db;
|
|
40
|
+
this._baseStyleName = options.db.dimstyle || 'Standard';
|
|
41
|
+
var preferred = (_b = options.styleName) !== null && _b !== void 0 ? _b : PDF_DIM_STYLE;
|
|
42
|
+
this._styleName = preferred;
|
|
43
|
+
this._isNewStyle = false;
|
|
44
|
+
try {
|
|
45
|
+
for (var _c = __values(options.candidates), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
46
|
+
var candidate = _d.value;
|
|
47
|
+
this.rows.push({
|
|
48
|
+
key: this.nextKey++,
|
|
49
|
+
candidate: candidate,
|
|
50
|
+
text: candidate.text.text,
|
|
51
|
+
included: true
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
56
|
+
finally {
|
|
57
|
+
try {
|
|
58
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
59
|
+
}
|
|
60
|
+
finally { if (e_1) throw e_1.error; }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
Object.defineProperty(AcApPdfDimSession.prototype, "readyRows", {
|
|
64
|
+
/** Rows created on Apply. */
|
|
65
|
+
get: function () {
|
|
66
|
+
return this.rows.filter(function (row) { return row.included && row.text.trim().length > 0; });
|
|
67
|
+
},
|
|
68
|
+
enumerable: false,
|
|
69
|
+
configurable: true
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(AcApPdfDimSession.prototype, "styleName", {
|
|
72
|
+
get: function () {
|
|
73
|
+
return this._styleName;
|
|
74
|
+
},
|
|
75
|
+
enumerable: false,
|
|
76
|
+
configurable: true
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(AcApPdfDimSession.prototype, "isNewStyle", {
|
|
79
|
+
get: function () {
|
|
80
|
+
return this._isNewStyle;
|
|
81
|
+
},
|
|
82
|
+
enumerable: false,
|
|
83
|
+
configurable: true
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(AcApPdfDimSession.prototype, "scale", {
|
|
86
|
+
/** Drawing scale implied by the included rows' texts. */
|
|
87
|
+
get: function () {
|
|
88
|
+
var _a;
|
|
89
|
+
var dims = this.readyRows.map(function (row) { return (__assign(__assign({}, row.candidate), { text: __assign(__assign({}, row.candidate.text), { text: row.text }) })); });
|
|
90
|
+
return acapPdfNiceScale((_a = suggestPdfDimensionScale(dims)) !== null && _a !== void 0 ? _a : 1);
|
|
91
|
+
},
|
|
92
|
+
enumerable: false,
|
|
93
|
+
configurable: true
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(AcApPdfDimSession.prototype, "workingStyleName", {
|
|
96
|
+
/**
|
|
97
|
+
* Style name written on created dimensions (preview and Apply). Recovered
|
|
98
|
+
* paper sizes are pinned via entity overrides, so picking an existing style
|
|
99
|
+
* does not rewrite that style's table record.
|
|
100
|
+
*/
|
|
101
|
+
get: function () {
|
|
102
|
+
return this._styleName.trim() || PDF_DIM_STYLE;
|
|
103
|
+
},
|
|
104
|
+
enumerable: false,
|
|
105
|
+
configurable: true
|
|
106
|
+
});
|
|
107
|
+
Object.defineProperty(AcApPdfDimSession.prototype, "appearanceFromStyle", {
|
|
108
|
+
/**
|
|
109
|
+
* Style whose appearance is blended while baking dim blocks when the working
|
|
110
|
+
* style is not in the table yet (a newly named style before Apply). Existing
|
|
111
|
+
* picks use the style itself — no separate blend source.
|
|
112
|
+
*/
|
|
113
|
+
get: function () {
|
|
114
|
+
var working = this.workingStyleName;
|
|
115
|
+
if (this.db.tables.dimStyleTable.getAt(working))
|
|
116
|
+
return undefined;
|
|
117
|
+
return this._baseStyleName;
|
|
118
|
+
},
|
|
119
|
+
enumerable: false,
|
|
120
|
+
configurable: true
|
|
121
|
+
});
|
|
122
|
+
/** Existing dim style names (skip anonymous `*…` records). */
|
|
123
|
+
AcApPdfDimSession.prototype.styleNames = function () {
|
|
124
|
+
var e_2, _a;
|
|
125
|
+
var names = [];
|
|
126
|
+
try {
|
|
127
|
+
for (var _b = __values(this.db.tables.dimStyleTable.newIterator()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
128
|
+
var record = _c.value;
|
|
129
|
+
if (record.name && !record.name.startsWith('*'))
|
|
130
|
+
names.push(record.name);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
134
|
+
finally {
|
|
135
|
+
try {
|
|
136
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
137
|
+
}
|
|
138
|
+
finally { if (e_2) throw e_2.error; }
|
|
139
|
+
}
|
|
140
|
+
if (this._styleName && !names.includes(this._styleName)) {
|
|
141
|
+
names.push(this._styleName);
|
|
142
|
+
}
|
|
143
|
+
return names.sort(function (a, b) { return a.localeCompare(b); });
|
|
144
|
+
};
|
|
145
|
+
AcApPdfDimSession.prototype.setIncluded = function (row, included) {
|
|
146
|
+
row.included = included;
|
|
147
|
+
};
|
|
148
|
+
AcApPdfDimSession.prototype.setText = function (row, text) {
|
|
149
|
+
row.text = text;
|
|
150
|
+
};
|
|
151
|
+
/** Selects an existing dim style. */
|
|
152
|
+
AcApPdfDimSession.prototype.selectStyle = function (name) {
|
|
153
|
+
this._styleName = name;
|
|
154
|
+
this._isNewStyle = false;
|
|
155
|
+
};
|
|
156
|
+
/** Starts creating a new style (name empty until {@link commitNewStyleName}). */
|
|
157
|
+
AcApPdfDimSession.prototype.beginNewStyle = function () {
|
|
158
|
+
this._isNewStyle = true;
|
|
159
|
+
this._styleName = '';
|
|
160
|
+
};
|
|
161
|
+
AcApPdfDimSession.prototype.validateNewStyleName = function (name) {
|
|
162
|
+
var trimmed = name.trim();
|
|
163
|
+
if (!trimmed)
|
|
164
|
+
return 'empty';
|
|
165
|
+
if (/[<>\\/;:"?*|=`]/.test(trimmed) || trimmed.startsWith('*')) {
|
|
166
|
+
return 'invalid';
|
|
167
|
+
}
|
|
168
|
+
if (this.styleNames().some(function (n) { return n.toLowerCase() === trimmed.toLowerCase(); })) {
|
|
169
|
+
return 'exists';
|
|
170
|
+
}
|
|
171
|
+
return undefined;
|
|
172
|
+
};
|
|
173
|
+
/** Confirms the new style name; returns an error without changing state. */
|
|
174
|
+
AcApPdfDimSession.prototype.commitNewStyleName = function (name) {
|
|
175
|
+
var error = this.validateNewStyleName(name);
|
|
176
|
+
if (error)
|
|
177
|
+
return error;
|
|
178
|
+
this._styleName = name.trim();
|
|
179
|
+
this._isNewStyle = true;
|
|
180
|
+
return undefined;
|
|
181
|
+
};
|
|
182
|
+
/** Candidates ready to convert, with the edited text applied. */
|
|
183
|
+
AcApPdfDimSession.prototype.candidatesForApply = function () {
|
|
184
|
+
return this.readyRows.map(function (row) { return (__assign(__assign({}, row.candidate), { text: __assign(__assign({}, row.candidate.text), { text: row.text.trim() }) })); });
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Style record for the palette SVG: the selected style's full appearance
|
|
188
|
+
* (arrows, colours, text placement) with only recovered paper sizes blended
|
|
189
|
+
* in. Metrics that encode recovered terminators (dimblk, dimtad, …) are not
|
|
190
|
+
* applied here — otherwise every style would look identical in the preview.
|
|
191
|
+
*/
|
|
192
|
+
AcApPdfDimSession.prototype.previewStyleRecord = function () {
|
|
193
|
+
var _a, _b;
|
|
194
|
+
var record = new AcDbDimStyleTableRecord();
|
|
195
|
+
var name = this._styleName.trim() || PDF_DIM_STYLE;
|
|
196
|
+
var appearance = (_b = (_a = this.db.tables.dimStyleTable.getAt(name)) !== null && _a !== void 0 ? _a : this.db.tables.dimStyleTable.getAt(this._baseStyleName)) !== null && _b !== void 0 ? _b : this.db.tables.dimStyleTable.getAt('Standard');
|
|
197
|
+
if (appearance)
|
|
198
|
+
writeDimStyleFields(record, readDimStyleFields(appearance));
|
|
199
|
+
var ready = this.candidatesForApply();
|
|
200
|
+
if (ready.length > 0) {
|
|
201
|
+
var metrics = acapPdfDimStyleMetrics(ready, this.scale);
|
|
202
|
+
writeDimStyleFields(record, {
|
|
203
|
+
dimscale: metrics.dimscale,
|
|
204
|
+
dimtxt: metrics.dimtxt,
|
|
205
|
+
dimasz: metrics.dimasz,
|
|
206
|
+
dimgap: metrics.dimgap,
|
|
207
|
+
dimexo: metrics.dimexo,
|
|
208
|
+
dimexe: metrics.dimexe,
|
|
209
|
+
dimlfac: metrics.dimlfac,
|
|
210
|
+
dimdec: metrics.dimdec
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
record.name = name;
|
|
214
|
+
return record;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Ensures the working dim style exists when it is {@link PDF_DIM_STYLE} or a
|
|
218
|
+
* newly created name (recovered sizes written into that record). An existing
|
|
219
|
+
* style the user picked is left untouched — sizes go on entity overrides.
|
|
220
|
+
* Returns the style name to assign on new dimensions.
|
|
221
|
+
*/
|
|
222
|
+
AcApPdfDimSession.prototype.ensureStyle = function () {
|
|
223
|
+
var candidates = this.candidatesForApply();
|
|
224
|
+
var working = this.workingStyleName;
|
|
225
|
+
if (candidates.length === 0)
|
|
226
|
+
return working;
|
|
227
|
+
var existing = this.db.tables.dimStyleTable.getAt(working);
|
|
228
|
+
// Existing user styles stay as-is; only PDF_DIM / brand-new get metrics.
|
|
229
|
+
if (existing && !this._isNewStyle && working !== PDF_DIM_STYLE) {
|
|
230
|
+
return working;
|
|
231
|
+
}
|
|
232
|
+
if (!existing)
|
|
233
|
+
this.createStyleFromBase(working);
|
|
234
|
+
acapPdfEnsureDimStyle(this.db, candidates, this.scale, working, this._baseStyleName);
|
|
235
|
+
this._isNewStyle = false;
|
|
236
|
+
this._styleName = working;
|
|
237
|
+
return working;
|
|
238
|
+
};
|
|
239
|
+
AcApPdfDimSession.prototype.createStyleFromBase = function (name) {
|
|
240
|
+
var _a, _b;
|
|
241
|
+
var table = this.db.tables.dimStyleTable;
|
|
242
|
+
var style = new AcDbDimStyleTableRecord();
|
|
243
|
+
style.name = name;
|
|
244
|
+
var base = (_b = (_a = table.getAt(this._baseStyleName)) !== null && _a !== void 0 ? _a : table.getAt('Standard')) !== null && _b !== void 0 ? _b : undefined;
|
|
245
|
+
if (base)
|
|
246
|
+
writeDimStyleFields(style, readDimStyleFields(base));
|
|
247
|
+
table.add(style);
|
|
248
|
+
};
|
|
249
|
+
return AcApPdfDimSession;
|
|
250
|
+
}());
|
|
251
|
+
export { AcApPdfDimSession };
|
|
252
|
+
//# sourceMappingURL=AcApPdfDimSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApPdfDimSession.js","sourceRoot":"","sources":["../src/AcApPdfDimSession.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAEL,uBAAuB,EACxB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAEL,wBAAwB,EACzB,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,CAAA;AAuBxB;;;GAGG;AACH;IAQE,2BAAY,OAAmC;;;QAPtC,SAAI,GAAoB,EAAE,CAAA;QAE3B,YAAO,GAAG,CAAC,CAAA;QAEX,gBAAW,GAAG,KAAK,CAAA;QAIzB,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAA;QACpB,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,EAAE,CAAC,QAAQ,IAAI,UAAU,CAAA;QACvD,IAAM,SAAS,GAA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UAAU,CAAC,mCAAI,SAAS,CAAA;QAC1E,IAAI,IAAI;YAAE,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAA;QAC9D,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAClB,CAAC;IACH,wBAAC;AAAD,CAAC,AAtMD,IAsMC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApPdfFontResolver.d.ts","sourceRoot":"","sources":["../src/AcApPdfFontResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"AcApPdfFontResolver.d.ts","sourceRoot":"","sources":["../src/AcApPdfFontResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,EAAE,qBAuCnC,CAAA"}
|
|
@@ -87,11 +87,8 @@ export var resolveViewerTextFont = function (fontName) { return __awaiter(void 0
|
|
|
87
87
|
case 0:
|
|
88
88
|
info = findEmbeddableInfo(fontName);
|
|
89
89
|
if (!info || info.type !== 'mesh' || !info.url) {
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
console.warn("[cad-pdf-plugin] No embeddable font for \"".concat(fontName, "\" ") +
|
|
93
|
-
"(catalog=".concat(info ? info.type : 'miss', ", url=").concat((info === null || info === void 0 ? void 0 : info.url) ? 'yes' : 'no', "); ") +
|
|
94
|
-
'texts using it are painted as vector glyphs');
|
|
90
|
+
// SHX / catalog misses intentionally fall back to vector glyphs — that is
|
|
91
|
+
// expected, not a warning. Keep quiet so exports do not spam the console.
|
|
95
92
|
return [2 /*return*/, undefined];
|
|
96
93
|
}
|
|
97
94
|
return [4 /*yield*/, AcApFontUtil.getCachedMeshFontProgram(fontName)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApPdfFontResolver.js","sourceRoot":"","sources":["../src/AcApPdfFontResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAG3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,IAAM,qBAAqB,GAA0B,UAAM,QAAQ;;;;;;gBAClE,IAAI,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;gBACzC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;oBAC/C,
|
|
1
|
+
{"version":3,"file":"AcApPdfFontResolver.js","sourceRoot":"","sources":["../src/AcApPdfFontResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAG3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,IAAM,qBAAqB,GAA0B,UAAM,QAAQ;;;;;;gBAClE,IAAI,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;gBACzC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;oBAC/C,0EAA0E;oBAC1E,0EAA0E;oBAC1E,sBAAO,SAAS,EAAA;gBAClB,CAAC;gBAEc,qBAAM,YAAY,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAA;;gBAA9D,MAAM,GAAG,SAAqD;gBACpE,IAAI,MAAM,IAAI,MAAM,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;o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AC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IACxD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,MAAM,CAAA;IACf,CAAC;IACD,IAAM,WAAW,GAAG,YAAY,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAA;IACjE,OAAO,WAAW,IAAI,WAAW,KAAK,QAAQ;QAC5C,CAAC,CAAC,YAAY,CAAC,kBAAkB,CAAC,WAAW,CAAC;QAC9C,CAAC,CAAC,SAAS,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type AcApContext, AcEdCommand } from '@mlightcad/cad-simple-viewer';
|
|
2
|
+
/**
|
|
3
|
+
* `pdfhatch`: turns the loose strokes a PDF made of a pattern hatch back
|
|
4
|
+
* into hatch objects.
|
|
5
|
+
*
|
|
6
|
+
* 1. Select the strokes together with the lines around them (a crossing
|
|
7
|
+
* window over the hatched area is enough).
|
|
8
|
+
* 2. Strokes that form a regular pattern are matched against `acadiso.pat`,
|
|
9
|
+
* a user-defined single or crossed pattern, or else measured as a custom
|
|
10
|
+
* pattern. The boundary comes from closed shapes in the selection or the
|
|
11
|
+
* faces the selected line work encloses.
|
|
12
|
+
* 3. A review panel opens in the palette with the hatches previewed in
|
|
13
|
+
* place of their strokes. Per hatch the user includes or skips it,
|
|
14
|
+
* changes its pattern, scale and angle (each change is refitted to the
|
|
15
|
+
* strokes and scored), and areas the recognition missed are added by
|
|
16
|
+
* picking a point inside them. Apply converts in one step; Cancel, or
|
|
17
|
+
* closing the palette, changes nothing. Without a DOM, every hatch found
|
|
18
|
+
* is converted directly.
|
|
19
|
+
*
|
|
20
|
+
* A hatch only replaces the entities it re-draws completely.
|
|
21
|
+
*/
|
|
22
|
+
export declare class AcApPdfHatchCmd extends AcEdCommand {
|
|
23
|
+
constructor();
|
|
24
|
+
execute(context: AcApContext): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Shows the review panel in the palette and previews the hatches in the
|
|
27
|
+
* drawing until the user applies or cancels.
|
|
28
|
+
*
|
|
29
|
+
* @returns Whether the user applied.
|
|
30
|
+
*/
|
|
31
|
+
private review;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=AcApPdfHatchCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApPdfHatchCmd.d.ts","sourceRoot":"","sources":["../src/AcApPdfHatchCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAKhB,WAAW,EAKZ,MAAM,8BAA8B,CAAA;AA6BrC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,eAAgB,SAAQ,WAAW;;IAMxC,OAAO,CAAC,OAAO,EAAE,WAAW;IAwDlC;;;;;OAKG;YACW,MAAM;CAgIrB"}
|