Socket
Socket
Sign inDemoInstall

pdfjs-dist-viewer-min-edge-annotation-fix

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pdfjs-dist-viewer-min-edge-annotation-fix

Generic minified build of Mozilla's PDF.js library including the viewer component and a fix to gracefully handling exceptions during annotation creation.


Version published
Weekly downloads
17
decreased by-98.07%
Maintainers
1
Install size
8.74 MB
Created
Weekly downloads
 

Readme

Source

PDF.js Minified Distribution With Viewer

Annotation fix:

  • this release includes a fix to gracefully handle exceptions during annotation creation caused by invalid URIs on Edge.
  • Without this fix, a single malformed annotation (e.g. http:myurl.9a) leads to an error on Microsoft Edge, resulting in the document not being rendered at all.
  • This fix skips simply skips annotations that threw an error during annotation creation. Therefore, all URIs that could be properly parsed will appear in the PDF without causing the overall PDF creation to fail.
get annotations() {
    var annotations = [];
    var annotationRefs = this.getInheritedPageProp('Annots') || [];
    for (var i = 0, n = annotationRefs.length; i < n; ++i) {
      var annotationRef = annotationRefs[i];
      
      try {
        var annotation = AnnotationFactory.create(this.xref, annotationRef,
                                    this.pdfManager,
                                    this.idFactory);
        if (annotation) {
        annotations.push(annotation);
        }
      } catch (ex) {
        console.error('PDFDocument: cannot create annotation', ex);
      }
    }
    return shadow(this, 'annotations', annotations);
    },
};

PDF.js is a Portable Document Format (PDF) library that is built with HTML5. Its goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs.

This is a pre-built version of the PDF.js source code. I was unable to find a distribution of PDF.js that was both minified and included the viewer.html component. This is essentially just the files produced by running: gulp minified against the upstream repo.

See https://github.com/mozilla/pdf.js for learning and contributing.

Keywords

FAQs

Last updated on 08 Feb 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc