@libpdf/core 0.2.1 → 0.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A modern PDF library for TypeScript. Parse, modify, and generate PDFs with a clean, intuitive API.
4
4
 
5
- > **Beta Software**: LibPDF is under active development. APIs may change between minor versions. Not yet recommended for production use.
5
+ > **Beta Software**: LibPDF is under active development and APIs may change between minor versions, but we use it in production at [Documenso](https://documenso.com) and consider it ready for real-world use.
6
6
 
7
7
  ## Why LibPDF?
8
8
 
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ import { createCMSECDSASignature } from "pkijs";
9
9
  import { base64 } from "@scure/base";
10
10
 
11
11
  //#region package.json
12
- var version = "0.2.1";
12
+ var version = "0.2.2";
13
13
 
14
14
  //#endregion
15
15
  //#region src/objects/pdf-array.ts
@@ -23904,7 +23904,7 @@ var PathBuilder = class {
23904
23904
  dashArray: options.dashArray,
23905
23905
  dashPhase: options.dashPhase,
23906
23906
  windingRule: options.windingRule,
23907
- graphicsStateName: gsName ?? void 0
23907
+ graphicsStateName: gsName ? `/${gsName}` : void 0
23908
23908
  });
23909
23909
  this.emitOps(ops);
23910
23910
  }
@@ -24499,7 +24499,7 @@ var PDFPage = class PDFPage {
24499
24499
  dashArray: options.borderDashArray,
24500
24500
  dashPhase: options.borderDashPhase,
24501
24501
  cornerRadius: options.cornerRadius,
24502
- graphicsStateName: gsName ?? void 0,
24502
+ graphicsStateName: gsName ? `/${gsName}` : void 0,
24503
24503
  rotate
24504
24504
  });
24505
24505
  this.appendOperators(ops);
@@ -24538,7 +24538,7 @@ var PDFPage = class PDFPage {
24538
24538
  dashArray: options.dashArray,
24539
24539
  dashPhase: options.dashPhase,
24540
24540
  lineCap: options.lineCap,
24541
- graphicsStateName: gsName ?? void 0
24541
+ graphicsStateName: gsName ? `/${gsName}` : void 0
24542
24542
  });
24543
24543
  this.appendOperators(ops);
24544
24544
  }
@@ -24566,7 +24566,7 @@ var PDFPage = class PDFPage {
24566
24566
  fillColor: options.color,
24567
24567
  strokeColor: options.borderColor,
24568
24568
  strokeWidth: options.borderWidth,
24569
- graphicsStateName: gsName ?? void 0
24569
+ graphicsStateName: gsName ? `/${gsName}` : void 0
24570
24570
  });
24571
24571
  this.appendOperators(ops);
24572
24572
  }
@@ -24613,7 +24613,7 @@ var PDFPage = class PDFPage {
24613
24613
  fillColor: options.color,
24614
24614
  strokeColor: options.borderColor,
24615
24615
  strokeWidth: options.borderWidth,
24616
- graphicsStateName: gsName ?? void 0,
24616
+ graphicsStateName: gsName ? `/${gsName}` : void 0,
24617
24617
  rotate
24618
24618
  });
24619
24619
  this.appendOperators(ops);
@@ -24670,7 +24670,7 @@ var PDFPage = class PDFPage {
24670
24670
  width: measureText(line, font, fontSize)
24671
24671
  }));
24672
24672
  const ops = [pushGraphicsState()];
24673
- if (gsName) ops.push(setGraphicsState(gsName));
24673
+ if (gsName) ops.push(setGraphicsState(`/${gsName}`));
24674
24674
  if (options.rotate) {
24675
24675
  const textWidth = options.maxWidth ?? Math.max(...lines.map((l) => l.width));
24676
24676
  let ascent;
@@ -25447,8 +25447,8 @@ var PDFPage = class PDFPage {
25447
25447
  registerGraphicsStateForOpacity(fillOpacity, strokeOpacity) {
25448
25448
  if (fillOpacity === void 0 && strokeOpacity === void 0) return null;
25449
25449
  const params = {};
25450
- if (fillOpacity !== void 0) params.CA = Math.max(0, Math.min(1, fillOpacity));
25451
- if (strokeOpacity !== void 0) params.ca = Math.max(0, Math.min(1, strokeOpacity));
25450
+ if (fillOpacity !== void 0) params.ca = Math.max(0, Math.min(1, fillOpacity));
25451
+ if (strokeOpacity !== void 0) params.CA = Math.max(0, Math.min(1, strokeOpacity));
25452
25452
  return this.addGraphicsState(params);
25453
25453
  }
25454
25454
  /**