Skip to content

Blank text file when Parsing a PDF to create a .txt file but works with command line #76

@jkomaragiri

Description

@jkomaragiri

The code provided to create a text file produces a blank text file. The process to create a text file however works with running the command line argument. Here command line also produces the json and the text file.

let fs = require('fs'),
PDFParser = require("./pdf2json/PDFParser");

let pdfParser = new PDFParser();

pdfParser.on("pdfParser_dataError", errData => console.error(errData.parserError) );
pdfParser.on("pdfParser_dataReady", pdfData => {
    fs.writeFile("./pdf2json/test/F1040EZ.content.txt", pdfParser.getRawTextContent());
});

pdfParser.loadPDF("./pdf2json/test/pdf/fd/form/F1040EZ.pdf");

my pdf file only contains text.

This has been also raised on the stackoverflow but no one has been able to resolve this.

Hope you can help.

Regards,
Jai

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions