Skip to content

Commit

Permalink
skip the case there is only one line #2
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnywang committed May 21, 2016
1 parent c5b57ce commit b5cee73
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pdf-table-extractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ pdf_table_extractor = function(doc){
}

// no table
if (current_x === null) {
if (current_x === null || lines.length == 0) {
return {};
}
verticles.push({x: current_x, lines: lines});
Expand Down Expand Up @@ -244,6 +244,10 @@ pdf_table_extractor = function(doc){
if (current_width > line_max_width) {
lines = lines_add_horizon(lines, current_x, current_x + current_width);
}
// no table
if (current_y === null || lines.length == 0) {
return {};
}
horizons.push({y: current_y, lines: lines});

var search_index = function(v, list) {
Expand Down

0 comments on commit b5cee73

Please sign in to comment.