Улучшение парсинга Pdf

This commit is contained in:
Book Pauk
2019-03-04 21:22:12 +07:00
parent cb65cac333
commit 2f8b68ec62
2 changed files with 30 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ class ConvertPdf extends ConvertHtml {
height: parseInt((attrs.height && attrs.height.value ? attrs.height.value : null), 10),
};
if (line.width !== '0' || line.height !== '0') {
if (line.width != 0 || line.height != 0) {
inText = true;
if (isNaN(line.top) || isNaN(prevTop) || (Math.abs(prevTop - line.top) > 3)) {
putImage(line.top);
@@ -98,7 +98,7 @@ class ConvertPdf extends ConvertHtml {
}
if (tag == 'image') {
let attrs = sax.getAttrsSync(tail);
const attrs = sax.getAttrsSync(tail);
const src = (attrs.src && attrs.src.value ? attrs.src.value : '');
if (src) {
const image = {