diff --git a/CHANGELOG.md b/CHANGELOG.md index ab9c8e759..829c10d7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +- Reverted to the original `pdfkit` package, moving away from `@foliojs-fork` +- Update pdfkit to 0.16.0 + ## 0.3.0-beta.14 - 2024-12-23 - Fix big size pdfmake bundle for browser diff --git a/package.json b/package.json index ca6a46b10..48691e020 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,8 @@ "test": "tests" }, "dependencies": { - "@foliojs-fork/linebreak": "^1.1.2", - "@foliojs-fork/pdfkit": "^0.15.2", - "iconv-lite": "^0.6.3", + "linebreak": "^1.1.0", + "pdfkit": "^0.16.0", "xmldoc": "^1.3.0" }, "devDependencies": { diff --git a/src/PDFDocument.js b/src/PDFDocument.js index 6d126d5fd..90781199d 100644 --- a/src/PDFDocument.js +++ b/src/PDFDocument.js @@ -1,4 +1,4 @@ -import PDFKit from '@foliojs-fork/pdfkit'; +import PDFKit from 'pdfkit'; const typeName = (bold, italics) => { let type = 'normal'; diff --git a/src/TextBreaker.js b/src/TextBreaker.js index e43ae07a0..4e4aff3df 100644 --- a/src/TextBreaker.js +++ b/src/TextBreaker.js @@ -1,4 +1,4 @@ -import LineBreaker from '@foliojs-fork/linebreak'; +import LineBreaker from 'linebreak'; import { isObject } from './helpers/variableType'; import StyleContextStack from './StyleContextStack'; diff --git a/src/browser-extensions/standard-fonts/Courier.js b/src/browser-extensions/standard-fonts/Courier.js index 3d78b16a5..316809d87 100644 --- a/src/browser-extensions/standard-fonts/Courier.js +++ b/src/browser-extensions/standard-fonts/Courier.js @@ -2,10 +2,10 @@ var fs = require('fs'); var fontContainer = { vfs: { - 'data/Courier.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Courier.afm', 'utf8'), encoding: 'utf8' }, - 'data/Courier-Bold.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Courier-Bold.afm', 'utf8'), encoding: 'utf8' }, - 'data/Courier-Oblique.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Courier-Oblique.afm', 'utf8'), encoding: 'utf8' }, - 'data/Courier-BoldOblique.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Courier-BoldOblique.afm', 'utf8'), encoding: 'utf8' } + 'data/Courier.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Courier.afm', 'utf8'), encoding: 'utf8' }, + 'data/Courier-Bold.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Courier-Bold.afm', 'utf8'), encoding: 'utf8' }, + 'data/Courier-Oblique.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Courier-Oblique.afm', 'utf8'), encoding: 'utf8' }, + 'data/Courier-BoldOblique.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Courier-BoldOblique.afm', 'utf8'), encoding: 'utf8' } }, fonts: { Courier: { diff --git a/src/browser-extensions/standard-fonts/Helvetica.js b/src/browser-extensions/standard-fonts/Helvetica.js index e65f701fb..3baa5111b 100644 --- a/src/browser-extensions/standard-fonts/Helvetica.js +++ b/src/browser-extensions/standard-fonts/Helvetica.js @@ -2,10 +2,10 @@ var fs = require('fs'); var fontContainer = { vfs: { - 'data/Helvetica.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Helvetica.afm', 'utf8'), encoding: 'utf8' }, - 'data/Helvetica-Bold.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Helvetica-Bold.afm', 'utf8'), encoding: 'utf8' }, - 'data/Helvetica-Oblique.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Helvetica-Oblique.afm', 'utf8'), encoding: 'utf8' }, - 'data/Helvetica-BoldOblique.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Helvetica-BoldOblique.afm', 'utf8'), encoding: 'utf8' } + 'data/Helvetica.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Helvetica.afm', 'utf8'), encoding: 'utf8' }, + 'data/Helvetica-Bold.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Helvetica-Bold.afm', 'utf8'), encoding: 'utf8' }, + 'data/Helvetica-Oblique.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Helvetica-Oblique.afm', 'utf8'), encoding: 'utf8' }, + 'data/Helvetica-BoldOblique.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Helvetica-BoldOblique.afm', 'utf8'), encoding: 'utf8' } }, fonts: { Helvetica: { diff --git a/src/browser-extensions/standard-fonts/Symbol.js b/src/browser-extensions/standard-fonts/Symbol.js index 0022a62c0..c8cdb6502 100644 --- a/src/browser-extensions/standard-fonts/Symbol.js +++ b/src/browser-extensions/standard-fonts/Symbol.js @@ -2,7 +2,7 @@ var fs = require('fs'); var fontContainer = { vfs: { - 'data/Symbol.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Symbol.afm', 'utf8'), encoding: 'utf8' } + 'data/Symbol.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Symbol.afm', 'utf8'), encoding: 'utf8' } }, fonts: { Symbol: { diff --git a/src/browser-extensions/standard-fonts/Times.js b/src/browser-extensions/standard-fonts/Times.js index f7dad42cd..7374f8b90 100644 --- a/src/browser-extensions/standard-fonts/Times.js +++ b/src/browser-extensions/standard-fonts/Times.js @@ -2,10 +2,10 @@ var fs = require('fs'); var fontContainer = { vfs: { - 'data/Times-Roman.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Times-Roman.afm', 'utf8'), encoding: 'utf8' }, - 'data/Times-Bold.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Times-Bold.afm', 'utf8'), encoding: 'utf8' }, - 'data/Times-Italic.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Times-Italic.afm', 'utf8'), encoding: 'utf8' }, - 'data/Times-BoldItalic.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/Times-BoldItalic.afm', 'utf8'), encoding: 'utf8' } + 'data/Times-Roman.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Times-Roman.afm', 'utf8'), encoding: 'utf8' }, + 'data/Times-Bold.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Times-Bold.afm', 'utf8'), encoding: 'utf8' }, + 'data/Times-Italic.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Times-Italic.afm', 'utf8'), encoding: 'utf8' }, + 'data/Times-BoldItalic.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/Times-BoldItalic.afm', 'utf8'), encoding: 'utf8' } }, fonts: { Times: { diff --git a/src/browser-extensions/standard-fonts/ZapfDingbats.js b/src/browser-extensions/standard-fonts/ZapfDingbats.js index cfaeb5a2a..e5281f163 100644 --- a/src/browser-extensions/standard-fonts/ZapfDingbats.js +++ b/src/browser-extensions/standard-fonts/ZapfDingbats.js @@ -2,7 +2,7 @@ var fs = require('fs'); var fontContainer = { vfs: { - 'data/ZapfDingbats.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/@foliojs-fork/pdfkit/js/data/ZapfDingbats.afm', 'utf8'), encoding: 'utf8' } + 'data/ZapfDingbats.afm': { data: fs.readFileSync(__dirname + '/../../../node_modules/pdfkit/js/data/ZapfDingbats.afm', 'utf8'), encoding: 'utf8' } }, fonts: { ZapfDingbats: { diff --git a/webpack.config.js b/webpack.config.js index ccf25394d..9f1886b78 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -155,27 +155,6 @@ module.exports = { }) } }, - { - enforce: 'post', - test: /fontkit[/\\]index.js$/, - use: { - loader: "transform-loader?brfs" - } - }, - { - enforce: 'post', - test: /unicode-properties[/\\]index.js$/, - use: { - loader: "transform-loader?brfs" - } - }, - { - enforce: 'post', - test: /linebreak[/\\]src[/\\]linebreaker.js/, - use: { - loader: "transform-loader?brfs" - } - } ] }, optimization: {