[PR #1791] [MERGED] [REFACTOR] Improve asPDF collector processor with pdfjs #3777

Closed
opened 2026-02-22 18:34:28 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/1791
Author: @shatfield4
Created: 6/28/2024
Status: Merged
Merged: 7/3/2024
Merged by: @timothycarambat

Base: masterHead: 1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader


📝 Commits (7)

  • f8b7c0c WIP replace langchain pdfloader with pdfjs and add more context to each page
  • b5bd409 remove extras from pdfjs and just replace langchain library
  • 8540d9c Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into 1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader
  • 9449f9c remove unneeded dep
  • f028753 Merge branch '1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader' of github.com:Mintplex-Labs/anything-llm into 1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader
  • 2bc564e fix console log in docs
  • d17db17 Merge branch '1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader' of github.com:Mintplex-Labs/anything-llm into 1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader

📊 Changes

4 files changed (+81 additions, -21 deletions)

View changed files

📝 collector/package.json (+2 -2)
📝 collector/processSingleFile/convert/asDocx.js (+0 -1)
📝 collector/processSingleFile/convert/asPDF.js (+21 -17)
📝 collector/yarn.lock (+58 -1)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #1784

What is in this change?

  • Remove the LangChain PDFLoader and replace it with pdfjs
  • pdfjs allows us to be able to get more info like chapters and bookmarks from a PDF
  • Using pdfjs will allow us to improve RAG results in the future

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/1791 **Author:** [@shatfield4](https://github.com/shatfield4) **Created:** 6/28/2024 **Status:** ✅ Merged **Merged:** 7/3/2024 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader` --- ### 📝 Commits (7) - [`f8b7c0c`](https://github.com/Mintplex-Labs/anything-llm/commit/f8b7c0cbb328b27bdcd23cda4c6023f943634f54) WIP replace langchain pdfloader with pdfjs and add more context to each page - [`b5bd409`](https://github.com/Mintplex-Labs/anything-llm/commit/b5bd409c3e90f6ee0f3c6a0a29b67d7d18b1664a) remove extras from pdfjs and just replace langchain library - [`8540d9c`](https://github.com/Mintplex-Labs/anything-llm/commit/8540d9cffc2fa7d89eb8e96ef0782638ca511cad) Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into 1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader - [`9449f9c`](https://github.com/Mintplex-Labs/anything-llm/commit/9449f9c954f3e57ba5cfdd25e272ca6fab0a71ba) remove unneeded dep - [`f028753`](https://github.com/Mintplex-Labs/anything-llm/commit/f0287532fad2ad451bcc2a89f9b145508c20ef8d) Merge branch '1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader' of github.com:Mintplex-Labs/anything-llm into 1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader - [`2bc564e`](https://github.com/Mintplex-Labs/anything-llm/commit/2bc564ecc4e3f2706a26e6b24597be9ea6ce04fa) fix console log in docs - [`d17db17`](https://github.com/Mintplex-Labs/anything-llm/commit/d17db1756bdf550a74839187bcb2ce52a5f7a7da) Merge branch '1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader' of github.com:Mintplex-Labs/anything-llm into 1784-feat-add-bookmarks-to-pdf-metadata-in-pdfloader ### 📊 Changes **4 files changed** (+81 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `collector/package.json` (+2 -2) 📝 `collector/processSingleFile/convert/asDocx.js` (+0 -1) 📝 `collector/processSingleFile/convert/asPDF.js` (+21 -17) 📝 `collector/yarn.lock` (+58 -1) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [ ] 🐛 fix - [x] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #1784 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> - Remove the LangChain PDFLoader and replace it with pdfjs - `pdfjs` allows us to be able to get more info like chapters and bookmarks from a PDF - Using `pdfjs` will allow us to improve RAG results in the future ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:34:28 -05:00
yindo closed this issue 2026-02-22 18:34:28 -05:00
yindo changed title from [PR #1791] [REFACTOR] Improve asPDF collector processor with pdfjs to [PR #1791] [MERGED] [REFACTOR] Improve asPDF collector processor with pdfjs 2026-06-05 15:15:10 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#3777