Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jsreport/pdfjs

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsreport/pdfjs - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

4

lib/mixins/outlines.js

@@ -13,2 +13,6 @@ const PDF = require('../object')

for (const { title, parent, id } of aoutlines) {
if (!doc.catalog.properties.get('Dests').object.properties.get(id)) {
continue
}
const outline = new PDF.Object()

@@ -15,0 +19,0 @@ outline.data = { title, id, parent }

@@ -23,2 +23,6 @@ const PDF = require('../../object')

if (ext.catalog.properties.get('Outlines')?.object && doc.catalog.properties.get('Outlines') == null) {
doc.catalog.properties.set('Outlines', ext.catalog.properties.get('Outlines').object.toReference())
}
if (options.copyAccessibilityTags) {

@@ -25,0 +29,0 @@ mergeStructTree(ext, doc)

2

package.json
{
"name": "@jsreport/pdfjs",
"version": "1.1.0",
"version": "1.2.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -377,2 +377,30 @@ const { Document, External } = require('../')

it('append should copy outliness', async () => {
let document = new Document()
let external = new External(fs.readFileSync(path.join(__dirname, 'links.pdf')))
document.append(external)
document.outlines([{
title: '1 title',
id: '1'
}, {
title: '2 title',
id: '2',
parent: '1'
}])
const pdfWithOutlines = await document.asBuffer()
document = new Document()
external = new External(pdfWithOutlines)
document.append(external)
const pdfBuffer = await document.asBuffer()
require('fs').writeFileSync('out.pdf', pdfBuffer)
const { catalog } = await validate(pdfBuffer)
const outlines = catalog.properties.get('Outlines').object
const outline1 = outlines.properties.get('First').object
outlines.properties.get('Last').object.should.be.eql(outline1)
})
it('merge should union Dests', async () => {

@@ -379,0 +407,0 @@ const document = new Document()

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