Skip to content

Commit

Permalink
Reverted to the original pdfkit package, moving away from `@foliojs…
Browse files Browse the repository at this point in the history
…-fork`
  • Loading branch information
liborm85 committed Dec 29, 2024
1 parent 8b89e8d commit 5926fc9
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 40 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/PDFDocument.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PDFKit from '@foliojs-fork/pdfkit';
import PDFKit from 'pdfkit';

const typeName = (bold, italics) => {
let type = 'normal';
Expand Down
2 changes: 1 addition & 1 deletion src/TextBreaker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import LineBreaker from '@foliojs-fork/linebreak';
import LineBreaker from 'linebreak';
import { isObject } from './helpers/variableType';
import StyleContextStack from './StyleContextStack';

Expand Down
8 changes: 4 additions & 4 deletions src/browser-extensions/standard-fonts/Courier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
8 changes: 4 additions & 4 deletions src/browser-extensions/standard-fonts/Helvetica.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion src/browser-extensions/standard-fonts/Symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
8 changes: 4 additions & 4 deletions src/browser-extensions/standard-fonts/Times.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion src/browser-extensions/standard-fonts/ZapfDingbats.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
21 changes: 0 additions & 21 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 5926fc9

Please sign in to comment.