Back

Ways to load and work with a pdf file.

  • 0
  • Storage
bladmist
31 Dec, 2023, 01:34

I’m following a tutorial and trying to load a pdf from a bucket in nextjs. I’ve looked through the storage api and the closest end point I’ve seen is “get file for view” but it only returns a url rather than the actual pdf content.

Context, I’m trying to implement the common chat with pdf feature. I need to load the pdf first and then split it…. I’d also prefer to store the pdf first in the bucket and then bring it down rather than just receiving the document from the user’s file input.

How would you advice I implement this pls?

TL;DR
The user is having difficulty loading a PDF file using Langchain's webPDFLoader. They are following a tutorial and trying to load a PDF from a bucket in Next.js. The closest endpoint they found, "get file for view," only returns a URL instead of the actual PDF content. They are trying to implement a common chat with a PDF feature and need to load the PDF first and then split it. They prefer to store the PDF in the bucket and then retrieve it rather than receiving it from a user's file input. They are looking for advice on how to implement this.
ideclon
31 Dec, 2023, 01:40

The URL that’s returned should be the PDF? So you could just pull the file with that URL.

bladmist
31 Dec, 2023, 01:49

Yh, that’s what I’ve been initially trying to do using langchain’s webPDFLoader but it’s been proving difficult for me. I’m no where near an expert in this. I’m still following a tutorial 😞

Drake
31 Dec, 2023, 05:07

How are you supposed to load the PDF?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more