lublak / pdfdataextract

Extract data from a pdf with pure javascript
MIT License
25 stars 5 forks source link

disableCombineTextItems like pdf-parse #7

Open JonSilver opened 3 years ago

JonSilver commented 3 years ago

Nice work on this library! Just wondering...

A lot of text comes out very difficult to parse, because multiple items of text on a line get combined, with no separator. The pdf-parse library had a disableCombineTextItems property on render options which could improve this situation. Perhaps something like that, or a "line items separator" string you could specify that gets inserted in between same-line items of text.

lublak commented 3 years ago

@JonSilver hi and thank you :) Sorry for the late reply. Actually, I always try to answer in the next few days but I was on vacation for a week. That's right the text contents are combined per line. Currently I am working on another parsing function that allows you to access the complete content of the pdf. All composites will be returned in an array. Would this be a solution for you?

JonSilver commented 3 years ago

Hi @lublak. Hope you had a great vacation 😁

Yes I suppose an array of items would be pretty good too, but an optional, settable delimiter to be included in the output text between items would be great for regex parsing. Different purposes, different solutions. 😊

lublak commented 3 years ago

@JonSilver yes I had :) I will think about it but a solution I will offer in any case.

lublak commented 2 years ago

The current development I have now for the time being publicly pushed into an extra branch, to be found here: https://github.com/lublak/pdfdataextract/tree/contentinfoextractor