ducpdf 3.5.3 → 3.5.5

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/dist/duc2pdf.d.ts CHANGED
@@ -1,23 +1,23 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function init_logger(): void;
4
3
  /**
5
- * WASM binding for crop conversion
4
+ * WASM binding for the main conversion function
6
5
  */
7
- 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;
6
+ export function convert_duc_to_pdf_rs(duc_data: Uint8Array): Uint8Array;
8
7
  /**
9
8
  * WASM binding for conversion with custom font data
10
9
  * font_map_js: a JS Map<string, Uint8Array> mapping font family names to TTF/OTF bytes
11
10
  */
12
11
  export function convert_duc_to_pdf_with_fonts_rs(duc_data: Uint8Array, font_map_js: any): Uint8Array;
13
12
  /**
14
- * WASM binding for the main conversion function
13
+ * WASM binding for crop conversion
15
14
  */
16
- export function convert_duc_to_pdf_rs(duc_data: Uint8Array): Uint8Array;
15
+ 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;
17
16
  /**
18
17
  * WASM binding for crop conversion with custom font data
19
18
  */
20
19
  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;
20
+ export function init_logger(): void;
21
21
 
22
22
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
23
23
 
package/dist/duc2pdf.js CHANGED
@@ -117,10 +117,6 @@ function getStringFromWasm0(ptr, len) {
117
117
  return decodeText(ptr, len);
118
118
  }
119
119
 
120
- export function init_logger() {
121
- wasm.init_logger();
122
- }
123
-
124
120
  function passArray8ToWasm0(arg, malloc) {
125
121
  const ptr = malloc(arg.length * 1, 1) >>> 0;
126
122
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -128,24 +124,17 @@ function passArray8ToWasm0(arg, malloc) {
128
124
  return ptr;
129
125
  }
130
126
  /**
131
- * WASM binding for crop conversion
127
+ * WASM binding for the main conversion function
132
128
  * @param {Uint8Array} duc_data
133
- * @param {number} offset_x
134
- * @param {number} offset_y
135
- * @param {number | null} [width]
136
- * @param {number | null} [height]
137
- * @param {string | null} [background_color]
138
129
  * @returns {Uint8Array}
139
130
  */
140
- export function convert_duc_to_pdf_crop_wasm(duc_data, offset_x, offset_y, width, height, background_color) {
131
+ export function convert_duc_to_pdf_rs(duc_data) {
141
132
  const ptr0 = passArray8ToWasm0(duc_data, wasm.__wbindgen_malloc);
142
133
  const len0 = WASM_VECTOR_LEN;
143
- var ptr1 = isLikeNone(background_color) ? 0 : passStringToWasm0(background_color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
144
- var len1 = WASM_VECTOR_LEN;
145
- 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);
146
- var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
134
+ const ret = wasm.convert_duc_to_pdf_rs(ptr0, len0);
135
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
147
136
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
148
- return v3;
137
+ return v2;
149
138
  }
150
139
 
151
140
  /**
@@ -165,17 +154,24 @@ export function convert_duc_to_pdf_with_fonts_rs(duc_data, font_map_js) {
165
154
  }
166
155
 
167
156
  /**
168
- * WASM binding for the main conversion function
157
+ * WASM binding for crop conversion
169
158
  * @param {Uint8Array} duc_data
159
+ * @param {number} offset_x
160
+ * @param {number} offset_y
161
+ * @param {number | null} [width]
162
+ * @param {number | null} [height]
163
+ * @param {string | null} [background_color]
170
164
  * @returns {Uint8Array}
171
165
  */
172
- export function convert_duc_to_pdf_rs(duc_data) {
166
+ export function convert_duc_to_pdf_crop_wasm(duc_data, offset_x, offset_y, width, height, background_color) {
173
167
  const ptr0 = passArray8ToWasm0(duc_data, wasm.__wbindgen_malloc);
174
168
  const len0 = WASM_VECTOR_LEN;
175
- const ret = wasm.convert_duc_to_pdf_rs(ptr0, len0);
176
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
169
+ var ptr1 = isLikeNone(background_color) ? 0 : passStringToWasm0(background_color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
170
+ var len1 = WASM_VECTOR_LEN;
171
+ 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);
172
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
177
173
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
178
- return v2;
174
+ return v3;
179
175
  }
180
176
 
181
177
  /**
@@ -200,6 +196,10 @@ export function convert_duc_to_pdf_crop_with_fonts_wasm(duc_data, offset_x, offs
200
196
  return v3;
201
197
  }
202
198
 
199
+ export function init_logger() {
200
+ wasm.init_logger();
201
+ }
202
+
203
203
  const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
204
204
 
205
205
  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.5.3",
3
+ "version": "3.5.5",
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.0.3"
51
+ "ducjs": "^3.0.5"
52
52
  },
53
53
  "devDependencies": {
54
54
  "typescript": "^5.4.5",