PDF files without a filename cannot be split

Open
#100 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
backend

Research direction

Start in src/hooks/custom/utils/pdf.ts at loadPdf, especially the file-extension check around line 101. Try loading files without a .pdf filename through pdf-lib, and consider the issue done when valid PDFs are split while invalid files still produce the existing fallback message.

Written by the indexing model from the issue text.

Description

See this comment. If a pdf file does not have .pdf in the filename, we return the message Given file is not a PDF. Continuing without splitting.. The issue is that loadPdf here should not return as soon as the file extension check fails. Let's try to load the file in pdf-lib, and only return if that fails.

Dominant language
TypeScript
Stars
63
Forks
16
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Unstructured-IO/unstructured-js-client

All issues in Unstructured-IO/unstructured-js-client

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.