Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text without spaces or line breaks #319

Open
RodriguezMauro26 opened this issue Oct 6, 2023 · 4 comments
Open

Text without spaces or line breaks #319

RodriguezMauro26 opened this issue Oct 6, 2023 · 4 comments

Comments

@RodriguezMauro26
Copy link

Hello, I wanted to consult
When using the library, obtain the text without any spaces or line breaks
I would like to know how to obtain the content of the PDF, respecting its spaces and line breaks.

I leave the code fragment

                        const pdfBuffer = element.exists.data.buffer;
                        const pdfParser = new PDFParser(this, 1);
                        pdfParser.parseBuffer(pdfBuffer);
                        pdfParser.on("pdfParser_dataError", errData => console.error(errData.parserError));
                        pdfParser.on("pdfParser_dataReady", pdfData => {
                            const pageText = pdfData.Pages.map(page => page.Texts.map(text => text.R[0].T).join('')).join(' ');
                            console.log(pageText);
                        });
@isimisi
Copy link
Contributor

isimisi commented Oct 9, 2023

#317 - this will at least respect single spaces

@RodriguezMauro26
Copy link
Author

#317 - this will at least respect single spaces

Can you give me an example of use?

@isimisi
Copy link
Contributor

isimisi commented Oct 18, 2023

#317 - this will at least respect single spaces

Can you give me an example of use?

Currently waiting for it to be merged - you can use @isimisi/pdf2json, however I will remove this package once the PR has been merged

update: waiting for a release

Use release 3.0.5 :)

@PhilippS93
Copy link

Still have the same problem with version 3.0.5 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants