How to use the pdfjs-dist.getFilenameFromUrl function in pdfjs-dist

To help you get started, we’ve selected a few pdfjs-dist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github forthealllight / react-read-pdf / src / components / MobilePDFReader / index.tsx View on Github external
private setTitleUsingUrl (url) {
    let title = pdfjsLib.getFilenameFromUrl(url) || url;
    try {
      title = decodeURIComponent(title);
    } catch (e) {
      // decodeURIComponent may throw URIError,
      // fall back to using the unprocessed url in that case
    }
    this.setTitle(title);
  }
  private setTitleUsingMetadata (pdfDocument) {
github rahul2104 / reactjs-pdf-reader / src / components / MobilePDFReader / index.tsx View on Github external
private setTitleUsingUrl (url) {
    let title = pdfjsLib.getFilenameFromUrl(url) || url;
    try {
      title = decodeURIComponent(title);
    } catch (e) {
      // decodeURIComponent may throw URIError,
      // fall back to using the unprocessed url in that case
    }
    this.setTitle(title);
  }
  private setTitleUsingMetadata (pdfDocument) {