@clazic/kordoc 2.2.1 → 2.2.2

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/index.js CHANGED
@@ -2338,13 +2338,7 @@ async function ocrPages(doc, provider, pageFilter, effectivePageCount, warnings)
2338
2338
  return blocks;
2339
2339
  }
2340
2340
  async function renderPageToPng(page) {
2341
- let createCanvas;
2342
- try {
2343
- const canvasModule = await import("canvas");
2344
- createCanvas = canvasModule.createCanvas;
2345
- } catch {
2346
- throw new Error("OCR\uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 'canvas' \uD328\uD0A4\uC9C0\uB97C \uC124\uCE58\uD558\uC138\uC694: npm install canvas");
2347
- }
2341
+ const { createCanvas } = await import("@napi-rs/canvas");
2348
2342
  const scale = 2;
2349
2343
  const viewport = page.getViewport({ scale });
2350
2344
  const canvas = createCanvas(Math.floor(viewport.width), Math.floor(viewport.height));
@@ -2408,7 +2402,7 @@ import JSZip2 from "jszip";
2408
2402
  import { DOMParser } from "@xmldom/xmldom";
2409
2403
 
2410
2404
  // src/utils.ts
2411
- var VERSION = true ? "2.2.1" : "0.0.0-dev";
2405
+ var VERSION = true ? "2.2.2" : "0.0.0-dev";
2412
2406
  function toArrayBuffer(buf) {
2413
2407
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
2414
2408
  return buf.buffer;