pdfkit
Advanced tools
Comparing version 0.14.0 to 0.15.0
## pdfkit changelog | ||
### Unreleased | ||
### [v0.15.0] - 2024-03-23 | ||
- Add subset for PDF/UA | ||
- Fix for line breaks in list items (#1486) | ||
- Fix for soft hyphen not being replaced by visible hyphen if necessary (#457) | ||
- Optimize output files by ignoring identity transforms | ||
- Fix for Acroforms - setting an option to false will still apply the flag (#1495) | ||
- Fix for text extraction in PDFium-based viewers due to invalid ToUnicodeMap (#1498) | ||
- Remove deprecated `write` method | ||
- Drop support for Node.js < 18 and for browsers released before 2020 | ||
### [v0.14.0] - 2023-11-09 | ||
@@ -8,2 +21,4 @@ | ||
- Add support for EXIF orientation on JPEG images (#626 and #1353) | ||
### [v0.13.0] - 2021-10-24 | ||
@@ -10,0 +25,0 @@ |
'use strict'; | ||
var VirtualFileSystem = /*#__PURE__*/function () { | ||
function VirtualFileSystem() { | ||
class VirtualFileSystem { | ||
constructor() { | ||
this.fileData = {}; | ||
} | ||
var _proto = VirtualFileSystem.prototype; | ||
_proto.readFileSync = function readFileSync(fileName, options) { | ||
readFileSync(fileName, options) { | ||
if (options === void 0) { | ||
options = {}; | ||
} | ||
var encoding = typeof options === 'string' ? options : options.encoding; | ||
var virtualFileName = normalizeFilename(fileName); | ||
var data = this.fileData[virtualFileName]; | ||
const encoding = typeof options === 'string' ? options : options.encoding; | ||
const virtualFileName = normalizeFilename(fileName); | ||
const data = this.fileData[virtualFileName]; | ||
if (data == null) { | ||
throw new Error("File '" + virtualFileName + "' not found in virtual file system"); | ||
throw new Error(`File '${virtualFileName}' not found in virtual file system`); | ||
} | ||
if (encoding) { | ||
@@ -27,19 +21,14 @@ // return a string | ||
} | ||
return Buffer.from(data, typeof data === 'string' ? 'base64' : undefined); | ||
}; | ||
_proto.writeFileSync = function writeFileSync(fileName, content) { | ||
} | ||
writeFileSync(fileName, content) { | ||
this.fileData[normalizeFilename(fileName)] = content; | ||
}; | ||
_proto.bindFileData = function bindFileData(data, options) { | ||
} | ||
bindFileData(data, options) { | ||
if (data === void 0) { | ||
data = {}; | ||
} | ||
if (options === void 0) { | ||
options = {}; | ||
} | ||
if (options.reset) { | ||
@@ -50,7 +39,4 @@ this.fileData = data; | ||
} | ||
}; | ||
return VirtualFileSystem; | ||
}(); | ||
} | ||
} | ||
function normalizeFilename(fileName) { | ||
@@ -60,12 +46,9 @@ if (fileName.indexOf(__dirname) === 0) { | ||
} | ||
if (fileName.indexOf('/') === 0) { | ||
fileName = fileName.substring(1); | ||
} | ||
return fileName; | ||
} | ||
var virtualFs = new VirtualFileSystem(); | ||
module.exports = virtualFs; |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"homepage": "http://pdfkit.org/", | ||
@@ -35,3 +35,3 @@ "author": { | ||
"browserify": "^16.5.0", | ||
"canvas": "^2.11.0", | ||
"canvas": "^2.11.2", | ||
"codemirror": "~5.49.2", | ||
@@ -55,2 +55,3 @@ "eslint": "^7.8.1", | ||
"fontkit": "^1.8.1", | ||
"jpeg-exif": "^1.1.4", | ||
"linebreak": "^1.0.2", | ||
@@ -61,3 +62,4 @@ "png-js": "^1.0.0" | ||
"prepublishOnly": "npm run build", | ||
"build": "rollup -c && browserify --standalone PDFDocument --ignore crypto --ignore iconv-lite js/pdfkit.js > js/pdfkit.standalone.js", | ||
"build": "rollup -c && npm run build-standalone", | ||
"build-standalone": "browserify --standalone PDFDocument --ignore crypto --ignore iconv-lite js/pdfkit.js > js/pdfkit.standalone.js", | ||
"browserify-example": "browserify examples/browserify/browser.js > examples/browserify/bundle.js", | ||
@@ -75,4 +77,3 @@ "pdf-guide": "node docs/generate.js", | ||
"main": "js/pdfkit.js", | ||
"module": "js/pdfkit.es5.js", | ||
"esnext": "js/pdfkit.esnext.js", | ||
"module": "js/pdfkit.es.js", | ||
"browserify": { | ||
@@ -84,3 +85,3 @@ "transform": [ | ||
"engine": [ | ||
"node >= v6.0.0" | ||
"node >= v18.0.0" | ||
], | ||
@@ -97,2 +98,2 @@ "jest": { | ||
} | ||
} | ||
} |
@@ -34,3 +34,3 @@ # PDFKit | ||
- Text | ||
- Line wrapping | ||
- Line wrapping (with soft hyphen recognition) | ||
- Text alignments | ||
@@ -37,0 +37,0 @@ - Bulleted lists |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
5900766
29
0
5
74595
6
+ Addedjpeg-exif@^1.1.4
+ Addedjpeg-exif@1.1.4(transitive)