modesty / modesty/pdf2json

Unable to find other page content

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

Nobody has claimed this yet.

Dominant language
Java
Stars
2.2k
Forks
394
Avg merge
3d 5h
Merged PRs (30d)
7

Description

I try to parse a 300 page pdf and get the following content:
XXXXXX
----------------Page (0) Break----------------

----------------Page (1) Break----------------

----------------Page (2) Break----------------

----------------Page (3) Break----------------

This is my code:

import PDFParser from "pdf2json";
 
const pdfParser = new PDFParser(this, 1);
 
function readPDF(fileName) {
    pdfParser.loadPDF(fileName);
    pdfParser.on("pdfParser_dataError", errData => console.error(errData.parserError));
 
    pdfParser.on("pdfParser_dataReady", pdfData => {
        const data = pdfParser.getRawTextContent()
        console.log('文本信息:', JSON.stringify(data)
    });
}
readPDF('1.pdf')

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the issue with the reported 300-page PDF and the shown pdfParser.loadPDF and getRawTextContent calls. Inspect how pdfParser_dataReady assembles page content and compare the returned text with the page breaks; done means the expected content from all pages is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.