Comparing version 3.0.1 to 3.0.2
@@ -17,3 +17,3 @@ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
*/ | ||
/* globals Cmd, ColorSpace, Dict, MozBlobBuilder, Name, PDFJS, Ref, URL */ | ||
/* globals Cmd, ColorSpace, Dict, Blob, Name, PDFJS, Ref, URL */ | ||
@@ -1102,8 +1102,3 @@ 'use strict'; | ||
PDFJS.createBlob = function createBlob(data, contentType) { | ||
if (typeof Blob === 'function') | ||
return new Blob([data], { type: contentType }); | ||
// Blob builder is deprecated in FF14 and removed in FF18. | ||
var bb = new MozBlobBuilder(); | ||
bb.append(data); | ||
return bb.getBlob(contentType); | ||
return new Blob([data], { type: contentType }); | ||
}; | ||
@@ -1110,0 +1105,0 @@ |
@@ -258,3 +258,3 @@ import nodeUtil from "util"; | ||
processText(p, str, maxWidth, color, fontSize, targetData, matrix2D) { | ||
let text = this.#processSymbolicFont(str); | ||
const text = this.#processSymbolicFont(str); | ||
if (!text) { | ||
@@ -270,3 +270,3 @@ return; | ||
const clrId = PDFUnit.findColorIndex(color); | ||
const colorObj = (clrId > 0 && clrId < PDFUnit.colorCount()) ? {clr: clrId} : {oc: this.color}; | ||
const colorObj = (clrId >= 0 && clrId < PDFUnit.colorCount()) ? {clr: clrId} : {oc: color}; | ||
@@ -284,5 +284,6 @@ let textRun = { | ||
let oneText = {x: PDFUnit.toFormX(p.x) - 0.25, | ||
const oneText = {x: PDFUnit.toFormX(p.x) - 0.25, | ||
y: PDFUnit.toFormY(p.y) - 0.75, | ||
w: PDFUnit.toFixedFloat(maxWidth), | ||
...colorObj, //MQZ.07/29/2013: when color is not in color dictionary, set the original color (oc) | ||
sw: this.spaceWidth, //font space width, use to merge adjacent text blocks | ||
@@ -293,6 +294,2 @@ A: "left", | ||
//MQZ.07/29/2013: when color is not in color dictionary, set the original color (oc) | ||
oneText = {...oneText, ...colorObj}; | ||
targetData.Texts.push(oneText); | ||
@@ -299,0 +296,0 @@ } |
{ | ||
"name": "pdf2json", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "PDF file parser that converts PDF binaries to text based JSON, powered by porting a fork of PDF.JS to Node.js", | ||
@@ -41,2 +41,3 @@ "keywords": [ | ||
"parse-tb": "node --trace-deprecation --trace-warnings pdf2json.js -f ./test/pdf/misc/i242_testingWithTable.pdf -o ./test/target/misc", | ||
"parse-tc": "node --trace-deprecation --trace-warnings pdf2json.js -f ./test/pdf/misc/i293_pdfpac.pdf -o ./test/target/misc", | ||
"parse-e": "node --trace-deprecation --trace-warnings pdf2json.js -f ./test/pdf/misc/i43_encrypted.pdf -o ./test/target/misc", | ||
@@ -47,4 +48,4 @@ "parse-e2": "node --trace-deprecation --trace-warnings pdf2json.js -f ./test/pdf/misc/i243_problem_file_anon.pdf -o ./test/target/misc", | ||
"engines": { | ||
"node": ">=14.18.0", | ||
"npm": ">=8.12.1" | ||
"node": ">=18.12.1", | ||
"npm": ">=8.19.2" | ||
}, | ||
@@ -51,0 +52,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1992897
47677