Unable to find other page content

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

Nobody has claimed this yet.

Assessment

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

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.

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')
Dominant language
Java
Stars
2.2k
Forks
396
Avg merge
9d 19h
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 modesty/pdf2json

All issues in modesty/pdf2json

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.