lib/combine_pdf/parser.rb in combine_pdf-1.0.11 vs lib/combine_pdf/parser.rb in combine_pdf-1.0.12

- old
+ new

@@ -414,14 +414,12 @@ end ########################################## ## XREF - check for encryption... anything else? ########################################## elsif @scanner.scan(/xref/) - # skip first xref line - @scanner.scan(/[\s]+[\d]+[\s]+[\d]+[\s]+/) - while @scanner.scan(/[\d]+[\s][\d]+[\s]+[nf][\s]+/) - # skip all xref lines + # skip list indetifier lines or list lines ([\d] [\d][\r\n]) ot ([\d] [\d] [nf][\r\n]) + while @scanner.scan(/[\s]*[\d]+[ \t]+[\d]+[ \t\r]*\n[\r]?/) || @scanner.scan(/[ \t]*[\d]+[ \t]+[\d]+[ \t]+[nf][\s]*/) nil end ########################################## ## XREF location can be ignored ########################################## @@ -478,10 +476,10 @@ ########################################## ## Unknown, warn and advance ########################################## else # always advance - # warn "Advancing for unknown reason... #{@scanner.string[@scanner.pos - 4, 8]} ... #{@scanner.peek(4)}" unless @scanner.peek(1) =~ /[\s\n]/ + warn "Advancing for unknown reason... #{@scanner.string[@scanner.pos - 4, 8]} ... #{@scanner.peek(4)}" unless @scanner.peek(1) =~ /[\s\n]/ warn 'Warning: parser advancing for unknown reason. Potential data-loss.' @scanner.pos = @scanner.pos + 1 end end out