{
  "id": "task_libraries:pdf-viewer/javascript",
  "path": "/exapedia/javascript-pdf-viewer-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "JavaScript PDF viewer libraries",
  "answer": [
    {
      "t": "text",
      "text": "JavaScript PDF viewer libraries render PDF pages inside a web page instead of the browser's built-in viewer. A viewer draws each page to a canvas or SVG layer with selectable text above it. These libraries let document portals, contract tools, and AI research apps show, search, and annotate PDFs in their own interface."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "JavaScript PDF viewer libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#pdf-js",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F130"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-pdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pdftron-webviewer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F160"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-pdf-viewer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F174"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ngtwo-pdf-viewer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F191"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ngx-extended-pdf-viewer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F206"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#embedpdf-snippet",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F221"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#vue-pdf-embed",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F239"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "npm"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#pdf-js",
          "label": [
            {
              "t": "fact",
              "fact": "F1"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F2"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Full viewer toolbar",
            "New ink/free-text annotations"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#pdf-js",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F130"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-pdf",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pdftron-webviewer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F160"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#react-pdf-viewer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F174"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ngtwo-pdf-viewer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F191"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ngx-extended-pdf-viewer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F206"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#embedpdf-snippet",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F221"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#vue-pdf-embed",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F239"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "pdf-js",
          "name": [
            {
              "t": "fact",
              "fact": "F130"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/mozilla/pdf.js"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/pdfjs-dist"
            },
            {
              "label": "Docs",
              "href": "https://mozilla.github.io/pdf.js/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F11"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://mozilla.github.io/pdf.js/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F12"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist';\nGlobalWorkerOptions.workerSrc = new URL('pdfjs-dist/build/pdf.worker.mjs', import.meta.url).toString();\nconst pdf = await getDocument('/example.pdf').promise;\nconst page = await pdf.getPage(1);\nconst viewport = page.getViewport({ scale: 1 });\nconst canvas = document.createElement('canvas');\ncanvas.width = viewport.width;\ncanvas.height = viewport.height;\ndocument.body.appendChild(canvas);\nawait page.render({ canvas, viewport }).promise;\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/pdfjs-dist@6.5.438/types/src/display/api.d.ts",
                  "label": [
                    {
                      "t": "text",
                      "text": "helloworld.html"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20React%20application%20projects%20using%20pdfjs-dist%20for%20PDF%20page%20rendering%2C%20viewing%2C%20page%20navigation%2C%20text%20selection%20and%20document%20errors&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F135"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "react-pdf",
          "name": [
            {
              "t": "fact",
              "fact": "F143"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/wojtekmaj/react-pdf"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/react-pdf"
            },
            {
              "label": "Docs",
              "href": "https://github.com/wojtekmaj/react-pdf#readme"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F37"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/wojtekmaj/react-pdf#readme",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F143"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/ToolJet/ToolJet",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F158"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "jsx",
              "code": "const renderPDF = () => {\n    if (isPasswordPromptClosed)\n      return (\n        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', flexDirection: 'column' }}>\n          <p style={{ marginBottom: '6px' }}>Password prompt closed</p>\n          <button\n            class=\"pdf-retry-button\"\n            data-cy=\"draggable-widget-button3\"\n            type=\"default\"\n            onClick={() => setIsPasswordPromptClosed(false)}\n          >\n            <div>\n              <div>\n                <span>\n                  <p class=\"tj-text-sm\">Retry</p>\n                </span>\n              </div>\n            </div>\n          </button>\n        </div>\n      );\n    return (\n      <Document\n        file={url}\n        onLoadSuccess={onDocumentLoadSuccess}\n        onLoadError={onDocumentLoadError}\n        onPassword={onPassword}\n        className=\"pdf-document\"\n      >\n        {Array.from(new Array(numPages), (el, index) => (\n          <Page\n            pageNumber={index + 1}\n            width={scale ? width - 12 : undefined}\n            height={scale ? undefined : height}\n            key={`page_${index + 1}`}\n            inputRef={(el) => (pageRef.current[index] = el)}\n          />\n        ))}\n      </Document>\n    );\n  };",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/ToolJet/ToolJet/blob/db08a3a221a77cb8a1e0eaeeed9d00db0dda709d/frontend/src/AppBuilder/Widgets/PDF.jsx#L152-L192",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F157"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20React%20application%20projects%20using%20react-pdf%20for%20PDF%20page%20rendering%2C%20viewing%2C%20page%20navigation%2C%20text%20selection%20and%20document%20errors&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F143"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "jsx",
              "code": "import { Document, Page, pdfjs } from 'react-pdf';\nimport 'react-pdf/dist/Page/AnnotationLayer.css';\nimport 'react-pdf/dist/Page/TextLayer.css';\npdfjs.GlobalWorkerOptions.workerSrc = new URL('pdfjs-dist/build/pdf.worker.min.mjs', import.meta.url).toString();\nexport default function PdfExample() {\n  return <Document file=\"/example.pdf\"><Page pageNumber={1} /></Document>;\n}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/wojtekmaj/react-pdf/blob/main/packages/react-pdf/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "Sample.tsx"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F148"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pdftron-webviewer",
          "name": [
            {
              "t": "fact",
              "fact": "F160"
            }
          ],
          "links": [
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@pdftron/webviewer"
            },
            {
              "label": "Docs",
              "href": "https://docs.apryse.com/web/guides"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F167"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.apryse.com/web/guides",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F160"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import WebViewer from '@pdftron/webviewer';\nawait WebViewer.WebComponent({\n  path: '/webviewer/lib',\n  initialDoc: '/example.pdf',\n  licenseKey: 'YOUR_LICENSE_KEY',\n}, document.getElementById('viewer'));\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.apryse.com/web/guides/get-started/react",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=%40pdftron/webviewer%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F160"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F165"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "react-pdf-viewer",
          "name": [
            {
              "t": "fact",
              "fact": "F174"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/react-pdf-viewer/react-pdf-viewer"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@react-pdf-viewer/core"
            },
            {
              "label": "Docs",
              "href": "https://react-pdf-viewer.dev"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F63"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://react-pdf-viewer.dev",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F174"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F70"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F71"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/Zipstack/unstract",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F189"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "jsx",
              "code": "function PdfViewer({ fileUrl, highlightData, currentHighlightIndex, onError }) {\n  const newPlugin = defaultLayoutPlugin();\n  const pageNavigationPluginInstance = pageNavigationPlugin();\n  const { jumpToPage } = pageNavigationPluginInstance;\n  const parentRef = useRef(null);\n\n  // Retry key to force re-render when retrying\n  const [retryKey, setRetryKey] = useState(0);\n  const [loadError, setLoadError] = useState(null);\n\n  // Clear error state when fileUrl changes to prevent stale notifications\n  useEffect(() => {\n    setLoadError(null);\n  }, [fileUrl]);\n\n  const handleRetry = useCallback(() => {\n    setRetryKey((prev) => prev + 1);\n    setLoadError(null);\n  }, []);\n\n  // Notify parent of load errors via useEffect to avoid side effects during render\n  useEffect(() => {\n    if (loadError && onError) {\n      onError(loadError);\n    }\n  }, [loadError, onError]);\n\n  // Render error fallback for PDF load failures — pure render, no side effects\n  const renderError = useCallback(\n    (error) => (\n      <PdfLoadError\n        error={error}\n        onRetry={handleRetry}\n        reportError={setLoadError}\n      />\n    ),\n    [handleRetry],\n  );\n\n  function removeZerosAndDeleteIfAllZero(highlightData) {\n    if (Array.isArray(highlightData)) {\n      return highlightData\n        ?.filter((innerArray) => {\n          if (!Array.isArray(innerArray)) {\n            return false;\n          }\n          // Strip 5th element (confidence) if present, keep only first 4 elements\n          const coordsOnly =\n            innerArray.length >= 5 ? innerArray.slice(0, 4) : innerArray;\n          return coordsOnly.some((value) => value !== 0);\n        })\n        .map((innerArray) => {\n          // Return only the first 4 elements (strip confidence)\n          return innerArray.length >= 5 ? innerArray.slice(0, 4) : innerArray;\n        });\n    }\n  }\n\n  const processHighlightData = highlightData\n    ? removeZerosAndDeleteIfAllZero(highlightData)\n    : [];\n\n  const processedHighlightData =\n    processHighlightData?.length > 0 ? processHighlightData : [[0, 0, 0, 0]];\n\n  // Determine current highlight data\n  const currentHighlightData = useMemo(() => {\n    if (\n      RenderHighlights &&\n      Array.isArray(processedHighlightData) &&\n      processedHighlightData?.length > 0\n    ) {\n      return currentHighlightIndex !== null &&\n        currentHighlightIndex < processedHighlightData.length\n        ? [processedHighlightData[currentHighlightIndex]]\n        : processedHighlightData;\n    }\n    return null;\n  }, [processedHighlightData, currentHighlightIndex]);\n\n  // Always create both plugins at top level to maintain hook order\n  const baseHighlightPlugin = highlightPlugin();\n  const customHighlightPlugin = highlightPlugin({\n    renderHighlights:\n      currentHighlightData && RenderHighlights\n        ? (props) => (\n            <RenderHighlights {...props} highlightData={currentHighlightData} />\n          )\n        : undefined,\n  });\n\n  // Choose which plugin to use\n  const highlightPluginInstance = currentHighlightData\n    ? customHighlightPlugin\n    : baseHighlightPlugin;\n\n  // Jump to page when highlightData changes or when navigating through highlights\n  useEffect(() => {\n    const cleanedHighlightData = removeZerosAndDeleteIfAllZero(highlightData);\n    if (cleanedHighlightData && cleanedHighlightData.length > 0) {\n      // Use currentHighlightIndex if provided, otherwise default to first highlight\n      const index =\n        currentHighlightIndex !== null &&\n        currentHighlightIndex < cleanedHighlightData.length\n          ? currentHighlightIndex\n          : 0;\n      const pageNumber = cleanedHighlightData[index][0]; // Get page number from current highlight\n\n      if (pageNumber !== null && pageNumber !== undefined && jumpToPage) {\n        setTimeout(() => {\n          jumpToPage(pageNumber); // jumpToPage is 0-indexed\n        }, 100); // Add a slight delay to ensure proper page rendering\n      }\n    }\n  }, [highlightData, jumpToPage, currentHighlightIndex]); // Changed dependency to highlightData instead of processedHighlightData\n\n  // Show empty state when no URL is provided\n  if (!fileUrl) {\n    return (\n      <div ref={parentRef} className=\"doc-manager-body pdf-viewer-error\">\n        <Result\n          icon={<FileWarning style={{ color: \"var(--warning)\" }} />}\n          title=\"No PDF Available\"\n          subTitle=\"The PDF document URL is not available. Please ensure the document has been processed correctly.\"\n        />\n      </div>\n    );\n  }\n\n  return (\n    <div ref={parentRef} className=\"doc-manager-body\" key={retryKey}>\n      <Worker workerUrl={PDF_WORKER_URL}>\n        <Viewer\n          fileUrl={fileUrl}\n          plugins={[\n            newPlugin,\n            pageNavigationPluginInstance,\n            highlightPluginInstance,\n          ]}\n          renderError={renderError}\n        />\n      </Worker>\n    </div>\n  );\n}",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/Zipstack/unstract/blob/0cf6b9871675c43fb3f2353e1f3d56dcc07a48fa/frontend/src/components/custom-tools/pdf-viewer/PdfViewer.jsx#L50-L194",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F188"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20React%20application%20projects%20using%20%40react-pdf-viewer/core%20for%20PDF%20page%20rendering%2C%20viewing%2C%20page%20navigation%2C%20text%20selection%20and%20document%20errors&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F174"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "jsx",
              "code": "import { Viewer, Worker } from '@react-pdf-viewer/core';\nimport '@react-pdf-viewer/core/lib/styles/index.css';\nexport default function PdfExample() {\n  return <div style={{ height: '600px' }}><Worker workerUrl=\"https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js\"><Viewer fileUrl=\"/example.pdf\" /></Worker></div>;\n}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://react-pdf-viewer.dev/docs/basic-usage/",
                  "label": [
                    {
                      "t": "text",
                      "text": "App.tsx"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F179"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "ngtwo-pdf-viewer",
          "name": [
            {
              "t": "fact",
              "fact": "F191"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/VadimDez/ng2-pdf-viewer"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/ng2-pdf-viewer"
            },
            {
              "label": "Docs",
              "href": "https://github.com/VadimDez/ng2-pdf-viewer#readme"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F198"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/VadimDez/ng2-pdf-viewer#readme",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F191"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "typescript",
              "code": "import { Component } from '@angular/core';\nimport { PdfViewerModule } from 'ng2-pdf-viewer';\n@Component({ standalone: true, selector: 'app-pdf-example', imports: [PdfViewerModule], template: '<pdf-viewer [src]=\"source\" [render-text]=\"true\" style=\"display:block;width:100%;height:600px\"></pdf-viewer>' })\nexport class PdfExample { source = '/example.pdf'; }\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/VadimDez/ng2-pdf-viewer/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=ng2-pdf-viewer%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F191"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F196"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "ngx-extended-pdf-viewer",
          "name": [
            {
              "t": "fact",
              "fact": "F206"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/stephanrauh/ngx-extended-pdf-viewer"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/ngx-extended-pdf-viewer"
            },
            {
              "label": "Docs",
              "href": "https://pdfviewer.net"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F213"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pdfviewer.net",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F206"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "typescript",
              "code": "import { Component } from '@angular/core';\nimport { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';\n\n@Component({\n  selector: 'app-pdf-viewer',\n  standalone: true,\n  imports: [NgxExtendedPdfViewerModule],\n  template: `<ngx-extended-pdf-viewer [src]=\"'assets/example.pdf'\"></ngx-extended-pdf-viewer>`,\n})\nexport class PdfViewerComponent {}\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://www.npmjs.com/package/ngx-extended-pdf-viewer",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=ngx-extended-pdf-viewer%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F206"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F211"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "embedpdf-snippet",
          "name": [
            {
              "t": "fact",
              "fact": "F221"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/embedpdf/embed-pdf-viewer"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@embedpdf/snippet"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F254"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://www.npmjs.com/package/@embedpdf/snippet",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F221"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/grimmory-tools/grimmory",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F237"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "searchAllPages(keyword: string): void {\n    if (!this.search) return;\n    const docId = this.currentDocumentId || undefined;\n    const task = this.search.searchAllPages(keyword, docId);\n    // After search completes, scroll to the first result\n    task.wait(() => {\n      this.scrollToActiveSearchResult();\n    }, () => { /* search failed or cancelled */ });\n  }",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/grimmory-tools/grimmory/blob/4f0ae626c9fba9dcbc925fd2bb53c262fcecec5f/frontend/src/app/features/readers/pdf-reader/services/embedpdf-book.service.ts#L328-L336",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F236"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=%40embedpdf/snippet%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F221"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "<div id=\"pdf-viewer\" style=\"height: 500px\"></div>\n<script async type=\"module\">\n  import EmbedPDF from 'https://cdn.jsdelivr.net/npm/@embedpdf/snippet@2/dist/embedpdf.js';\n\n  const viewer = EmbedPDF.init({\n    type: 'container', // mount strategy\n    target: document.getElementById('pdf-viewer'),\n    src: 'https://snippet.embedpdf.com/ebook.pdf', // your PDF URL\n  });\n</script>\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://registry.npmjs.org/@embedpdf/snippet/2.15.1",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F226"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "vue-pdf-embed",
          "name": [
            {
              "t": "fact",
              "fact": "F239"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/hrynko/vue-pdf-embed"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/vue-pdf-embed"
            },
            {
              "label": "Docs",
              "href": "https://github.com/hrynko/vue-pdf-embed#readme"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F246"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/hrynko/vue-pdf-embed#readme",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F239"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "<script setup>\nimport VuePdfEmbed from 'vue-pdf-embed';\nimport 'vue-pdf-embed/dist/styles/annotationLayer.css';\nimport 'vue-pdf-embed/dist/styles/textLayer.css';\nconst source = '/example.pdf';\n</script>\n<template><VuePdfEmbed annotation-layer text-layer :source=\"source\" /></template>\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/hrynko/vue-pdf-embed/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=vue-pdf-embed%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F239"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F244"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which JavaScript PDF viewer library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#pdf-js",
          "label": [
            {
              "t": "text",
              "text": "PDF.js"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits apps that build their own viewer on a rendering engine. "
        },
        {
          "t": "link",
          "href": "#react-pdf",
          "label": [
            {
              "t": "text",
              "text": "React-PDF"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits React apps that display PDF pages as components. "
        },
        {
          "t": "link",
          "href": "#ngx-extended-pdf-viewer",
          "label": [
            {
              "t": "text",
              "text": "ngx-extended-pdf-viewer"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits Angular apps that want a full toolbar and sidebar."
        }
      ]
    },
    {
      "q": "What is pdfjs-dist?",
      "a": [
        {
          "t": "text",
          "text": "pdfjs-dist is the npm package for "
        },
        {
          "t": "link",
          "href": "#pdf-js",
          "label": [
            {
              "t": "text",
              "text": "PDF.js"
            }
          ]
        },
        {
          "t": "text",
          "text": ", the PDF renderer from Mozilla. It parses and renders PDFs through a display API and viewer components."
        }
      ]
    },
    {
      "q": "What is the best React PDF viewer?",
      "a": [
        {
          "t": "link",
          "href": "#react-pdf",
          "label": [
            {
              "t": "text",
              "text": "React-PDF"
            }
          ]
        },
        {
          "t": "text",
          "text": " displays PDF documents and pages as React components. "
        },
        {
          "t": "link",
          "href": "#react-pdf-viewer",
          "label": [
            {
              "t": "text",
              "text": "React PDF Viewer"
            }
          ]
        },
        {
          "t": "text",
          "text": " adds an optional toolbar and other features through plugins."
        }
      ]
    },
    {
      "q": "How do I show a PDF in Angular?",
      "a": [
        {
          "t": "link",
          "href": "#ngx-extended-pdf-viewer",
          "label": [
            {
              "t": "text",
              "text": "ngx-extended-pdf-viewer"
            }
          ]
        },
        {
          "t": "text",
          "text": " embeds a configurable viewer with a toolbar and sidebar in an Angular app. "
        },
        {
          "t": "link",
          "href": "#ngtwo-pdf-viewer",
          "label": [
            {
              "t": "fact",
              "fact": "F191"
            }
          ]
        },
        {
          "t": "text",
          "text": " renders PDF pages as an Angular component without a toolbar."
        }
      ]
    },
    {
      "q": "What is Apryse WebViewer?",
      "a": [
        {
          "t": "link",
          "href": "#pdftron-webviewer",
          "label": [
            {
              "t": "text",
              "text": "Apryse WebViewer"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a commercial JavaScript document SDK with a UI component library. It ships a full viewer toolbar and annotation tools."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, pdfjs-dist",
      "display": "PDF.js",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, pdfjs-dist",
      "display": "205.4M",
      "asOf": "2026-11-15"
    },
    "F3": {
      "label": "License, pdfjs-dist",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, pdfjs-dist",
      "display": "6.5.438",
      "asOf": "2026-11-17"
    },
    "F5": {
      "label": "Undated package release, pdfjs-dist",
      "display": "v6.5.438",
      "asOf": "2026-11-17"
    },
    "F6": {
      "label": "Repository stars, pdfjs-dist",
      "display": "54.1K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Renders PDF pages, pdfjs-dist",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Navigates PDF pages, pdfjs-dist",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Works without React, pdfjs-dist",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Install, pdfjs-dist",
      "display": "npm install pdfjs-dist",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "What it does, pdfjs-dist",
      "display": "Parses and renders PDFs through a JavaScript display API and viewer components.",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "strengths lead, pdfjs-dist",
      "display": "Controls page rendering directly",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths, pdfjs-dist",
      "display": "Set the viewport and render each page into a chosen context.",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths lead, pdfjs-dist",
      "display": "Includes a complete viewer layer",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths, pdfjs-dist",
      "display": "Adapt the provided viewer instead of building every control.",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "limitations lead, pdfjs-dist",
      "display": "High-resolution pages consume canvas memory",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations, pdfjs-dist",
      "display": "Render visible pages instead of retaining every page canvas.",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations lead, pdfjs-dist",
      "display": "Remote PDFs need server permission",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations, pdfjs-dist",
      "display": "Enable CORS or use an application proxy for cross-origin documents.",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "Quickstart, pdfjs-dist",
      "display": "<!doctype html>\n<html>\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>'Hello, world!' example</title>\n  </head>\n  <body>\n    <h1>'Hello, world!' example</h1>\n\n    <canvas id=\"the-canvas\" style=\"border: 1px solid black; direction: ltr\"></canvas>\n\n    <script src=\"../../node_modules/pdfjs-dist/build/pdf.mjs\" type=\"module\"></script>\n\n    <script id=\"script\" type=\"module\">\n      //\n      // If absolute URL from the remote server is provided, configure the CORS\n      // header on that server.\n      //\n      const url = \"./helloworld.pdf\";\n\n      //\n      // The workerSrc property shall be specified.\n      //\n      pdfjsLib.GlobalWorkerOptions.workerSrc = \"../../node_modules/pdfjs-dist/build/pdf.worker.mjs\";\n\n      //\n      // Asynchronous download PDF\n      //\n      const loadingTask = pdfjsLib.getDocument({ url });\n      const pdf = await loadingTask.promise;\n      //\n      // Fetch the first page\n      //\n      const page = await pdf.getPage(1);\n      const scale = 1.5;\n      const viewport = page.getViewport({ scale });\n      // Support HiDPI-screens.\n      const outputScale = window.devicePixelRatio || 1;\n\n      //\n      // Prepare canvas using PDF page dimensions\n      //\n      const canvas = document.getElementById(\"the-canvas\");\n      const context = canvas.getContext(\"2d\");\n\n      canvas.width = Math.floor(viewport.width * outputScale);\n      canvas.height = Math.floor(viewport.height * outputScale);\n      canvas.style.width = Math.floor(viewport.width) + \"px\";\n      canvas.style.height = Math.floor(viewport.height) + \"px\";\n\n      const transform = outputScale !== 1 ? [outputScale, 0, 0, outputScale, 0, 0] : null;\n\n      //\n      // Render PDF page into canvas context\n      //\n      const renderContext = {\n        canvasContext: context,\n        transform,\n        viewport,\n      };\n      page.render(renderContext);\n    </script>\n\n    <hr />\n    <h2>JavaScript code:</h2>\n    <pre id=\"code\"></pre>\n    <script>\n      document.getElementById(\"code\").textContent = document.getElementById(\"script\").text;\n    </script>\n  </body>\n</html>\n",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Project function, pdfjs-dist",
      "display": "export async function pdfToImageDataURLs(pdfBuffer: ArrayBuffer, imageMimeType: string, imageQuality: number /* = 0.95 */, scale: number /*= 1.5*/, onProgress: (progress: number) => void): Promise<PdfPageImage[]> {\n  const { getDocument } = await dynamicImportPdfJs().catch(error => {\n    console.warn('pdfToImageDataURLs: Failed to load pdfjs-dist', error);\n    return { getDocument: null };\n  });\n  if (!getDocument) {\n    console.log('[DEV] pdfToImageDataURLs: pdfjs-dist loading skipped');\n    return [];\n  }\n  const pdf = await getDocument({ data: pdfBuffer }).promise;\n  const images: PdfPageImage[] = [];\n\n  for (let i = 1; i <= pdf.numPages; i++) {\n\n    const page = await pdf.getPage(i);\n    onProgress(i / pdf.numPages);\n\n    const viewport = page.getViewport({ scale });\n    const canvas = document.createElement('canvas');\n    const context = canvas.getContext('2d')!;\n    canvas.height = viewport.height;\n    canvas.width = viewport.width;\n    onProgress((i * 3 + 1) / (pdf.numPages * 3));\n\n    await page.render({\n      canvasContext: context,\n      canvas,\n      viewport,\n    }).promise;\n\n    // Convert canvas image to a DataURL string\n    try {\n      const { mimeType: actualMimeType, base64Data } = canvasToDataURLAndMimeType(canvas, imageMimeType, imageQuality, 'pdf-to-image');\n      images.push({\n        mimeType: actualMimeType,\n        base64Data,\n        scale,\n        width: viewport.width,\n        height: viewport.height,\n      });\n    } catch (error) {\n      console.warn(`pdfToImageDataURLs: failed to convert image to ${imageMimeType}.`, { error });\n    }\n    onProgress((i * 3 + 2) / (pdf.numPages * 3));\n  }\n\n  onProgress(1);\n  return images;\n}\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function reference, pdfjs-dist",
      "display": "pdfUtils.ts · pdfToImageDataURLs()",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project repository, pdfjs-dist",
      "display": "enricoros/big-AGI",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project stars, enricoros/big-AGI",
      "display": "7.2K",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project push date, enricoros/big-AGI",
      "display": "Nov 2026",
      "asOf": "2026-11-14"
    },
    "F26": {
      "label": "Library name, react-pdf",
      "display": "React-PDF",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Monthly downloads, react-pdf",
      "display": "36.0M",
      "asOf": "2026-11-15"
    },
    "F28": {
      "label": "License, react-pdf",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Package release, react-pdf",
      "display": "11.1.0",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Undated package release, react-pdf",
      "display": "v11.1.0",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Repository stars, react-pdf",
      "display": "11.2K",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Renders PDF pages, react-pdf",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Displays selectable text, react-pdf",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Navigates PDF pages, react-pdf",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Works without React, react-pdf",
      "display": "Unsupported",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Install, react-pdf",
      "display": "npm install react-pdf @wojtekmaj/react-hooks react-error-boundary",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "What it does, react-pdf",
      "display": "Displays PDF documents and pages inside React applications.",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths lead, react-pdf",
      "display": "Composes document and page components",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths, react-pdf",
      "display": "Render a Document and choose pages through Page components.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths lead, react-pdf",
      "display": "Renders text and link layers",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths, react-pdf",
      "display": "Include the text and annotation stylesheets for correctly displayed layers.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations lead, react-pdf",
      "display": "Requires an exactly matching worker",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations, react-pdf",
      "display": "Keep the PDF.js worker and React-PDF dependency versions synchronized.",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations lead, react-pdf",
      "display": "Legacy browsers need bundler configuration",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations, react-pdf",
      "display": "Use the legacy PDF.js main build and viewer module.",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Quickstart, react-pdf",
      "display": "import { Suspense, useCallback, useId, useState } from 'react';\nimport { useResizeObserver } from '@wojtekmaj/react-hooks';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { Document, Page, pdfjs } from 'react-pdf';\nimport 'react-pdf/dist/Page/AnnotationLayer.css';\nimport 'react-pdf/dist/Page/TextLayer.css';\n\nimport './Sample.css';\n\nimport type { PDFDocumentProxy } from 'pdfjs-dist';\n\npdfjs.GlobalWorkerOptions.workerSrc = new URL(\n  'pdfjs-dist/build/pdf.worker.min.mjs',\n  import.meta.url,\n).toString();\n\nconst options = {\n  cMapUrl: '/cmaps/',\n  standardFontDataUrl: '/standard_fonts/',\n  wasmUrl: '/wasm/',\n};\n\nconst resizeObserverOptions = {};\n\nconst maxWidth = 800;\n\ntype PDFFile = string | File | null;\n\nexport default function Sample() {\n  const fileId = useId();\n  const [file, setFile] = useState<PDFFile>('./sample.pdf');\n  const [numPages, setNumPages] = useState<number>();\n  const [containerRef, setContainerRef] = useState<HTMLElement | null>(null);\n  const [containerWidth, setContainerWidth] = useState<number>();\n\n  const onResize = useCallback<ResizeObserverCallback>((entries) => {\n    const [entry] = entries;\n\n    if (entry) {\n      setContainerWidth(entry.contentRect.width);\n    }\n  }, []);\n\n  useResizeObserver(containerRef, resizeObserverOptions, onResize);\n\n  function onFileChange(event: React.ChangeEvent<HTMLInputElement>): void {\n    const { files } = event.target;\n\n    const nextFile = files?.[0];\n\n    if (nextFile) {\n      setFile(nextFile);\n    }\n  }\n\n  function onDocumentLoadSuccess({ numPages: nextNumPages }: PDFDocumentProxy): void {\n    setNumPages(nextNumPages);\n  }\n\n  return (\n    <div className=\"Example\">\n      <header>\n        <h1>react-pdf sample page</h1>\n      </header>\n      <div className=\"Example__container\">\n        <div className=\"Example__container__load\">\n          <label htmlFor={fileId}>Load from file:</label>{' '}\n          <input id={fileId} onChange={onFileChange} type=\"file\" />\n        </div>\n        <div className=\"Example__container__document\" ref={setContainerRef}>\n          <ErrorBoundary fallback={<p role=\"alert\">Failed to load PDF.</p>} resetKeys={[file]}>\n            <Suspense fallback={<p>Loading PDF…</p>}>\n              <Document file={file} onLoadSuccess={onDocumentLoadSuccess} options={options}>\n                {Array.from(new Array(numPages), (_el, index) => (\n                  <Page\n                    // biome-ignore lint/suspicious/noArrayIndexKey: index is stable here\n                    key={`page_${index + 1}`}\n                    pageNumber={index + 1}\n                    width={containerWidth ? Math.min(containerWidth, maxWidth) : maxWidth}\n                  />\n                ))}\n              </Document>\n            </Suspense>\n          </ErrorBoundary>\n        </div>\n      </div>\n    </div>\n  );\n}\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function, react-pdf",
      "display": "const renderPDF = () => {\n    if (isPasswordPromptClosed)\n      return (\n        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', flexDirection: 'column' }}>\n          <p style={{ marginBottom: '6px' }}>Password prompt closed</p>\n          <button\n            class=\"pdf-retry-button\"\n            data-cy=\"draggable-widget-button3\"\n            type=\"default\"\n            onClick={() => setIsPasswordPromptClosed(false)}\n          >\n            <div>\n              <div>\n                <span>\n                  <p class=\"tj-text-sm\">Retry</p>\n                </span>\n              </div>\n            </div>\n          </button>\n        </div>\n      );\n    return (\n      <Document\n        file={url}\n        onLoadSuccess={onDocumentLoadSuccess}\n        onLoadError={onDocumentLoadError}\n        onPassword={onPassword}\n        className=\"pdf-document\"\n      >\n        {Array.from(new Array(numPages), (el, index) => (\n          <Page\n            pageNumber={index + 1}\n            width={scale ? width - 12 : undefined}\n            height={scale ? undefined : height}\n            key={`page_${index + 1}`}\n            inputRef={(el) => (pageRef.current[index] = el)}\n          />\n        ))}\n      </Document>\n    );\n  };\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project function reference, react-pdf",
      "display": "PDF.jsx · renderPDF()",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project repository, react-pdf",
      "display": "ToolJet/ToolJet",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project stars, ToolJet/ToolJet",
      "display": "41.2K",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project push date, ToolJet/ToolJet",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F52": {
      "label": "Library name, @react-pdf-viewer/core",
      "display": "React PDF Viewer",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Monthly downloads, @react-pdf-viewer/core",
      "display": "1.7M",
      "asOf": "2026-11-15"
    },
    "F54": {
      "label": "License, @react-pdf-viewer/core",
      "display": "https://react-pdf-viewer.dev/license",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Package release, @react-pdf-viewer/core",
      "display": "3.12.0",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Undated package release, @react-pdf-viewer/core",
      "display": "v3.12.0",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Repository stars, @react-pdf-viewer/core",
      "display": "2.6K",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Renders PDF pages, @react-pdf-viewer/core",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Displays selectable text, @react-pdf-viewer/core",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Navigates PDF pages, @react-pdf-viewer/core",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Works without React, @react-pdf-viewer/core",
      "display": "Unsupported",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Install, @react-pdf-viewer/core",
      "display": "npm install @react-pdf-viewer/core@3.12.0 @react-pdf-viewer/default-layout@3.12.0 pdfjs-dist@3.4.120",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "What it does, @react-pdf-viewer/core",
      "display": "Displays PDF documents through React components with optional viewer plugins.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths lead, @react-pdf-viewer/core",
      "display": "Adds navigation through plugins",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths, @react-pdf-viewer/core",
      "display": "Add page controls through the page-navigation or default-layout plugin.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths lead, @react-pdf-viewer/core",
      "display": "Customizes protected-document prompts",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "strengths, @react-pdf-viewer/core",
      "display": "Use renderProtectedView to provide a password-entry interface.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations lead, @react-pdf-viewer/core",
      "display": "Requires older PDF.js majors",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations, @react-pdf-viewer/core",
      "display": "Version 3.12 accepts PDF.js 2 or 3, rather than the latest major.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations lead, @react-pdf-viewer/core",
      "display": "Worker versions must match",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "limitations, @react-pdf-viewer/core",
      "display": "Serve a worker matching the installed PDF.js version.",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Quickstart, @react-pdf-viewer/core",
      "display": "import { ScrollMode, ViewMode, Viewer } from '@react-pdf-viewer/core';\nimport '@react-pdf-viewer/core/lib/styles/index.css';\nimport { defaultLayoutPlugin } from '@react-pdf-viewer/default-layout';\nimport '@react-pdf-viewer/default-layout/lib/styles/index.css';\nimport * as React from 'react';\n\nconst App = () => {\n    const defaultLayoutPluginInstance = defaultLayoutPlugin();\n\n    return (\n        <div\n            style={{\n                height: '50rem',\n                width: '50rem',\n                margin: '1rem auto',\n            }}\n        >\n            <Viewer\n                //defaultScale={0.5}\n                // scrollMode={ScrollMode.Page}\n                //viewMode={ViewMode.DualPageWithCover}\n                fileUrl={'/pdf-open-parameters.pdf'}\n                plugins={[defaultLayoutPluginInstance]}\n            />\n        </div>\n    );\n};\n\nexport default App;\n",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project function, @react-pdf-viewer/core",
      "display": "function PdfViewer({ fileUrl, highlightData, currentHighlightIndex, onError }) {\n  const newPlugin = defaultLayoutPlugin();\n  const pageNavigationPluginInstance = pageNavigationPlugin();\n  const { jumpToPage } = pageNavigationPluginInstance;\n  const parentRef = useRef(null);\n\n  // Retry key to force re-render when retrying\n  const [retryKey, setRetryKey] = useState(0);\n  const [loadError, setLoadError] = useState(null);\n\n  // Clear error state when fileUrl changes to prevent stale notifications\n  useEffect(() => {\n    setLoadError(null);\n  }, [fileUrl]);\n\n  const handleRetry = useCallback(() => {\n    setRetryKey((prev) => prev + 1);\n    setLoadError(null);\n  }, []);\n\n  // Notify parent of load errors via useEffect to avoid side effects during render\n  useEffect(() => {\n    if (loadError && onError) {\n      onError(loadError);\n    }\n  }, [loadError, onError]);\n\n  // Render error fallback for PDF load failures — pure render, no side effects\n  const renderError = useCallback(\n    (error) => (\n      <PdfLoadError\n        error={error}\n        onRetry={handleRetry}\n        reportError={setLoadError}\n      />\n    ),\n    [handleRetry],\n  );\n\n  function removeZerosAndDeleteIfAllZero(highlightData) {\n    if (Array.isArray(highlightData)) {\n      return highlightData\n        ?.filter((innerArray) => {\n          if (!Array.isArray(innerArray)) {\n            return false;\n          }\n          // Strip 5th element (confidence) if present, keep only first 4 elements\n          const coordsOnly =\n            innerArray.length >= 5 ? innerArray.slice(0, 4) : innerArray;\n          return coordsOnly.some((value) => value !== 0);\n        })\n        .map((innerArray) => {\n          // Return only the first 4 elements (strip confidence)\n          return innerArray.length >= 5 ? innerArray.slice(0, 4) : innerArray;\n        });\n    }\n  }\n\n  const processHighlightData = highlightData\n    ? removeZerosAndDeleteIfAllZero(highlightData)\n    : [];\n\n  const processedHighlightData =\n    processHighlightData?.length > 0 ? processHighlightData : [[0, 0, 0, 0]];\n\n  // Determine current highlight data\n  const currentHighlightData = useMemo(() => {\n    if (\n      RenderHighlights &&\n      Array.isArray(processedHighlightData) &&\n      processedHighlightData?.length > 0\n    ) {\n      return currentHighlightIndex !== null &&\n        currentHighlightIndex < processedHighlightData.length\n        ? [processedHighlightData[currentHighlightIndex]]\n        : processedHighlightData;\n    }\n    return null;\n  }, [processedHighlightData, currentHighlightIndex]);\n\n  // Always create both plugins at top level to maintain hook order\n  const baseHighlightPlugin = highlightPlugin();\n  const customHighlightPlugin = highlightPlugin({\n    renderHighlights:\n      currentHighlightData && RenderHighlights\n        ? (props) => (\n            <RenderHighlights {...props} highlightData={currentHighlightData} />\n          )\n        : undefined,\n  });\n\n  // Choose which plugin to use\n  const highlightPluginInstance = currentHighlightData\n    ? customHighlightPlugin\n    : baseHighlightPlugin;\n\n  // Jump to page when highlightData changes or when navigating through highlights\n  useEffect(() => {\n    const cleanedHighlightData = removeZerosAndDeleteIfAllZero(highlightData);\n    if (cleanedHighlightData && cleanedHighlightData.length > 0) {\n      // Use currentHighlightIndex if provided, otherwise default to first highlight\n      const index =\n        currentHighlightIndex !== null &&\n        currentHighlightIndex < cleanedHighlightData.length\n          ? currentHighlightIndex\n          : 0;\n      const pageNumber = cleanedHighlightData[index][0]; // Get page number from current highlight\n\n      if (pageNumber !== null && pageNumber !== undefined && jumpToPage) {\n        setTimeout(() => {\n          jumpToPage(pageNumber); // jumpToPage is 0-indexed\n        }, 100); // Add a slight delay to ensure proper page rendering\n      }\n    }\n  }, [highlightData, jumpToPage, currentHighlightIndex]); // Changed dependency to highlightData instead of processedHighlightData\n\n  // Show empty state when no URL is provided\n  if (!fileUrl) {\n    return (\n      <div ref={parentRef} className=\"doc-manager-body pdf-viewer-error\">\n        <Result\n          icon={<FileWarning style={{ color: \"var(--warning)\" }} />}\n          title=\"No PDF Available\"\n          subTitle=\"The PDF document URL is not available. Please ensure the document has been processed correctly.\"\n        />\n      </div>\n    );\n  }\n\n  return (\n    <div ref={parentRef} className=\"doc-manager-body\" key={retryKey}>\n      <Worker workerUrl={PDF_WORKER_URL}>\n        <Viewer\n          fileUrl={fileUrl}\n          plugins={[\n            newPlugin,\n            pageNavigationPluginInstance,\n            highlightPluginInstance,\n          ]}\n          renderError={renderError}\n        />\n      </Worker>\n    </div>\n  );\n}\n",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Project function reference, @react-pdf-viewer/core",
      "display": "PdfViewer.jsx · PdfViewer()",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project repository, @react-pdf-viewer/core",
      "display": "Zipstack/unstract",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Project stars, Zipstack/unstract",
      "display": "7.5K",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Project push date, Zipstack/unstract",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F78": {
      "label": "Library name, pdfobject",
      "display": "PDFObject",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Monthly downloads, pdfobject",
      "display": "639.3K",
      "asOf": "2026-11-15"
    },
    "F80": {
      "label": "License, pdfobject",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Package release, pdfobject",
      "display": "2.3.1",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Undated package release, pdfobject",
      "display": "v2.3.1",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Repository stars, pdfobject",
      "display": "2.5K",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "Renders PDF pages, pdfobject",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Navigates PDF pages, pdfobject",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Works without React, pdfobject",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "Install, pdfobject",
      "display": "npm install pdfobject",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "What it does, pdfobject",
      "display": "Embeds PDF documents using the browser’s PDF viewer and supplies fallback links.",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "strengths lead, pdfobject",
      "display": "Provides automatic download fallbacks",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "strengths, pdfobject",
      "display": "Show a download link when the browser cannot embed PDFs.",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "strengths lead, pdfobject",
      "display": "Accepts an initial page number",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "strengths, pdfobject",
      "display": "Open a specified page when the browser supports that parameter.",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "limitations lead, pdfobject",
      "display": "Browser controls the toolbar",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "limitations, pdfobject",
      "display": "Use PDF.js when the application needs a custom viewer toolbar.",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "limitations lead, pdfobject",
      "display": "Embedding does not verify loading",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "limitations, pdfobject",
      "display": "Handle missing URLs and failed document loads outside PDFObject.",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Quickstart, pdfobject",
      "display": "<style>\n.pdfobject-container { height: 500px; border: 1px solid #ccc; }\n</style>\n<div id=\"my-pdf\"></div>\n<script src=\"https://unpkg.com/pdfobject\"></script>\n<script>PDFObject.embed(\"/path/to/file.pdf\", \"#my-pdf\");</script>\n",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Developer need",
      "display": "Custom page rendering",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Why choose pdfjs-dist",
      "display": "controlling page viewport and rendering context",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Developer need in introduction",
      "display": "custom page rendering",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "When to consider pdfobject",
      "display": "native browser embedding and fallback links are sufficient",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Developer need",
      "display": "React document components",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Why choose react-pdf",
      "display": "composing documents and pages in React",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need in introduction",
      "display": "React document components",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "When to consider pdfjs-dist",
      "display": "direct rendering-context control matters",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need",
      "display": "Native-browser PDF embedding",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Why choose pdfobject",
      "display": "providing browser embeds with download fallbacks",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Developer need in introduction",
      "display": "native-browser PDF embedding",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "When to consider pdfjs-dist",
      "display": "an application-owned viewer toolbar is needed",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Developer need",
      "display": "Plugin-based viewer controls",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Why choose @react-pdf-viewer/core",
      "display": "assembling navigation through viewer plugins",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "Developer need in introduction",
      "display": "plugin-based viewer controls",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "When to consider react-pdf",
      "display": "composing document and page components is sufficient",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "Page introduction",
      "display": "JavaScript PDF viewer libraries let application developers display PDF documents inside applications.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Which JavaScript PDF viewer should I choose?",
      "display": "PDF.js exposes a display API for rendering PDFs.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Which JavaScript PDF viewer should I choose?",
      "display": "React-PDF displays documents inside React applications.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Which JavaScript PDF viewer should I choose?",
      "display": "PDFObject supplies automatic download fallbacks for browser embeds.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Does PDFObject render the PDF itself?",
      "display": "The browser and its PDF plugins render the document.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Can the application customize a PDFObject toolbar?",
      "display": "The browser controls that toolbar; PDFObject recommends PDF.js for custom viewer toolbars.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Does a successful PDFObject embed verify that the file loaded?",
      "display": "PDFObject does not check for missing URLs or verify actual document rendering.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Can React-PDF show selectable text and links?",
      "display": "Its text and annotation layers need their corresponding stylesheets.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Can React-PDF use any PDF.js worker version?",
      "display": "The worker must match its exact pdfjs-dist dependency version.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Should PDF.js render every page at high resolution?",
      "display": "The project recommends creating and rendering visible pages to reduce canvas memory.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Can PDF.js load documents from another domain?",
      "display": "Cross-origin documents need CORS permission or an application proxy.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Does React PDF Viewer core include navigation buttons?",
      "display": "Navigation components come from the separate page-navigation plugin.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Does React PDF Viewer core include navigation buttons?",
      "display": "The toolbar and default-layout plugins include that navigation plugin.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Does React PDF Viewer accept the latest PDF.js major?",
      "display": "Its published peer range accepts PDF.js 2.16.105 or compatible 3.x releases.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: Does React PDF Viewer accept the latest PDF.js major?",
      "display": "Its worker and installed PDF.js versions must match.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "FAQ: Does the PDFObject PDF output mean document creation?",
      "display": "It converts an existing Base64 PDF into a downloadable file for the fallback path.",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "Library name, pdfjs-dist",
      "display": "PDF.js",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Monthly downloads, pdfjs-dist",
      "display": "211.7M",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "License, pdfjs-dist",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Package release, pdfjs-dist",
      "display": "6.5.438",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Package release date, pdfjs-dist",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Install, pdfjs-dist",
      "display": "npm install pdfjs-dist",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Quickstart, pdfjs-dist",
      "display": "import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist';\nGlobalWorkerOptions.workerSrc = new URL('pdfjs-dist/build/pdf.worker.mjs', import.meta.url).toString();\nconst pdf = await getDocument('/example.pdf').promise;\nconst page = await pdf.getPage(1);\nconst viewport = page.getViewport({ scale: 1 });\nconst canvas = document.createElement('canvas');\ncanvas.width = viewport.width;\ncanvas.height = viewport.height;\ndocument.body.appendChild(canvas);\nawait page.render({ canvas, viewport }).promise;\n",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Repository stars, pdfjs-dist",
      "display": "54.1K",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Full viewer toolbar, pdfjs-dist",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "New ink/free-text annotations, pdfjs-dist",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Integration role, pdfjs-dist",
      "display": "Low-level PDF rendering and viewer building blocks",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "npm package identifier, pdfjs-dist",
      "display": "pdfjs-dist",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Publisher package description, pdfjs-dist",
      "display": "Generic build of Mozilla's PDF.js library.",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Library name, react-pdf",
      "display": "react-pdf",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Monthly downloads, react-pdf",
      "display": "37.3M",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "License, react-pdf",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Package release, react-pdf",
      "display": "11.1.0",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Package release date, react-pdf",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Install, react-pdf",
      "display": "npm install react-pdf pdfjs-dist@6.5.438 react@19 react-dom@19",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Quickstart, react-pdf",
      "display": "import { Document, Page, pdfjs } from 'react-pdf';\nimport 'react-pdf/dist/Page/AnnotationLayer.css';\nimport 'react-pdf/dist/Page/TextLayer.css';\npdfjs.GlobalWorkerOptions.workerSrc = new URL('pdfjs-dist/build/pdf.worker.min.mjs', import.meta.url).toString();\nexport default function PdfExample() {\n  return <Document file=\"/example.pdf\"><Page pageNumber={1} /></Document>;\n}\n",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Repository stars, react-pdf",
      "display": "11.2K",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Full viewer toolbar, react-pdf",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "New ink/free-text annotations, react-pdf",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Framework/dependency boundary, react-pdf",
      "display": "React19 and bundled pdfjs-dist6.5.438",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "npm package identifier, react-pdf",
      "display": "react-pdf",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Publisher package description, react-pdf",
      "display": "Display PDFs in your React app as easily as if they were images.",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Project function, react-pdf",
      "display": "const renderPDF = () => {\n    if (isPasswordPromptClosed)\n      return (\n        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', flexDirection: 'column' }}>\n          <p style={{ marginBottom: '6px' }}>Password prompt closed</p>\n          <button\n            class=\"pdf-retry-button\"\n            data-cy=\"draggable-widget-button3\"\n            type=\"default\"\n            onClick={() => setIsPasswordPromptClosed(false)}\n          >\n            <div>\n              <div>\n                <span>\n                  <p class=\"tj-text-sm\">Retry</p>\n                </span>\n              </div>\n            </div>\n          </button>\n        </div>\n      );\n    return (\n      <Document\n        file={url}\n        onLoadSuccess={onDocumentLoadSuccess}\n        onLoadError={onDocumentLoadError}\n        onPassword={onPassword}\n        className=\"pdf-document\"\n      >\n        {Array.from(new Array(numPages), (el, index) => (\n          <Page\n            pageNumber={index + 1}\n            width={scale ? width - 12 : undefined}\n            height={scale ? undefined : height}\n            key={`page_${index + 1}`}\n            inputRef={(el) => (pageRef.current[index] = el)}\n          />\n        ))}\n      </Document>\n    );\n  };",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Project source file, react-pdf",
      "display": "frontend/src/AppBuilder/Widgets/PDF.jsx",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Project full_name, react-pdf",
      "display": "ToolJet/ToolJet",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Project stargazers_count, react-pdf",
      "display": "41.2K",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Library name, @pdftron/webviewer",
      "display": "@pdftron/webviewer",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Monthly downloads, @pdftron/webviewer",
      "display": "2.5M",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "License, @pdftron/webviewer",
      "display": "Commercial",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Package release, @pdftron/webviewer",
      "display": "12.2.1",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Package release date, @pdftron/webviewer",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Install, @pdftron/webviewer",
      "display": "npm install @pdftron/webviewer",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Quickstart, @pdftron/webviewer",
      "display": "import WebViewer from '@pdftron/webviewer';\nawait WebViewer.WebComponent({\n  path: '/webviewer/lib',\n  initialDoc: '/example.pdf',\n  licenseKey: 'YOUR_LICENSE_KEY',\n}, document.getElementById('viewer'));\n",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Official description, @pdftron/webviewer",
      "display": "Provides a JavaScript document SDK and UI component library from the Apryse PDF SDK.",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Quickstart source file, @pdftron/webviewer",
      "display": "Web SDK React/get-started and own current sample App.tsx (API recipe)",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Full viewer toolbar, @pdftron/webviewer",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "New ink/free-text annotations, @pdftron/webviewer",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Licensing/runtime boundary, @pdftron/webviewer",
      "display": "Trial key for evaluation; commercial key for production",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "npm package identifier, @pdftron/webviewer",
      "display": "@pdftron/webviewer",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Publisher package description, @pdftron/webviewer",
      "display": "WebViewer is a powerful JavaScript Document SDK and UI Component Library that is a part of the Apryse PDF SDK. It provides a slick, out-of-the-box responsive UI that interacts with the core lib",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Library name, @react-pdf-viewer/core",
      "display": "@react-pdf-viewer/core",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Monthly downloads, @react-pdf-viewer/core",
      "display": "1.8M",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "License, @react-pdf-viewer/core",
      "display": "Commercial",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Package release, @react-pdf-viewer/core",
      "display": "3.12.0",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Package release date, @react-pdf-viewer/core",
      "display": "Mar 2023",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Install, @react-pdf-viewer/core",
      "display": "npm install @react-pdf-viewer/core pdfjs-dist@3.11.174 react@18 react-dom@18",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Quickstart, @react-pdf-viewer/core",
      "display": "import { Viewer, Worker } from '@react-pdf-viewer/core';\nimport '@react-pdf-viewer/core/lib/styles/index.css';\nexport default function PdfExample() {\n  return <div style={{ height: '600px' }}><Worker workerUrl=\"https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js\"><Viewer fileUrl=\"/example.pdf\" /></Worker></div>;\n}\n",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Repository stars, @react-pdf-viewer/core",
      "display": "2.6K",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Full viewer toolbar, @react-pdf-viewer/core",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "New ink/free-text annotations, @react-pdf-viewer/core",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Compatibility boundary, @react-pdf-viewer/core",
      "display": "Current3.12 supports pdfjs-dist2.16 or3.x peers",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "npm package identifier, @react-pdf-viewer/core",
      "display": "@react-pdf-viewer/core",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Publisher package description, @react-pdf-viewer/core",
      "display": "A React component to view a PDF document",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Project function, @react-pdf-viewer/core",
      "display": "function PdfViewer({ fileUrl, highlightData, currentHighlightIndex, onError }) {\n  const newPlugin = defaultLayoutPlugin();\n  const pageNavigationPluginInstance = pageNavigationPlugin();\n  const { jumpToPage } = pageNavigationPluginInstance;\n  const parentRef = useRef(null);\n\n  // Retry key to force re-render when retrying\n  const [retryKey, setRetryKey] = useState(0);\n  const [loadError, setLoadError] = useState(null);\n\n  // Clear error state when fileUrl changes to prevent stale notifications\n  useEffect(() => {\n    setLoadError(null);\n  }, [fileUrl]);\n\n  const handleRetry = useCallback(() => {\n    setRetryKey((prev) => prev + 1);\n    setLoadError(null);\n  }, []);\n\n  // Notify parent of load errors via useEffect to avoid side effects during render\n  useEffect(() => {\n    if (loadError && onError) {\n      onError(loadError);\n    }\n  }, [loadError, onError]);\n\n  // Render error fallback for PDF load failures — pure render, no side effects\n  const renderError = useCallback(\n    (error) => (\n      <PdfLoadError\n        error={error}\n        onRetry={handleRetry}\n        reportError={setLoadError}\n      />\n    ),\n    [handleRetry],\n  );\n\n  function removeZerosAndDeleteIfAllZero(highlightData) {\n    if (Array.isArray(highlightData)) {\n      return highlightData\n        ?.filter((innerArray) => {\n          if (!Array.isArray(innerArray)) {\n            return false;\n          }\n          // Strip 5th element (confidence) if present, keep only first 4 elements\n          const coordsOnly =\n            innerArray.length >= 5 ? innerArray.slice(0, 4) : innerArray;\n          return coordsOnly.some((value) => value !== 0);\n        })\n        .map((innerArray) => {\n          // Return only the first 4 elements (strip confidence)\n          return innerArray.length >= 5 ? innerArray.slice(0, 4) : innerArray;\n        });\n    }\n  }\n\n  const processHighlightData = highlightData\n    ? removeZerosAndDeleteIfAllZero(highlightData)\n    : [];\n\n  const processedHighlightData =\n    processHighlightData?.length > 0 ? processHighlightData : [[0, 0, 0, 0]];\n\n  // Determine current highlight data\n  const currentHighlightData = useMemo(() => {\n    if (\n      RenderHighlights &&\n      Array.isArray(processedHighlightData) &&\n      processedHighlightData?.length > 0\n    ) {\n      return currentHighlightIndex !== null &&\n        currentHighlightIndex < processedHighlightData.length\n        ? [processedHighlightData[currentHighlightIndex]]\n        : processedHighlightData;\n    }\n    return null;\n  }, [processedHighlightData, currentHighlightIndex]);\n\n  // Always create both plugins at top level to maintain hook order\n  const baseHighlightPlugin = highlightPlugin();\n  const customHighlightPlugin = highlightPlugin({\n    renderHighlights:\n      currentHighlightData && RenderHighlights\n        ? (props) => (\n            <RenderHighlights {...props} highlightData={currentHighlightData} />\n          )\n        : undefined,\n  });\n\n  // Choose which plugin to use\n  const highlightPluginInstance = currentHighlightData\n    ? customHighlightPlugin\n    : baseHighlightPlugin;\n\n  // Jump to page when highlightData changes or when navigating through highlights\n  useEffect(() => {\n    const cleanedHighlightData = removeZerosAndDeleteIfAllZero(highlightData);\n    if (cleanedHighlightData && cleanedHighlightData.length > 0) {\n      // Use currentHighlightIndex if provided, otherwise default to first highlight\n      const index =\n        currentHighlightIndex !== null &&\n        currentHighlightIndex < cleanedHighlightData.length\n          ? currentHighlightIndex\n          : 0;\n      const pageNumber = cleanedHighlightData[index][0]; // Get page number from current highlight\n\n      if (pageNumber !== null && pageNumber !== undefined && jumpToPage) {\n        setTimeout(() => {\n          jumpToPage(pageNumber); // jumpToPage is 0-indexed\n        }, 100); // Add a slight delay to ensure proper page rendering\n      }\n    }\n  }, [highlightData, jumpToPage, currentHighlightIndex]); // Changed dependency to highlightData instead of processedHighlightData\n\n  // Show empty state when no URL is provided\n  if (!fileUrl) {\n    return (\n      <div ref={parentRef} className=\"doc-manager-body pdf-viewer-error\">\n        <Result\n          icon={<FileWarning style={{ color: \"var(--warning)\" }} />}\n          title=\"No PDF Available\"\n          subTitle=\"The PDF document URL is not available. Please ensure the document has been processed correctly.\"\n        />\n      </div>\n    );\n  }\n\n  return (\n    <div ref={parentRef} className=\"doc-manager-body\" key={retryKey}>\n      <Worker workerUrl={PDF_WORKER_URL}>\n        <Viewer\n          fileUrl={fileUrl}\n          plugins={[\n            newPlugin,\n            pageNavigationPluginInstance,\n            highlightPluginInstance,\n          ]}\n          renderError={renderError}\n        />\n      </Worker>\n    </div>\n  );\n}",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Project source file, @react-pdf-viewer/core",
      "display": "frontend/src/components/custom-tools/pdf-viewer/PdfViewer.jsx",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Project full_name, @react-pdf-viewer/core",
      "display": "Zipstack/unstract",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Project stargazers_count, @react-pdf-viewer/core",
      "display": "7.5K",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Library name, ng2-pdf-viewer",
      "display": "ng2-pdf-viewer",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Monthly downloads, ng2-pdf-viewer",
      "display": "1.6M",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "License, ng2-pdf-viewer",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Package release, ng2-pdf-viewer",
      "display": "10.4.0",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Package release date, ng2-pdf-viewer",
      "display": "Dec 2024",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Install, ng2-pdf-viewer",
      "display": "npm install ng2-pdf-viewer",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Quickstart, ng2-pdf-viewer",
      "display": "import { Component } from '@angular/core';\nimport { PdfViewerModule } from 'ng2-pdf-viewer';\n@Component({ standalone: true, selector: 'app-pdf-example', imports: [PdfViewerModule], template: '<pdf-viewer [src]=\"source\" [render-text]=\"true\" style=\"display:block;width:100%;height:600px\"></pdf-viewer>' })\nexport class PdfExample { source = '/example.pdf'; }\n",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Official description, ng2-pdf-viewer",
      "display": "Renders PDFs as an Angular component.",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Quickstart source file, ng2-pdf-viewer",
      "display": "README.md (module/component API recipe)",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Repository stars, ng2-pdf-viewer",
      "display": "1.4K",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Full viewer toolbar, ng2-pdf-viewer",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "New ink/free-text annotations, ng2-pdf-viewer",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Framework/dependency boundary, ng2-pdf-viewer",
      "display": "Current install instructions Angular>=12; pdfjs-dist4.8.69 dependency",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "npm package identifier, ng2-pdf-viewer",
      "display": "ng2-pdf-viewer",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Publisher package description, ng2-pdf-viewer",
      "display": "Angular 5+ component for rendering PDF",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Library name, ngx-extended-pdf-viewer",
      "display": "ngx-extended-pdf-viewer",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Monthly downloads, ngx-extended-pdf-viewer",
      "display": "1.3M",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "License, ngx-extended-pdf-viewer",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Package release, ngx-extended-pdf-viewer",
      "display": "32.0.2",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Package release date, ngx-extended-pdf-viewer",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Install, ngx-extended-pdf-viewer",
      "display": "ng add ngx-extended-pdf-viewer@32.0.2",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Quickstart, ngx-extended-pdf-viewer",
      "display": "import { Component } from '@angular/core';\nimport { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';\n\n@Component({\n  selector: 'app-pdf-viewer',\n  standalone: true,\n  imports: [NgxExtendedPdfViewerModule],\n  template: `<ngx-extended-pdf-viewer [src]=\"'assets/example.pdf'\"></ngx-extended-pdf-viewer>`,\n})\nexport class PdfViewerComponent {}\n",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Official description, ngx-extended-pdf-viewer",
      "display": "Embeds a configurable PDF viewer with toolbar and sidebar in Angular apps.",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Quickstart source file, ngx-extended-pdf-viewer",
      "display": "README.md / standalone components",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Repository stars, ngx-extended-pdf-viewer",
      "display": "582",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Full viewer toolbar, ngx-extended-pdf-viewer",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "New ink/free-text annotations, ngx-extended-pdf-viewer",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Framework boundary, ngx-extended-pdf-viewer",
      "display": "Selected32 targets Angular19 through22",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "npm package identifier, ngx-extended-pdf-viewer",
      "display": "ngx-extended-pdf-viewer",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Publisher package description, ngx-extended-pdf-viewer",
      "display": "Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Library name, @embedpdf/snippet",
      "display": "@embedpdf/snippet",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Monthly downloads, @embedpdf/snippet",
      "display": "1.2M",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "License, @embedpdf/snippet",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Package release, @embedpdf/snippet",
      "display": "2.15.1",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Package release date, @embedpdf/snippet",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Install, @embedpdf/snippet",
      "display": "npm install @embedpdf/snippet",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Quickstart, @embedpdf/snippet",
      "display": "<div id=\"pdf-viewer\" style=\"height: 500px\"></div>\n<script async type=\"module\">\n  import EmbedPDF from 'https://cdn.jsdelivr.net/npm/@embedpdf/snippet@2/dist/embedpdf.js';\n\n  const viewer = EmbedPDF.init({\n    type: 'container', // mount strategy\n    target: document.getElementById('pdf-viewer'),\n    src: 'https://snippet.embedpdf.com/ebook.pdf', // your PDF URL\n  });\n</script>\n",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Official description, @embedpdf/snippet",
      "display": " ",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Quickstart source file, @embedpdf/snippet",
      "display": "README.md / index.html (published package quick install)",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Repository stars, @embedpdf/snippet",
      "display": "4.7K",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Full viewer toolbar, @embedpdf/snippet",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "New ink/free-text annotations, @embedpdf/snippet",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Package migration boundary, @embedpdf/snippet",
      "display": "Selected2.15.1 Snippet is not @embedpdf/viewer3",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "npm package identifier, @embedpdf/snippet",
      "display": "@embedpdf/snippet",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Project function, @embedpdf/snippet",
      "display": "searchAllPages(keyword: string): void {\n    if (!this.search) return;\n    const docId = this.currentDocumentId || undefined;\n    const task = this.search.searchAllPages(keyword, docId);\n    // After search completes, scroll to the first result\n    task.wait(() => {\n      this.scrollToActiveSearchResult();\n    }, () => { /* search failed or cancelled */ });\n  }",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Project source file, @embedpdf/snippet",
      "display": "frontend/src/app/features/readers/pdf-reader/services/embedpdf-book.service.ts",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Project full_name, @embedpdf/snippet",
      "display": "grimmory-tools/grimmory",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Project stargazers_count, @embedpdf/snippet",
      "display": "4.7K",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Library name, vue-pdf-embed",
      "display": "vue-pdf-embed",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Monthly downloads, vue-pdf-embed",
      "display": "998.7K",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "License, vue-pdf-embed",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Package release, vue-pdf-embed",
      "display": "2.1.7",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Package release date, vue-pdf-embed",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Install, vue-pdf-embed",
      "display": "npm install vue-pdf-embed vue@^3.3.0",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Quickstart, vue-pdf-embed",
      "display": "<script setup>\nimport VuePdfEmbed from 'vue-pdf-embed';\nimport 'vue-pdf-embed/dist/styles/annotationLayer.css';\nimport 'vue-pdf-embed/dist/styles/textLayer.css';\nconst source = '/example.pdf';\n</script>\n<template><VuePdfEmbed annotation-layer text-layer :source=\"source\" /></template>\n",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Official description, vue-pdf-embed",
      "display": "Embeds PDFs as a Vue component.",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Quickstart source file, vue-pdf-embed",
      "display": "README.md (Vue SFC API recipe)",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Repository stars, vue-pdf-embed",
      "display": "1.0K",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Full viewer toolbar, vue-pdf-embed",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "New ink/free-text annotations, vue-pdf-embed",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Framework/dependency boundary, vue-pdf-embed",
      "display": "Vue3.3+ and pdfjs-dist^6.4.299",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "npm package identifier, vue-pdf-embed",
      "display": "vue-pdf-embed",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Publisher package description, vue-pdf-embed",
      "display": "PDF embed component for Vue",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "What, EmbedPDF Snippet",
      "display": "Adds a ready PDF viewer to a web app.",
      "asOf": "2026-11-17"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best JavaScript PDF viewer libraries PDF.js React-PDF PDFObject React PDF Viewer code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
