Comparing version 2.3.0 to 2.3.1
@@ -7,2 +7,6 @@ # Changelog | ||
## [2.3.1] - 2019-09-11 | ||
### Fixed | ||
- add missing font type definitions #153 | ||
## [2.3.0] - 2019-05-07 | ||
@@ -9,0 +13,0 @@ ### Changed |
@@ -355,2 +355,6 @@ 'use strict' | ||
async function endCell(row) { | ||
if (!this._cursor.doesFit(this.paddingBottom + this.borderBottomWidth)) { | ||
await this._pageBreak() | ||
} | ||
// apply bottom padding | ||
@@ -357,0 +361,0 @@ this._cursor.y -= this.paddingBottom |
{ | ||
"name": "pdfjs", | ||
"author": "Markus Ast <npm.m@rkusa.st>", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "A Portable Document Format (PDF) generation library targeting both the server- and client-side.", | ||
@@ -21,12 +21,12 @@ "keywords": [ | ||
"@rkusa/linebreak": "^1.0.0", | ||
"opentype.js": "^0.11.0", | ||
"opentype.js": "^1.1.0", | ||
"pako": "^1.0.10", | ||
"readable-stream": "^3.3.0", | ||
"unorm": "^1.5.0", | ||
"uuid": "^3.3.2" | ||
"readable-stream": "^3.4.0", | ||
"unorm": "^1.6.0", | ||
"uuid": "^3.3.3" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^10.14.6", | ||
"tape": "^4.10.1", | ||
"typescript": "^3.4.5" | ||
"@types/node": "^12.7.5", | ||
"tape": "^4.11.0", | ||
"typescript": "^3.6.3" | ||
}, | ||
@@ -33,0 +33,0 @@ "repository": { |
@@ -14,3 +14,3 @@ declare module "pdfjs" { | ||
* TFont objects can be used multiple times. | ||
* @param arg the font data, as either Buffer or ArrayBuffer of an OTF font or a JSON object descriping an AFM font | ||
* @param arg the font data, as either Buffer or ArrayBuffer of an OTF font or a JSON object describing an AFM font | ||
*/ | ||
@@ -632,1 +632,73 @@ constructor(arg: Buffer | ArrayBuffer); | ||
} | ||
declare type Font = import("pdfjs").Font; | ||
declare module "pdfjs/font/Courier-Bold" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Courier-BoldOblique" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Courier-Oblique" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Courier" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Helvetica-Bold" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Helvetica-BoldOblique" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Helvetica-Oblique" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Helvetica" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Symbol" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Times-Bold" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Times-BoldItalic" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Times-Italic" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/Times-Roman" { | ||
const font: Font; | ||
export = font; | ||
} | ||
declare module "pdfjs/font/ZapfDingbats" { | ||
const font: Font; | ||
export = font; | ||
} |
@@ -50,5 +50,5 @@ import * as pdf from "pdfjs"; | ||
.asBuffer() | ||
.then((data:Buffer) => writeFileSync("test.pdf", data, { encoding: "binary" })); | ||
.then((data: Buffer) => writeFileSync("test.pdf", data, { encoding: "binary" })); | ||
doc.asBuffer((err:Error, data:Buffer) => { | ||
doc.asBuffer((err: Error, data: Buffer) => { | ||
if (err) { | ||
@@ -98,3 +98,3 @@ console.error(err); | ||
const header1 = doc.header(); | ||
header1.pageNumber((curr:number, total:number) => `${curr} / ${total}`); | ||
header1.pageNumber((curr: number, total: number) => `${curr} / ${total}`); | ||
@@ -156,3 +156,3 @@ const table2 = doc.table({ | ||
docPlayground.footer().pageNumber( | ||
function(curr:number, total:number) { | ||
function (curr: number, total: number) { | ||
return curr + " / " + total; | ||
@@ -191,3 +191,3 @@ }, | ||
widths: [1.5 * pdf.cm, 1.5 * pdf.cm, null, 2 * pdf.cm, 2.5 * pdf.cm], | ||
borderHorizontalWidths: function(i:number) { | ||
borderHorizontalWidths: function (i: number) { | ||
return i < 2 ? 1 : 0.1; | ||
@@ -1541,2 +1541,46 @@ }, | ||
function writeFileSync(_name: string, _data: Buffer, _opts: any) {} | ||
function writeFileSync(_name: string, _data: Buffer, _opts: any) { } | ||
/***** Fonts *****/ | ||
import * as Courier from "pdfjs/font/Courier"; | ||
doc = new pdf.Document({ font: Courier }); | ||
import * as CourierBold from "pdfjs/font/Courier-Bold"; | ||
doc = new pdf.Document({ font: CourierBold }); | ||
import * as CourierBoldOblique from "pdfjs/font/Courier-BoldOblique"; | ||
doc = new pdf.Document({ font: CourierBoldOblique }); | ||
import * as CourierOblique from "pdfjs/font/Courier-Oblique"; | ||
doc = new pdf.Document({ font: CourierOblique }); | ||
import * as Helvetica from "pdfjs/font/Helvetica"; | ||
doc = new pdf.Document({ font: Helvetica }); | ||
import * as HelveticaBold from "pdfjs/font/Helvetica-Bold"; | ||
doc = new pdf.Document({ font: HelveticaBold }); | ||
import * as HelveticaBoldOblique from "pdfjs/font/Helvetica-BoldOblique"; | ||
doc = new pdf.Document({ font: HelveticaBoldOblique }); | ||
import * as HelveticaOblique from "pdfjs/font/Helvetica-Oblique"; | ||
doc = new pdf.Document({ font: HelveticaOblique }); | ||
import * as Symbol from "pdfjs/font/Symbol"; | ||
doc = new pdf.Document({ font: Symbol }); | ||
import * as TimesBold from "pdfjs/font/Times-Bold"; | ||
doc = new pdf.Document({ font: TimesBold }); | ||
import * as TimesBoldItalic from "pdfjs/font/Times-BoldItalic"; | ||
doc = new pdf.Document({ font: TimesBoldItalic }); | ||
import * as TimesItalic from "pdfjs/font/Times-Italic"; | ||
doc = new pdf.Document({ font: TimesItalic }); | ||
import * as TimesRoman from "pdfjs/font/Times-Roman"; | ||
doc = new pdf.Document({ font: TimesRoman }); | ||
import * as ZapfDingbats from "pdfjs/font/ZapfDingbats"; | ||
doc = new pdf.Document({ font: ZapfDingbats }); |
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
9819408
77
6478
+ Addedopentype.js@1.3.4(transitive)
- Removedopentype.js@0.11.0(transitive)
Updatedopentype.js@^1.1.0
Updatedreadable-stream@^3.4.0
Updatedunorm@^1.6.0
Updateduuid@^3.3.3