WIP fix bugs

This commit is contained in:
Johannes Zillmann 2017-02-19 11:05:41 +01:00
parent 2783d724e5
commit edfa76b033
2 changed files with 2 additions and 1 deletions

View File

@ -65,7 +65,7 @@ export default class CalculateGlobalStats extends ToPdfViewTransformation {
parseResult.content.forEach(page => { parseResult.content.forEach(page => {
var lastItemOfMostUsedHeight; var lastItemOfMostUsedHeight;
page.textItems.forEach(item => { page.textItems.forEach(item => {
if (item.height == mostUsedHeight) { if (item.height == mostUsedHeight && item.text.trim().length > 0) {
if (lastItemOfMostUsedHeight && item.y != lastItemOfMostUsedHeight.y) { if (lastItemOfMostUsedHeight && item.y != lastItemOfMostUsedHeight.y) {
const distance = lastItemOfMostUsedHeight.y - item.y; const distance = lastItemOfMostUsedHeight.y - item.y;
if (distance > 0) { if (distance > 0) {

View File

@ -68,6 +68,7 @@ export default class DetectCodeBlocks extends ToPdfBlockViewTransformation {
annotation: ADDED_ANNOTATION, annotation: ADDED_ANNOTATION,
textItems: textCombiner.combine(block.textItems) textItems: textCombiner.combine(block.textItems)
}); });
foundBlocks++;
} }
newBlocks.push(preceedingCodeBlock); newBlocks.push(preceedingCodeBlock);
} else { } else {