ducpdf 3.6.0 → 3.7.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <p align="center">
4
4
  <br/>
5
- <a href="https://duc.ducflair.com" target="_blank"><img width="256px" src="https://raw.githubusercontent.com/ducflair/assets/refs/heads/main/src/duc/duc-extended.png" /></a>
5
+ <a href="https://duc.ducflair.com" target="_blank"><img width="256px" src="https://cdn.jsdelivr.net/gh/ducflair/assets@main/src/duc/duc-extended.png" /></a>
6
6
  <p align="center">PDF Adapter for the duc 2D CAD File Format</p>
7
7
  <p align="center" style="align: center;">
8
8
  <a href="https://www.npmjs.com/package/ducpdf"><img src="https://shields.io/badge/NPM-cc3534?logo=Npm&logoColor=white&style=round-square" alt="NPM" /></a>
package/dist/duc2pdf.d.ts CHANGED
@@ -1,26 +1,30 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * WASM binding for the main conversion function
5
- */
6
- export function convert_duc_to_pdf_rs(duc_data: Uint8Array): Uint8Array;
7
- /**
8
- * WASM binding for standard conversion with fonts and an explicit manual drawing scale.
4
+ * WASM binding for crop conversion
9
5
  */
10
- export function convert_duc_to_pdf_with_fonts_scaled_wasm(duc_data: Uint8Array, scale: number, font_map_js: any): Uint8Array;
6
+ export function convert_duc_to_pdf_crop_wasm(duc_data: Uint8Array, offset_x: number, offset_y: number, width?: number | null, height?: number | null, background_color?: string | null): Uint8Array;
11
7
  /**
12
8
  * WASM binding for crop conversion with custom font data
13
9
  */
14
10
  export function convert_duc_to_pdf_crop_with_fonts_wasm(duc_data: Uint8Array, offset_x: number, offset_y: number, width: number | null | undefined, height: number | null | undefined, background_color: string | null | undefined, font_map_js: any): Uint8Array;
11
+ export function init_logger(): void;
15
12
  /**
16
- * WASM binding for crop conversion
13
+ * WASM binding for standard conversion with fonts and an explicit manual drawing scale.
17
14
  */
18
- export function convert_duc_to_pdf_crop_wasm(duc_data: Uint8Array, offset_x: number, offset_y: number, width?: number | null, height?: number | null, background_color?: string | null): Uint8Array;
19
- export function init_logger(): void;
15
+ export function convert_duc_to_pdf_with_fonts_scaled_wasm(duc_data: Uint8Array, scale: number, font_map_js: any): Uint8Array;
20
16
  /**
21
17
  * WASM binding for crop conversion with explicit manual drawing scale.
22
18
  */
23
19
  export function convert_duc_to_pdf_crop_scaled_wasm(duc_data: Uint8Array, offset_x: number, offset_y: number, width: number | null | undefined, height: number | null | undefined, background_color: string | null | undefined, scale: number): Uint8Array;
20
+ /**
21
+ * WASM binding for the main conversion function
22
+ */
23
+ export function convert_duc_to_pdf_rs(duc_data: Uint8Array): Uint8Array;
24
+ /**
25
+ * WASM binding for standard conversion with an explicit manual drawing scale.
26
+ */
27
+ export function convert_duc_to_pdf_with_scale_wasm(duc_data: Uint8Array, scale: number): Uint8Array;
24
28
  /**
25
29
  * WASM binding for conversion with custom font data
26
30
  * font_map_js: a JS Map<string, Uint8Array> mapping font family names to TTF/OTF bytes
@@ -30,10 +34,6 @@ export function convert_duc_to_pdf_with_fonts_rs(duc_data: Uint8Array, font_map_
30
34
  * WASM binding for crop conversion with fonts and explicit manual drawing scale.
31
35
  */
32
36
  export function convert_duc_to_pdf_crop_with_fonts_scaled_wasm(duc_data: Uint8Array, offset_x: number, offset_y: number, width: number | null | undefined, height: number | null | undefined, background_color: string | null | undefined, scale: number, font_map_js: any): Uint8Array;
33
- /**
34
- * WASM binding for standard conversion with an explicit manual drawing scale.
35
- */
36
- export function convert_duc_to_pdf_with_scale_wasm(duc_data: Uint8Array, scale: number): Uint8Array;
37
37
 
38
38
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
39
39
 
package/dist/duc2pdf.js CHANGED
@@ -124,33 +124,24 @@ function passArray8ToWasm0(arg, malloc) {
124
124
  return ptr;
125
125
  }
126
126
  /**
127
- * WASM binding for the main conversion function
128
- * @param {Uint8Array} duc_data
129
- * @returns {Uint8Array}
130
- */
131
- export function convert_duc_to_pdf_rs(duc_data) {
132
- const ptr0 = passArray8ToWasm0(duc_data, wasm.__wbindgen_malloc);
133
- const len0 = WASM_VECTOR_LEN;
134
- const ret = wasm.convert_duc_to_pdf_rs(ptr0, len0);
135
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
136
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
137
- return v2;
138
- }
139
-
140
- /**
141
- * WASM binding for standard conversion with fonts and an explicit manual drawing scale.
127
+ * WASM binding for crop conversion
142
128
  * @param {Uint8Array} duc_data
143
- * @param {number} scale
144
- * @param {any} font_map_js
129
+ * @param {number} offset_x
130
+ * @param {number} offset_y
131
+ * @param {number | null} [width]
132
+ * @param {number | null} [height]
133
+ * @param {string | null} [background_color]
145
134
  * @returns {Uint8Array}
146
135
  */
147
- export function convert_duc_to_pdf_with_fonts_scaled_wasm(duc_data, scale, font_map_js) {
136
+ export function convert_duc_to_pdf_crop_wasm(duc_data, offset_x, offset_y, width, height, background_color) {
148
137
  const ptr0 = passArray8ToWasm0(duc_data, wasm.__wbindgen_malloc);
149
138
  const len0 = WASM_VECTOR_LEN;
150
- const ret = wasm.convert_duc_to_pdf_with_fonts_scaled_wasm(ptr0, len0, scale, font_map_js);
151
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
139
+ var ptr1 = isLikeNone(background_color) ? 0 : passStringToWasm0(background_color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
140
+ var len1 = WASM_VECTOR_LEN;
141
+ const ret = wasm.convert_duc_to_pdf_crop_wasm(ptr0, len0, offset_x, offset_y, !isLikeNone(width), isLikeNone(width) ? 0 : width, !isLikeNone(height), isLikeNone(height) ? 0 : height, ptr1, len1);
142
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
152
143
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
153
- return v2;
144
+ return v3;
154
145
  }
155
146
 
156
147
  /**
@@ -175,29 +166,24 @@ export function convert_duc_to_pdf_crop_with_fonts_wasm(duc_data, offset_x, offs
175
166
  return v3;
176
167
  }
177
168
 
169
+ export function init_logger() {
170
+ wasm.init_logger();
171
+ }
172
+
178
173
  /**
179
- * WASM binding for crop conversion
174
+ * WASM binding for standard conversion with fonts and an explicit manual drawing scale.
180
175
  * @param {Uint8Array} duc_data
181
- * @param {number} offset_x
182
- * @param {number} offset_y
183
- * @param {number | null} [width]
184
- * @param {number | null} [height]
185
- * @param {string | null} [background_color]
176
+ * @param {number} scale
177
+ * @param {any} font_map_js
186
178
  * @returns {Uint8Array}
187
179
  */
188
- export function convert_duc_to_pdf_crop_wasm(duc_data, offset_x, offset_y, width, height, background_color) {
180
+ export function convert_duc_to_pdf_with_fonts_scaled_wasm(duc_data, scale, font_map_js) {
189
181
  const ptr0 = passArray8ToWasm0(duc_data, wasm.__wbindgen_malloc);
190
182
  const len0 = WASM_VECTOR_LEN;
191
- var ptr1 = isLikeNone(background_color) ? 0 : passStringToWasm0(background_color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
192
- var len1 = WASM_VECTOR_LEN;
193
- const ret = wasm.convert_duc_to_pdf_crop_wasm(ptr0, len0, offset_x, offset_y, !isLikeNone(width), isLikeNone(width) ? 0 : width, !isLikeNone(height), isLikeNone(height) ? 0 : height, ptr1, len1);
194
- var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
183
+ const ret = wasm.convert_duc_to_pdf_with_fonts_scaled_wasm(ptr0, len0, scale, font_map_js);
184
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
195
185
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
196
- return v3;
197
- }
198
-
199
- export function init_logger() {
200
- wasm.init_logger();
186
+ return v2;
201
187
  }
202
188
 
203
189
  /**
@@ -222,6 +208,35 @@ export function convert_duc_to_pdf_crop_scaled_wasm(duc_data, offset_x, offset_y
222
208
  return v3;
223
209
  }
224
210
 
211
+ /**
212
+ * WASM binding for the main conversion function
213
+ * @param {Uint8Array} duc_data
214
+ * @returns {Uint8Array}
215
+ */
216
+ export function convert_duc_to_pdf_rs(duc_data) {
217
+ const ptr0 = passArray8ToWasm0(duc_data, wasm.__wbindgen_malloc);
218
+ const len0 = WASM_VECTOR_LEN;
219
+ const ret = wasm.convert_duc_to_pdf_rs(ptr0, len0);
220
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
221
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
222
+ return v2;
223
+ }
224
+
225
+ /**
226
+ * WASM binding for standard conversion with an explicit manual drawing scale.
227
+ * @param {Uint8Array} duc_data
228
+ * @param {number} scale
229
+ * @returns {Uint8Array}
230
+ */
231
+ export function convert_duc_to_pdf_with_scale_wasm(duc_data, scale) {
232
+ const ptr0 = passArray8ToWasm0(duc_data, wasm.__wbindgen_malloc);
233
+ const len0 = WASM_VECTOR_LEN;
234
+ const ret = wasm.convert_duc_to_pdf_with_scale_wasm(ptr0, len0, scale);
235
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
236
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
237
+ return v2;
238
+ }
239
+
225
240
  /**
226
241
  * WASM binding for conversion with custom font data
227
242
  * font_map_js: a JS Map<string, Uint8Array> mapping font family names to TTF/OTF bytes
@@ -261,21 +276,6 @@ export function convert_duc_to_pdf_crop_with_fonts_scaled_wasm(duc_data, offset_
261
276
  return v3;
262
277
  }
263
278
 
264
- /**
265
- * WASM binding for standard conversion with an explicit manual drawing scale.
266
- * @param {Uint8Array} duc_data
267
- * @param {number} scale
268
- * @returns {Uint8Array}
269
- */
270
- export function convert_duc_to_pdf_with_scale_wasm(duc_data, scale) {
271
- const ptr0 = passArray8ToWasm0(duc_data, wasm.__wbindgen_malloc);
272
- const len0 = WASM_VECTOR_LEN;
273
- const ret = wasm.convert_duc_to_pdf_with_scale_wasm(ptr0, len0, scale);
274
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
275
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
276
- return v2;
277
- }
278
-
279
279
  const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
280
280
 
281
281
  async function __wbg_load(module, imports) {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ducpdf",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "Library for converting between PDF and DUC formats.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -48,7 +48,7 @@
48
48
  "test:duc2pdf": "cd src/duc2pdf && cargo test"
49
49
  },
50
50
  "dependencies": {
51
- "ducjs": "^3.1.0"
51
+ "ducjs": "^3.2.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "typescript": "^5.4.5",