@chialab/pdfjs-lib 1.0.0-alpha.2 → 1.0.0-alpha.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.
@@ -24609,9 +24609,8 @@ PDFPageProxy.prototype.getAnnotations = async function(params) {
24609
24609
  height * scale,
24610
24610
  0,
24611
24611
  0,
24612
- // https://github.com/Brooooooklyn/canvas/issues/1011
24613
- isNodeJS ? viewport.width : width * scale,
24614
- isNodeJS ? viewport.height : height * scale
24612
+ width * scale,
24613
+ height * scale
24615
24614
  );
24616
24615
  annotation.graphics = await canvasToData(croppedCanvasContext.canvas);
24617
24616
  } catch (e) {
@@ -24635,7 +24634,7 @@ PDFPageProxy.prototype.getAnnotations = async function(params) {
24635
24634
  firstFill = false;
24636
24635
  continue;
24637
24636
  }
24638
- if (fn === OPS.stroke) {
24637
+ if (fn === OPS.stroke || fn === OPS.closeStroke) {
24639
24638
  if (currentLineWidth === null) {
24640
24639
  annotation.borderStyle.width = 1;
24641
24640
  }
@@ -24643,7 +24642,7 @@ PDFPageProxy.prototype.getAnnotations = async function(params) {
24643
24642
  currentLineWidth = null;
24644
24643
  continue;
24645
24644
  }
24646
- if (fn === OPS.fillStroke) {
24645
+ if (fn === OPS.fillStroke || fn === OPS.closeFillStroke) {
24647
24646
  if (currentFillColor) {
24648
24647
  annotation.interiorColor = currentFillColor;
24649
24648
  currentFillColor = null;
@@ -24663,9 +24662,6 @@ PDFPageProxy.prototype.getAnnotations = async function(params) {
24663
24662
  annotation.borderStyle.width = currentLineWidth;
24664
24663
  }
24665
24664
  if (fn === OPS.setStrokeRGBColor && firstStroke) {
24666
- if (!annotation.borderStyle.width) {
24667
- annotation.borderStyle.width = 1;
24668
- }
24669
24665
  annotation.color = args;
24670
24666
  }
24671
24667
  if (fn === OPS.setFillRGBColor && firstFill) {
@@ -24919,9 +24919,8 @@ PDFPageProxy.prototype.getAnnotations = async function(params) {
24919
24919
  height * scale,
24920
24920
  0,
24921
24921
  0,
24922
- // https://github.com/Brooooooklyn/canvas/issues/1011
24923
- isNodeJS ? viewport.width : width * scale,
24924
- isNodeJS ? viewport.height : height * scale
24922
+ width * scale,
24923
+ height * scale
24925
24924
  );
24926
24925
  annotation.graphics = await canvasToData(croppedCanvasContext.canvas);
24927
24926
  } catch (e) {
@@ -24945,7 +24944,7 @@ PDFPageProxy.prototype.getAnnotations = async function(params) {
24945
24944
  firstFill = false;
24946
24945
  continue;
24947
24946
  }
24948
- if (fn === OPS.stroke) {
24947
+ if (fn === OPS.stroke || fn === OPS.closeStroke) {
24949
24948
  if (currentLineWidth === null) {
24950
24949
  annotation.borderStyle.width = 1;
24951
24950
  }
@@ -24953,7 +24952,7 @@ PDFPageProxy.prototype.getAnnotations = async function(params) {
24953
24952
  currentLineWidth = null;
24954
24953
  continue;
24955
24954
  }
24956
- if (fn === OPS.fillStroke) {
24955
+ if (fn === OPS.fillStroke || fn === OPS.closeFillStroke) {
24957
24956
  if (currentFillColor) {
24958
24957
  annotation.interiorColor = currentFillColor;
24959
24958
  currentFillColor = null;
@@ -24973,9 +24972,6 @@ PDFPageProxy.prototype.getAnnotations = async function(params) {
24973
24972
  annotation.borderStyle.width = currentLineWidth;
24974
24973
  }
24975
24974
  if (fn === OPS.setStrokeRGBColor && firstStroke) {
24976
- if (!annotation.borderStyle.width) {
24977
- annotation.borderStyle.width = 1;
24978
- }
24979
24975
  annotation.color = args;
24980
24976
  }
24981
24977
  if (fn === OPS.setFillRGBColor && firstFill) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chialab/pdfjs-lib",
3
3
  "description": "A custom Mozilla's PDF.js build with better Node support and extras.",
4
- "version": "1.0.0-alpha.2",
4
+ "version": "1.0.0-alpha.4",
5
5
  "type": "module",
6
6
  "author": "Chialab <dev@chialab.it>",
7
7
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  }
28
28
  },
29
29
  "dependencies": {
30
- "@napi-rs/canvas": "^0.1.67"
30
+ "@napi-rs/canvas": "^0.1.68"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@biomejs/biome": "^1.9.4",
@@ -38,5 +38,6 @@
38
38
  "publint": "^0.3.7",
39
39
  "rimraf": "^6.0.1",
40
40
  "typescript": "^5.7.3"
41
- }
41
+ },
42
+ "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
42
43
  }