smalot / smalot/pdfparser

Idea: Create a `checkFileIsValid` and `checkContentIsValid` function

Open
#569 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request help wanted needs more info
Dominant language
PHP
Stars
2.7k
Forks
579
Avg merge
2m
Merged PRs (30d)
1

Description

Idea: Create a checkFileIsValid and checkContentIsValid function

Why?

Sometimes, I Have to parse an PDF just to check if its valid, and it consumes memory, cpu, etc.

Example?

$parser = new Parser();
$parser->checkFileIsValid('file.pdf'); // In case of a File - Returns bool - True for IS VALID and False for NOT VALID
$parser->checkContentIsValid('CONTENT'); // In that case, the function will return false. (Because it's NOT VALID)

Contributor guide

Open the contributing guide

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.

Research direction

Start at the Parser entry point shown in the example and review how PDF files and content are currently handled. Define the validity contract for both inputs and identify tests for valid and invalid PDFs; done means the new API behavior is specified and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.