Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kingstonsoftware/pdf-o-rama

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kingstonsoftware/pdf-o-rama - npm Package Compare versions

Comparing version 2.2.6 to 2.2.7

38

dist/PDFTool.js

@@ -16,3 +16,3 @@ "use strict";

var _hummus = _interopRequireDefault(require("hummus"));
var _hummus = _interopRequireDefault(require("@kingstonsoftware/hummus"));

@@ -224,3 +224,3 @@ var _json = _interopRequireDefault(require("json5"));

for (let i = 0; i < numPages; i++) {
const pageModifier = new _hummus.default.PDFPageModifier(this.pdfWriter, i);
const pageModifier = new _hummus.default.PDFPageModifier(this.pdfWriter, i, true);
let pageContext = pageModifier.startContext().getContext();

@@ -285,11 +285,17 @@ const fields = data.fields.filter(f => f.page === i);

const q = Math.PI / 4.0;
pageModifier.endContext();
let gsID = this.createOpacityExtGState(0.5);
let formXObject = this.pdfWriter.createFormXObject(0, 0, w, h);
let gsName = formXObject.getResourcesDictionary().addExtGStateMapping(gsID);
formXObject.getContentContext().q().gs(gsName).w(1.0).G(0).rg(1, 0.6, 1).m(0, halfH).l(halfH, 0).l(w, 0).l(w, h).l(halfH, h).h().B().BT().g(0).Tm(1, 0, 0, 1, halfH, halfH - fontDims.height / 2.0).Tf(font, 12).Tj(`Sign Here ${field.value || ""}`).ET().Q();
const gsID = this.createExtGState(0.5);
const formXObject = this.pdfWriter.createFormXObject(0, 0, w, h);
const gsName = formXObject.getResourcesDictionary().addExtGStateMapping(gsID);
formXObject.getContentContext().q().gs(gsName).rg(1, 0.6, 1).m(0, halfH).l(halfH, 0).l(w, 0).l(w, h).l(halfH, h).f().G(0).J(0).w(1).m(halfH, h).l(0, halfH).l(halfH, 0).S().w(2).m(halfH, 0).l(w, 0).l(w, h).l(halfH, h).S().BT().g(0).Tm(1, 0, 0, 1, halfH, halfH - fontDims.height / 2.0).Tf(font, 12).Tj(`Sign Here ${field.value || ""}`).ET().Q();
this.pdfWriter.endFormXObject(formXObject);
pageContext = pageModifier.startContext().getContext();
pageContext.q().cm(1, 0, 0, 1, x, y + halfH).cm(Math.cos(q), Math.sin(q), -Math.sin(q), Math.cos(q), 0, 0).cm(1, 0, 0, 1, 0, -halfH) // NOTE: The coordinate space of the XObjects is the same as the page!
const q = Math.PI / 4.0; // 45 degrees
// The sign-here arrow is the same height as the field box,
// points to the bottom left corner of the box and is at 45 degrees
pageContext.q().cm(1, 0, 0, 1, x, y) // Translate
.cm(Math.cos(q), Math.sin(q), -Math.sin(q), Math.cos(q), 0, 0) // Rotate
.cm(1, 0, 0, 1, 0, -halfH) // Translate
// NOTE: The coordinate space of the XObjects is the same as the page!
.doXObject(formXObject).Q();

@@ -310,10 +316,16 @@ break;

createOpacityExtGState(opacity) {
createExtGState(opacity) {
const context = this.pdfWriter.getObjectsContext();
const id = context.startNewIndirectObject();
const dict = context.startDictionary();
dict.writeKey("type").writeNameValue("ExtGState").writeKey("ca");
const dict = context.startDictionary(); // See Section 4.3.4
dict.writeKey("type").writeNameValue("ExtGState").writeKey("ca"); // Non-stroking opacity
context.writeNumber(opacity).endLine();
dict.writeKey("CA");
context.writeNumber(opacity).endLine().endDictionary(dict);
dict.writeKey("CA"); // Stroking opacity
context.writeNumber(opacity).endLine();
dict.writeKey("SA"); // Turn on stroke adjustment
context.writeBoolean(true).endLine().endDictionary(dict);
return id;

@@ -320,0 +332,0 @@ }

@@ -7,6 +7,6 @@ "use strict";

exports.fullVersion = exports.version = void 0;
const version = '2.2.6';
const version = '2.2.7';
exports.version = version;
const fullVersion = '2.2.6-20200223.0';
const fullVersion = '2.2.7-20200422.0';
exports.fullVersion = fullVersion;
//# sourceMappingURL=version.js.map
{
"name": "@kingstonsoftware/pdf-o-rama",
"private": false,
"version": "2.2.6",
"version": "2.2.7",
"description": "A tool for manipulating PDF files",

@@ -47,11 +47,11 @@ "engines": {

"devDependencies": {
"@babel/cli": "^7.7.7",
"@babel/core": "^7.7.7",
"@babel/node": "^7.7.7",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-decorators": "^7.7.4",
"@babel/plugin-proposal-optional-chaining": "^7.7.5",
"@babel/plugin-syntax-object-rest-spread": "^7.7.4",
"@babel/preset-env": "^7.7.7",
"jest-cli": "^24.9.0"
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.0",
"@babel/node": "^7.8.7",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/preset-env": "^7.9.5",
"jest-cli": "^25.3.0"
},

@@ -61,8 +61,8 @@ "dependencies": {

"autobind-decorator": "^2.4.0",
"chalk": "^3.0.0",
"fs-extra": "^8.1.0",
"hummus": "^1.0.108",
"json5": "^2.1.1",
"chalk": "^4.0.0",
"fs-extra": "^9.0.0",
"@kingstonsoftware/hummus": "^1.0.109",
"json5": "^2.1.3",
"md5": "^2.2.1",
"minimist": "^1.2.0",
"minimist": "^1.2.5",
"qrcode": "^1.4.4",

@@ -69,0 +69,0 @@ "tmp-promise": "^2.0.2"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc