Socket
Socket
Sign inDemoInstall

pdfjs

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdfjs - npm Package Compare versions

Comparing version 2.0.0-alpha.8 to 2.0.0

9

CHANGELOG.md

@@ -7,2 +7,11 @@ # Changelog

## [Unreleased]
## [2.0.0] - 2018-06-19
### Changed
- The outline method now accepts an outline ID (number) as a valid input for the parent parameter
### Fixed
- Fixed OTF font browser usage (`new Font(src)` now properly accepts both Node.js Buffer and ArrayBuffer as input)
## [2.0.0-alpha.8] - 2018-05-13

@@ -9,0 +18,0 @@ ### Added

19

lib/document.js

@@ -664,9 +664,16 @@ 'use strict'

let parentIndex
if (parent === undefined || parent === '') {
parentIndex = 0
if (typeof parent === 'number' && parent >= 0 && parent <= this._outlines.length) {
// the user provided a valid index number: use it as the parentIndex
parentIndex = parent
} else {
parentIndex = this._outlines.findIndex(
(item, index) => (item.data.title === parent)
)
if (parentIndex === -1) parentIndex = this.outline(parent, destination)
// the user did not provide a valid index number: search for it in the outline array
// if it is not found, create the corresponding parent at root level
if (parent === undefined || parent === '') {
parentIndex = 0
} else {
parentIndex = this._outlines.findIndex(
(item, index) => (item.data.title === parent)
)
if (parentIndex === -1) parentIndex = this.outline(parent, destination)
}
}

@@ -673,0 +680,0 @@

@@ -13,2 +13,3 @@ 'use strict'

const StringWidth = Base.StringWidth
const util = require('../util')

@@ -20,3 +21,3 @@ module.exports = class OTFFontFactory extends Base {

// convert to array buffer
const ab = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength)
const ab = util.toArrayBuffer(b)
this.font = opentype.parse(ab)

@@ -23,0 +24,0 @@ }

{
"name": "pdfjs",
"author": "Markus Ast <npm.m@rkusa.st>",
"version": "2.0.0-alpha.8",
"version": "2.0.0",
"description": "A Portable Document Format (PDF) generation library targeting both the server- and client-side.",

@@ -21,3 +21,3 @@ "keywords": [

"@rkusa/linebreak": "^1.0.0",
"opentype.js": "^0.7.3",
"opentype.js": "^0.8.0",
"pako": "^1.0.6",

@@ -24,0 +24,0 @@ "unorm": "^1.4.1",

@@ -12,3 +12,3 @@ ![pdfjs](https://cdn.rawgit.com/rkusa/pdfjs/2.x/logo.svg)

```bash
npm install pdfjs@2.0.0-alpha.8
npm install pdfjs@2.0.0
```

@@ -15,0 +15,0 @@

@@ -131,3 +131,3 @@ declare module "pdfjs" {

*/
outline(title: string, destination: string, parent?: string): void;
outline(title: string, destination: string, parent?: string | number): void;
}

@@ -134,0 +134,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc