Skip to content

Commit

Permalink
Added support PDF/A and PDF/UA #950 #942
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Nov 1, 2024
1 parent 6feb776 commit d49ad37
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Added support PDF/A and PDF/UA
- Update pdfkit to 0.15.1
- Fixed bug with how page breaks provoked by cells with rowspan were handled
- Fixed find where previous cell started with row span and col span combination
Expand Down
6 changes: 6 additions & 0 deletions src/Printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class PdfPrinter {
this.resolveUrls(docDefinition).then(() => {
try {
docDefinition.version = docDefinition.version || '1.3';
docDefinition.subset = docDefinition.subset || undefined;
docDefinition.tagged = typeof docDefinition.tagged === 'boolean' ? docDefinition.tagged : false;
docDefinition.displayTitle = typeof docDefinition.displayTitle === 'boolean' ? docDefinition.displayTitle : false;
docDefinition.compress = typeof docDefinition.compress === 'boolean' ? docDefinition.compress : true;
docDefinition.images = docDefinition.images || {};
docDefinition.attachments = docDefinition.attachments || {};
Expand All @@ -58,6 +61,9 @@ class PdfPrinter {
let pdfOptions = {
size: [pageSize.width, pageSize.height],
pdfVersion: docDefinition.version,
subset: docDefinition.subset,
tagged: docDefinition.tagged,
displayTitle: docDefinition.displayTitle,
compress: docDefinition.compress,
userPassword: docDefinition.userPassword,
ownerPassword: docDefinition.ownerPassword,
Expand Down
7 changes: 7 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ module.exports = {
}
},

{
enforce: 'post',
test: /pdfkit[/\\]js[/\\]pdfkit.es.js$/,
use: {
loader: "transform-loader?brfs"
}
},
{
enforce: 'post',
test: /fontkit[/\\]index.js$/,
Expand Down

0 comments on commit d49ad37

Please sign in to comment.