muhammara 4.1.0 → 5.0.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/README.md +10 -4
  3. package/binding.gyp +4 -4
  4. package/lib/PDFRStreamForBuffer.js +1 -1
  5. package/lib/PDFRStreamForFile.js +1 -1
  6. package/lib/PDFStreamForResponse.js +1 -1
  7. package/lib/PDFWStreamForFile.js +1 -1
  8. package/lib/Recipe.js +7 -7
  9. package/lib/muhammara.js +2 -2
  10. package/lib/recipe/annotation.js +3 -3
  11. package/lib/recipe/colors.js +1 -1
  12. package/lib/recipe/coordinate.js +5 -5
  13. package/lib/recipe/encrypt.js +1 -1
  14. package/lib/recipe/font.js +6 -6
  15. package/lib/recipe/htmlToTextObjects.js +1 -1
  16. package/lib/recipe/image.js +1 -1
  17. package/lib/recipe/info.js +5 -5
  18. package/lib/recipe/insertPage.js +2 -2
  19. package/lib/recipe/page.js +7 -7
  20. package/lib/recipe/shapes.js +14 -14
  21. package/lib/recipe/split.js +1 -1
  22. package/lib/recipe/table.js +5 -5
  23. package/lib/recipe/text.helper.js +3 -3
  24. package/lib/recipe/text.js +26 -27
  25. package/lib/recipe/utils.js +3 -3
  26. package/lib/recipe/vector-polygon.js +2 -2
  27. package/lib/recipe/vector.helper.js +6 -6
  28. package/lib/recipe/vector.js +17 -17
  29. package/muhammara.d.ts +49 -46
  30. package/node_modules/@mapbox/node-pre-gyp/package.json +5 -5
  31. package/node_modules/are-we-there-yet/package.json +1 -1
  32. package/node_modules/balanced-match/package.json +1 -1
  33. package/node_modules/brace-expansion/package.json +1 -2
  34. package/node_modules/debug/README.md +1 -1
  35. package/node_modules/debug/package.json +9 -8
  36. package/node_modules/debug/src/browser.js +3 -1
  37. package/node_modules/debug/src/node.js +2 -2
  38. package/node_modules/detect-libc/lib/detect-libc.js +3 -15
  39. package/node_modules/detect-libc/lib/process.js +8 -3
  40. package/node_modules/detect-libc/package.json +6 -6
  41. package/node_modules/gauge/package.json +1 -1
  42. package/node_modules/glob/package.json +1 -1
  43. package/node_modules/inflight/package.json +1 -1
  44. package/node_modules/ms/index.js +1 -1
  45. package/node_modules/ms/license.md +1 -1
  46. package/node_modules/ms/package.json +19 -17
  47. package/node_modules/ms/readme.md +1 -2
  48. package/node_modules/npmlog/package.json +1 -1
  49. package/node_modules/path-is-absolute/package.json +1 -2
  50. package/node_modules/rimraf/package.json +1 -1
  51. package/node_modules/semver/README.md +49 -32
  52. package/node_modules/semver/bin/semver.js +5 -14
  53. package/node_modules/semver/classes/range.js +28 -13
  54. package/node_modules/semver/classes/semver.js +1 -1
  55. package/node_modules/semver/functions/coerce.js +13 -5
  56. package/node_modules/semver/internal/lrucache.js +40 -0
  57. package/node_modules/semver/internal/re.js +7 -2
  58. package/node_modules/semver/package.json +11 -21
  59. package/node_modules/tar/README.md +10 -0
  60. package/node_modules/tar/lib/unpack.js +22 -5
  61. package/node_modules/tar/package.json +5 -5
  62. package/node_modules/yallist/package.json +1 -2
  63. package/package.json +10 -10
  64. package/src/FormXObjectDriver.cpp +1 -1
  65. package/src/FormXObjectDriver.h +1 -1
  66. package/src/ImageXObjectDriver.cpp +1 -1
  67. package/src/ImageXObjectDriver.h +1 -1
  68. package/src/InfoDictionaryDriver.cpp +14 -14
  69. package/src/InfoDictionaryDriver.h +14 -14
  70. package/src/PDFBooleanDriver.cpp +1 -1
  71. package/src/PDFBooleanDriver.h +1 -1
  72. package/src/PDFHexStringDriver.cpp +1 -1
  73. package/src/PDFHexStringDriver.h +1 -1
  74. package/src/PDFIntegerDriver.cpp +1 -1
  75. package/src/PDFIntegerDriver.h +1 -1
  76. package/src/PDFLiteralStringDriver.cpp +1 -1
  77. package/src/PDFLiteralStringDriver.h +1 -1
  78. package/src/PDFNameDriver.cpp +1 -1
  79. package/src/PDFNameDriver.h +1 -1
  80. package/src/PDFNullDriver.cpp +1 -1
  81. package/src/PDFNullDriver.h +1 -1
  82. package/src/PDFPageDriver.cpp +12 -12
  83. package/src/PDFPageDriver.h +12 -12
  84. package/src/PDFRealDriver.cpp +1 -1
  85. package/src/PDFRealDriver.h +1 -1
  86. package/src/PDFSymbolDriver.cpp +1 -1
  87. package/src/PDFSymbolDriver.h +1 -1
  88. package/src/deps/LibTiff/tif_config.h +2 -0
  89. package/src/deps/ZLib/binding.gyp +3 -3
  90. package/src/deps/ZLib/zconf.h +6 -0
  91. package/src/nodes.h +10 -2
  92. package/node_modules/lru-cache/LICENSE +0 -15
  93. package/node_modules/lru-cache/README.md +0 -166
  94. package/node_modules/lru-cache/index.js +0 -334
  95. package/node_modules/lru-cache/package.json +0 -69
package/CHANGELOG.md CHANGED
@@ -7,6 +7,32 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [5.0.0] - 2024-09-08
11
+
12
+ ### Added
13
+
14
+ - Add electron 24.7 and 24.8
15
+ - Add electron 25.4, 25.5, 25.6, 25.7, 25.8 and 25.9
16
+ - Add electron 26.0, 26.1, 26.2, 26.3, 26.4, 26.5, 26.6
17
+ - Add electron 27.0, 27.1, 27.2 and 27.3
18
+ - Add electron 28.0, 28.1, 28.2 and 28.3
19
+ - Add electron 29.0, 29.1, 29.2, 29.3 and 29.4
20
+ - Add electron 30.0, 30.1, 30.2, 30.3 and 30.4
21
+ - Add electron 31.0, 31.1, 31.2, 31.3 and 31.4
22
+ - Add electron 32.0
23
+ - Add node v22.0.0
24
+
25
+ ### Remove
26
+
27
+ - Outdated electron 23.x versions
28
+ - Node version <= 16
29
+
30
+ ### Update
31
+
32
+ - Update dependencies
33
+ - Including tar which removes a security vulnerability
34
+ - new Buffer to Buffer.from
35
+
10
36
  ## [4.1.0] - 2023-12-13
11
37
 
12
38
  ### Fixed
@@ -412,7 +438,8 @@ with the following changes.
412
438
 
413
439
  - Initial release
414
440
 
415
- [unreleased]: https://github.com/julianhille/MuhammaraJS/compare/4.1.0...HEAD
441
+ [unreleased]: https://github.com/julianhille/MuhammaraJS/compare/5.0.0...HEAD
442
+ [5.0.0]: https://github.com/julianhille/MuhammaraJS/compare/4.1.0...5.0.0
416
443
  [4.1.0]: https://github.com/julianhille/MuhammaraJS/compare/4.0.0...4.1.0
417
444
  [4.0.0]: https://github.com/julianhille/MuhammaraJS/compare/3.8.0...4.0.0
418
445
  [3.8.0]: https://github.com/julianhille/MuhammaraJS/compare/3.7.0...3.8.0
package/README.md CHANGED
@@ -4,12 +4,12 @@
4
4
  [![Build status](https://github.com/julianhille/MuhammaraJS/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/julianhille/MuhammaraJS/actions/workflows/build.yml)
5
5
 
6
6
  Welcome to MuhammaraJS.
7
- A Fast NodeJS Module for Creating, Parsing an Manipulating PDF Files and Streams.
7
+ A Fast NodeJS Module for creating, parsing and manipulating PDF files and streams.
8
8
 
9
9
  Original Project (CPP base version)
10
10
  Project site is [here](http://www.pdfhummus.com).
11
11
 
12
- If you are looking for a C++ Library go [here](https://github.com/galkahana/PDF-Writer).
12
+ If you are looking for a C++ library go [here](https://github.com/galkahana/PDF-Writer).
13
13
 
14
14
  ## Hummus JS is the base
15
15
 
@@ -19,7 +19,7 @@ He did an awesome job, but discontinued hummusjs.
19
19
  The documentation for MuhammaraJS / HummusJS is still located at the
20
20
  hummusJS github wiki: available [here](https://github.com/galkahana/HummusJS/wiki)
21
21
 
22
- ## muhammara-recipe '(formerly known as hummus-recipe) as been added
22
+ ## muhammara-recipe (formerly known as hummus-recipe) as been added
23
23
 
24
24
  Muhammara-recipe and hummus-recipe has been integrated, dependencies updated
25
25
  and is now shipped along with muhammara itself.
@@ -49,6 +49,12 @@ This won't affect a lot of you but still.
49
49
  This means the glibc has been raised to 2.31 which might break pre-builts for you.
50
50
  It is still possible to build for older glibc version.
51
51
 
52
+ ### Version 5.x
53
+
54
+ - Node <= 16 pre-builts have been removed
55
+ - Electron <= 23 pre-builts have been removed
56
+ - GCC 13 needed / std ++ 20 (only needed if you compile yourself)
57
+
52
58
  # Installation
53
59
 
54
60
  ```
@@ -167,7 +173,7 @@ pdfDoc
167
173
  stroke: [0, 0, 140],
168
174
  fill: [153, 143, 32],
169
175
  lineWidth: 5,
170
- }
176
+ },
171
177
  )
172
178
  .rectangle(240, 400, 50, 50, {
173
179
  stroke: "#3b7721",
package/binding.gyp CHANGED
@@ -7,8 +7,8 @@
7
7
  'dependencies': [
8
8
  './src/deps/PDFWriter/binding.gyp:pdfwriter'
9
9
  ],
10
- "cflags_cc": [ "-std=c++17" ],
11
- "cflags": [ "-std=c++17" ],
10
+ "cflags_cc": [ "-std=c++20" ],
11
+ "cflags": [ "-std=c++20" ],
12
12
  'include_dirs': [
13
13
  './src',
14
14
  './src/deps/PDFWriter',
@@ -20,7 +20,7 @@
20
20
  {
21
21
  'AdditionalOptions':
22
22
  [
23
- '/std:c++17',
23
+ '/std:c++20',
24
24
  ]
25
25
  }
26
26
  },
@@ -28,7 +28,7 @@
28
28
  ['OS=="mac"', {
29
29
  'xcode_settings': {
30
30
  'CLANG_CXX_LIBRARY': 'libc++',
31
- "OTHER_CFLAGS": [ "-std=c++17"]
31
+ "OTHER_CFLAGS": [ "-std=c++20"]
32
32
  }
33
33
  }],
34
34
  ['OS=="win"', {
@@ -14,7 +14,7 @@ function PDFRStreamForBuffer(buffer) {
14
14
  PDFRStreamForBuffer.prototype.read = function (inAmount) {
15
15
  var amountToRead = inAmount;
16
16
  var arr = Array.from(
17
- this.buffer.subarray(this.rposition, this.rposition + amountToRead)
17
+ this.buffer.subarray(this.rposition, this.rposition + amountToRead),
18
18
  );
19
19
  this.rposition += amountToRead;
20
20
  return arr;
@@ -12,7 +12,7 @@ function PDFRStreamForFile(inPath) {
12
12
  }
13
13
 
14
14
  PDFRStreamForFile.prototype.read = function (inAmount) {
15
- var buffer = new Buffer(inAmount * 2);
15
+ var buffer = Buffer.alloc(inAmount * 2);
16
16
  var bytesRead = fs.readSync(this.rs, buffer, 0, inAmount, this.rposition);
17
17
  var arr = [];
18
18
 
@@ -9,7 +9,7 @@ function PDFStreamForResponse(inResponse) {
9
9
 
10
10
  PDFStreamForResponse.prototype.write = function (inBytesArray) {
11
11
  if (inBytesArray.length > 0) {
12
- this.response.write(new Buffer(inBytesArray));
12
+ this.response.write(Buffer.from(inBytesArray));
13
13
  this.position += inBytesArray.length;
14
14
  return inBytesArray.length;
15
15
  } else return 0;
@@ -12,7 +12,7 @@ function PDFWStreamForFile(inPath) {
12
12
 
13
13
  PDFWStreamForFile.prototype.write = function (inBytesArray) {
14
14
  if (inBytesArray.length > 0) {
15
- this.ws.write(new Buffer(inBytesArray));
15
+ this.ws.write(Buffer.from(inBytesArray));
16
16
  this.position += inBytesArray.length;
17
17
  return inBytesArray.length;
18
18
  } else return 0;
package/lib/Recipe.js CHANGED
@@ -79,7 +79,7 @@ class Recipe {
79
79
  this.output,
80
80
  Object.assign({}, this.encryptOptions, {
81
81
  version: this._getVersion(this.options.version),
82
- })
82
+ }),
83
83
  );
84
84
  } else {
85
85
  this.read();
@@ -90,7 +90,7 @@ class Recipe {
90
90
  new muhammara.PDFStreamForResponse(this.outStream),
91
91
  Object.assign({}, this.encryptOptions, {
92
92
  log: this.logFile,
93
- })
93
+ }),
94
94
  );
95
95
  } else {
96
96
  this.writer = muhammara.createWriterToModify(
@@ -98,7 +98,7 @@ class Recipe {
98
98
  Object.assign({}, this.encryptOptions, {
99
99
  modifiedFilePath: this.output,
100
100
  log: this.logFile,
101
- })
101
+ }),
102
102
  );
103
103
  }
104
104
  } catch (err) {
@@ -122,7 +122,7 @@ class Recipe {
122
122
  get position() {
123
123
  const { ox, oy } = this._reverseCoordinate(
124
124
  this._position.x,
125
- this._position.y
125
+ this._position.y,
126
126
  );
127
127
  return {
128
128
  x: ox,
@@ -222,7 +222,7 @@ class Recipe {
222
222
  new muhammara.PDFStreamForResponse(this.outStream),
223
223
  Object.assign({}, this.encryptOptions, {
224
224
  log: this.logFile,
225
- })
225
+ }),
226
226
  );
227
227
  } else {
228
228
  this.writer = muhammara.createWriterToModify(
@@ -230,7 +230,7 @@ class Recipe {
230
230
  Object.assign({}, this.encryptOptions, {
231
231
  modifiedFilePath: this.output,
232
232
  log: this.logFile,
233
- })
233
+ }),
234
234
  );
235
235
  }
236
236
 
@@ -242,7 +242,7 @@ class Recipe {
242
242
  if (this.isBufferSrc) {
243
243
  // eslint-disable-next-line no-console
244
244
  console.log(
245
- "Feature: Inserting Pages is not supported in Buffer Mode yet."
245
+ "Feature: Inserting Pages is not supported in Buffer Mode yet.",
246
246
  );
247
247
  } else {
248
248
  this._insertPages();
package/lib/muhammara.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var path = require("path");
2
2
  var pregyp = require("@mapbox/node-pre-gyp");
3
3
  var binding_path = pregyp.find(
4
- path.resolve(path.join(__dirname, "../package.json"))
4
+ path.resolve(path.join(__dirname, "../package.json")),
5
5
  );
6
6
  var muhammara = (module.exports = require(binding_path));
7
7
  var EventEmitter = require("events").EventEmitter;
@@ -17,7 +17,7 @@ muhammara.PDFWriter.prototype.getEvents = function () {
17
17
 
18
18
  muhammara.PDFWriter.prototype.triggerDocumentExtensionEvent = function (
19
19
  eventName,
20
- eventParams
20
+ eventParams,
21
21
  ) {
22
22
  eventParams.writer = this;
23
23
  this.getEvents().emit(eventName, eventParams);
@@ -48,7 +48,7 @@ exports.annot = function annot(
48
48
  x,
49
49
  y,
50
50
  subtype,
51
- options = { text: "", width: 0, height: 0 }
51
+ options = { text: "", width: 0, height: 0 },
52
52
  ) {
53
53
  const { text, width, height, replies } = options;
54
54
  this.annotationsToWrite.push({
@@ -102,7 +102,7 @@ exports._annot = function _annot(subtype, args = {}, pageNumber, ref) {
102
102
  open: false,
103
103
  flag: "", // 'readonly'
104
104
  },
105
- options
105
+ options,
106
106
  );
107
107
 
108
108
  const ex = nWidth ? nWidth : 0;
@@ -133,7 +133,7 @@ exports._annot = function _annot(subtype, args = {}, pageNumber, ref) {
133
133
  .writeLiteralStringValue(params.title || "")
134
134
  .writeKey("M")
135
135
  .writeLiteralStringValue(
136
- this.writer.createPDFDate(new Date(params.date)).toString()
136
+ this.writer.createPDFDate(new Date(params.date)).toString(),
137
137
  )
138
138
  .writeKey("Open")
139
139
  .writeBooleanValue(params.open)
@@ -81,7 +81,7 @@ exports.chroma = function chroma(name, value, colorspace = "") {
81
81
  // device colorspaces gray, rgb, and cmyk.
82
82
  if (![2, 6, 8].includes(value.toString().length)) {
83
83
  throw new Error(
84
- "Color value has incorrect size for gray, rgb, or cmyk colorspaces"
84
+ "Color value has incorrect size for gray, rgb, or cmyk colorspaces",
85
85
  );
86
86
  }
87
87
 
@@ -20,7 +20,7 @@ exports._calibrateCoordinate = function _calibrateCoordinate(
20
20
  y,
21
21
  offsetX = 0,
22
22
  offsetY = 0,
23
- pageNumber
23
+ pageNumber,
24
24
  ) {
25
25
  pageNumber = pageNumber || this.pageNumber;
26
26
  const { height, mediaBox } = this.metadata[pageNumber];
@@ -41,14 +41,14 @@ exports._calibrateCoordinateForAnnots = function _calibrateCoordinateForAnnots(
41
41
  y,
42
42
  offsetX = 0,
43
43
  offsetY = 0,
44
- pageNumber
44
+ pageNumber,
45
45
  ) {
46
46
  const { nx: tx, ny: ty } = this._calibrateCoordinate(
47
47
  x,
48
48
  y,
49
49
  offsetX,
50
50
  offsetY,
51
- pageNumber
51
+ pageNumber,
52
52
  );
53
53
  const { width, height, rotate, mediaBox } = this.metadata[pageNumber];
54
54
  const startX = mediaBox[0];
@@ -78,7 +78,7 @@ exports._calibrateCoordinateForAnnots = function _calibrateCoordinateForAnnots(
78
78
  ty,
79
79
  360 - rotate,
80
80
  rotateOffsetX,
81
- rotateOffsetY
81
+ rotateOffsetY,
82
82
  );
83
83
  return {
84
84
  nx,
@@ -91,7 +91,7 @@ exports._reverseCoordinate = function _reverseCoordinate(
91
91
  y,
92
92
  offsetX = 0,
93
93
  offsetY = 0,
94
- pageNumber
94
+ pageNumber,
95
95
  ) {
96
96
  pageNumber = pageNumber || this.pageNumber;
97
97
  const { height } = this.metadata[pageNumber];
@@ -44,7 +44,7 @@ exports.permission = function permission(flags = "print") {
44
44
 
45
45
  exports._getEncryptOptions = function _getEncryptOptions(
46
46
  options,
47
- addPermissions = true
47
+ addPermissions = true,
48
48
  ) {
49
49
  const encryptOptions = {};
50
50
 
@@ -12,7 +12,7 @@ const path = require("path");
12
12
  exports.registerFont = function registerFont(
13
13
  fontName = "",
14
14
  fontSrcPath = "",
15
- type = "regular"
15
+ type = "regular",
16
16
  ) {
17
17
  return this._registerFont(fontName, fontSrcPath, type);
18
18
  };
@@ -55,7 +55,7 @@ exports._loadFonts = function _loadFonts(fontSrcPath) {
55
55
  exports._registerFont = function _registerFont(
56
56
  fontName,
57
57
  fontSrcPath,
58
- type = "regular"
58
+ type = "regular",
59
59
  ) {
60
60
  this.fonts = this.fonts || {};
61
61
  let family = fontName.toLowerCase();
@@ -91,10 +91,10 @@ function _getFontFile(self, options = {}) {
91
91
  (options.bold || options.isBold) && (options.italic || options.isItalic)
92
92
  ? "bi"
93
93
  : options.italic || options.isItalic
94
- ? "i"
95
- : options.bold || options.isBold
96
- ? "b"
97
- : "r";
94
+ ? "i"
95
+ : options.bold || options.isBold
96
+ ? "b"
97
+ : "r";
98
98
 
99
99
  if (options.font) {
100
100
  const fontFamily = self.fonts[options.font.toLowerCase()];
@@ -4,7 +4,7 @@ exports.htmlToTextObjects = function (htmlCodes) {
4
4
  htmlCodes = htmlCodes.replace(/<br\/?>/g, "<p>[@@DONOT_RENDER_THIS@@]</p>");
5
5
  const nodes = new DOMParser().parseFromString(
6
6
  `<html>${htmlCodes}</html>`,
7
- "text/html"
7
+ "text/html",
8
8
  );
9
9
  const textObjects = parseNode(nodes).childs[0].childs;
10
10
  return textObjects;
@@ -17,7 +17,7 @@
17
17
  exports.image = function image(imgSrc, x, y, options = {}) {
18
18
  const { width, height, offsetX, offsetY } = this._getImgOffset(
19
19
  imgSrc,
20
- options
20
+ options,
21
21
  );
22
22
  const imgOptions = {
23
23
  transformation: {
@@ -36,7 +36,7 @@ exports._readInfo = function _readInfo() {
36
36
  .getSourceDocumentParser()
37
37
  .queryDictionaryObject(
38
38
  copyCtx.getSourceDocumentParser().getTrailer(),
39
- "Info"
39
+ "Info",
40
40
  );
41
41
 
42
42
  const oldInfo =
@@ -138,19 +138,19 @@ exports._writeInfo = function _writeInfo() {
138
138
  case "modDate":
139
139
  infoDictionary.addAdditionalInfoEntry(
140
140
  "source-ModDate",
141
- oldInfo.modDate
141
+ oldInfo.modDate,
142
142
  );
143
143
  break;
144
144
  case "creator":
145
145
  infoDictionary.addAdditionalInfoEntry(
146
146
  "source-Creator",
147
- oldInfo.creator
147
+ oldInfo.creator,
148
148
  );
149
149
  break;
150
150
  case "producer":
151
151
  infoDictionary.addAdditionalInfoEntry(
152
152
  "source-Producer",
153
- oldInfo.producer
153
+ oldInfo.producer,
154
154
  );
155
155
  break;
156
156
  default:
@@ -301,7 +301,7 @@ exports.structure = function structure(output) {
301
301
 
302
302
  const itemTrailer = pdfReader.queryDictionaryObject(
303
303
  pdfReader.getTrailer(),
304
- item
304
+ item,
305
305
  );
306
306
  logToFile(item);
307
307
  iterateObjectTypes(itemTrailer);
@@ -13,7 +13,7 @@ const hummusUtils = require("./utils");
13
13
  exports.insertPage = function insertPage(
14
14
  afterPageNumber,
15
15
  pdfSrc,
16
- srcPageNumber
16
+ srcPageNumber,
17
17
  ) {
18
18
  if (isNaN(afterPageNumber)) {
19
19
  throw new Error("The afterPageNumber is inValid.");
@@ -68,7 +68,7 @@ exports._insertPages = function _insertPages() {
68
68
  hummusUtils.appendPDFPagesFromPDFWithAnnotations(
69
69
  pdfWriter,
70
70
  info.pdfSrc,
71
- { specificRanges }
71
+ { specificRanges },
72
72
  );
73
73
  });
74
74
  }
@@ -111,7 +111,7 @@ exports.editPage = function editPage(pageNumber) {
111
111
  const pageModifier = new muhammara.PDFPageModifier(
112
112
  pdfWriter,
113
113
  pageIndex,
114
- true
114
+ true,
115
115
  );
116
116
  this.page = pageModifier;
117
117
  this.pageNumber = pageNumber;
@@ -135,31 +135,31 @@ exports.editPage = function editPage(pageNumber) {
135
135
  `[${startX}, ${startY}] is HERE`,
136
136
  startX,
137
137
  startY,
138
- textOptions
138
+ textOptions,
139
139
  );
140
140
  context.writeText(
141
141
  `[${startX}, width/2] is HERE`,
142
142
  startX,
143
143
  width / 2,
144
- textOptions
144
+ textOptions,
145
145
  );
146
146
  context.writeText(
147
147
  `[${startX}, height/2] is HERE`,
148
148
  startX,
149
149
  height / 2,
150
- textOptions
150
+ textOptions,
151
151
  );
152
152
  context.writeText(
153
153
  `[width/2, ${startY}] is HERE`,
154
154
  width / 2,
155
155
  startY,
156
- textOptions
156
+ textOptions,
157
157
  );
158
158
  context.writeText(
159
159
  `[height/2, ${startY}] is HERE`,
160
160
  height / 2,
161
161
  startY,
162
- textOptions
162
+ textOptions,
163
163
  );
164
164
  }
165
165
  return this;
@@ -167,7 +167,7 @@ exports.editPage = function editPage(pageNumber) {
167
167
 
168
168
  exports._resumePageRotation = function _resumePageRotation(
169
169
  pageNumber,
170
- context
170
+ context,
171
171
  ) {
172
172
  pageNumber = pageNumber || this.pageNumber;
173
173
  const {
@@ -88,8 +88,8 @@ function _n_gon(sides, cx, cy, radius, options = {}) {
88
88
  lineWidth = options.lineWidth
89
89
  ? options.lineWidth
90
90
  : options.width
91
- ? options.width
92
- : 2;
91
+ ? options.width
92
+ : 2;
93
93
  }
94
94
 
95
95
  let ngon = [];
@@ -372,7 +372,7 @@ exports.triangle = function triangle(x, y, traits, options = {}) {
372
372
 
373
373
  if (traits.length !== 3) {
374
374
  throw new Error(
375
- "Triangle requires 3 traits (sides/angles) for definition."
375
+ "Triangle requires 3 traits (sides/angles) for definition.",
376
376
  );
377
377
  }
378
378
 
@@ -456,21 +456,21 @@ exports.triangle = function triangle(x, y, traits, options = {}) {
456
456
  [ma_A.point(1).x, ma_A.point(1).y],
457
457
  [ma_A.point(2).x, ma_A.point(2).y],
458
458
  ],
459
- { color: "green", width: 0.5 }
459
+ { color: "green", width: 0.5 },
460
460
  );
461
461
  this.line(
462
462
  [
463
463
  [mb_B.point(1).x, mb_B.point(1).y],
464
464
  [mb_B.point(2).x, mb_B.point(2).y],
465
465
  ],
466
- { color: "green", width: 0.5 }
466
+ { color: "green", width: 0.5 },
467
467
  );
468
468
  this.line(
469
469
  [
470
470
  [mc_C.point(1).x, mc_C.point(1).y],
471
471
  [mc_C.point(2).x, mc_C.point(2).y],
472
472
  ],
473
- { color: "green", width: 0.5 }
473
+ { color: "green", width: 0.5 },
474
474
  );
475
475
  }
476
476
 
@@ -478,7 +478,7 @@ exports.triangle = function triangle(x, y, traits, options = {}) {
478
478
  triangle.incenter.point.x,
479
479
  triangle.incenter.point.y,
480
480
  triangle.incenter.radius,
481
- { color: "green", width: 0.5 }
481
+ { color: "green", width: 0.5 },
482
482
  );
483
483
  let ctr_A = new Line(triangle.incenter.point, triangle.A);
484
484
  let ap = ctr_A.extend(10);
@@ -533,7 +533,7 @@ const Triangle = class Triangle {
533
533
  });
534
534
  if (sss[0] + sss[1] <= sss[2]) {
535
535
  throw new Error(
536
- "Not a valid triangle inequality (sum of 2 shortest sides must be greater than third side"
536
+ "Not a valid triangle inequality (sum of 2 shortest sides must be greater than third side",
537
537
  );
538
538
  }
539
539
 
@@ -550,7 +550,7 @@ const Triangle = class Triangle {
550
550
  angC = 180 - angA - angB;
551
551
  if (angC <= 0) {
552
552
  throw new Error(
553
- "Not a valid triangle angle specification (sum of 2 angles must less than 180)"
553
+ "Not a valid triangle angle specification (sum of 2 angles must less than 180)",
554
554
  );
555
555
  }
556
556
  a = (c * Math.sin(toRadians(angA))) / Math.sin(toRadians(angC));
@@ -861,7 +861,7 @@ exports.arrow = function arrow(x, y, options = {}) {
861
861
  head.I[0],
862
862
  y - halfShaft,
863
863
  head.E[0],
864
- y - halfShaft
864
+ y - halfShaft,
865
865
  );
866
866
  const ke_shaft_intercept = KE.intersect(shaft_top);
867
867
  arrow.joinShaft(ke_shaft_intercept);
@@ -894,7 +894,7 @@ exports.arrow = function arrow(x, y, options = {}) {
894
894
  arrow.tip.K,
895
895
  arrow.tip.I,
896
896
  ],
897
- options
897
+ options,
898
898
  );
899
899
  } else {
900
900
  // Starting at arrow head tip (Pt I below),
@@ -921,7 +921,7 @@ exports.arrow = function arrow(x, y, options = {}) {
921
921
  arrow.tip.K,
922
922
  arrow.tip.I,
923
923
  ],
924
- options
924
+ options,
925
925
  ); // back to point of arrow to close polygon
926
926
  }
927
927
 
@@ -1193,7 +1193,7 @@ const Line = class Line {
1193
1193
  if (!this._length) {
1194
1194
  this._length = Math.sqrt(
1195
1195
  Math.pow(this._pt2.x - this._pt1.x, 2) +
1196
- Math.pow(this._pt2.y - this._pt1.y, 2)
1196
+ Math.pow(this._pt2.y - this._pt1.y, 2),
1197
1197
  );
1198
1198
  }
1199
1199
 
@@ -1243,7 +1243,7 @@ const Line = class Line {
1243
1243
  deltaX = distance * ss;
1244
1244
  deltaY = slope * deltaX;
1245
1245
  newLen = Math.sqrt(
1246
- Math.pow(opt.x - (x + deltaX), 2) + Math.pow(opt.y - (y + deltaY), 2)
1246
+ Math.pow(opt.x - (x + deltaX), 2) + Math.pow(opt.y - (y + deltaY), 2),
1247
1247
  );
1248
1248
  break;
1249
1249
  }
@@ -18,7 +18,7 @@ exports.split = function split(outputDir = "", prefix) {
18
18
  hummusUtils.appendPDFPageFromPDFWithAnnotations(
19
19
  pdfWriter,
20
20
  this.pdfReader,
21
- i
21
+ i,
22
22
  );
23
23
  pdfWriter.end();
24
24
  }
@@ -20,12 +20,12 @@ function getCellHeight(self, text, column, options) {
20
20
  column.y,
21
21
  0,
22
22
  0,
23
- self.pageNumber
23
+ self.pageNumber,
24
24
  );
25
25
  const pathOptions = self._getPathOptions(
26
26
  colOptions,
27
27
  originCoord.nx,
28
- originCoord.ny
28
+ originCoord.ny,
29
29
  );
30
30
  const textObjects = self._makeTextObject(text, pathOptions.size, colOptions);
31
31
  const textBox = self._makeTextBox(colOptions);
@@ -53,7 +53,7 @@ function drawTableBorder(self, x, y, width, height, rowLines, options) {
53
53
  [column.x + column.width, y],
54
54
  [column.x + column.width, y + height],
55
55
  ],
56
- borderOptions
56
+ borderOptions,
57
57
  );
58
58
  }
59
59
  // Draw horizontals
@@ -64,7 +64,7 @@ function drawTableBorder(self, x, y, width, height, rowLines, options) {
64
64
  [x, yPos],
65
65
  [x + width, yPos],
66
66
  ],
67
- borderOptions
67
+ borderOptions,
68
68
  );
69
69
  }
70
70
  }
@@ -290,7 +290,7 @@ exports.table = function table(x, y, contents, options = {}) {
290
290
  const cellOptions = getCellOptions(column.options, "hcell");
291
291
  colOptions.textBox = this._merge(
292
292
  colOptions.textBox,
293
- clone(cellOptions.textBox)
293
+ clone(cellOptions.textBox),
294
294
  );
295
295
  }
296
296