Commit 42f5c986 authored by Robert Knight's avatar Robert Knight

Add an example usage of the `PDFMetadata` class

parent 0df4959c
...@@ -19,6 +19,13 @@ const { normalizeURI } = require('../util/url'); ...@@ -19,6 +19,13 @@ const { normalizeURI } = require('../util/url');
/** /**
* PDFMetadata extracts metadata about a loading/loaded PDF document from a * PDFMetadata extracts metadata about a loading/loaded PDF document from a
* PDF.js PDFViewerApplication object. * PDF.js PDFViewerApplication object.
*
* @example
* // Invoke in a PDF.js viewer, before or after the PDF has finished loading.
* const meta = new PDFMetadata(window.PDFViewerApplication)
* meta.getUri().then(uri => {
* // Do something with the URL of the PDF.
* })
*/ */
class PDFMetadata { class PDFMetadata {
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment