Class | Package | Local | Serializable | PY support |
---|---|---|---|---|
WebPDFLoader | @langchain/community | ✅ | beta | ❌ |
Source | Web Loader | Node Envs Only |
---|---|---|
WebPDFLoader | ✅ | ❌ |
splitPages
option to false
.
WebPDFLoader
document loader you’ll need to install the @langchain/community
integration, along with the pdf-parse
package:
@langchain/community
package:
pdfjs
buildpdfjs
build bundled with pdf-parse
, which is compatible with most environments, including Node.js and modern browsers. If you want to use a more recent version of pdfjs-dist
or if you want to use a custom build of pdfjs-dist
, you can do so by providing a custom pdfjs
function that returns a promise that resolves to the PDFJS
object.
In the following example we use the “legacy” (see pdfjs docs) build of pdfjs-dist
, which includes several polyfills not included in the default build.