File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ import (
2020// string, a PDF string literal
2121// keyword, a PDF keyword
2222// name, a PDF name without the leading slash
23- //
2423type token interface {}
2524
2625// A name is a PDF name, without the leading slash.
@@ -419,6 +418,9 @@ func (b *buffer) readObject() object {
419418 return b .readDict ()
420419 case "[" :
421420 return b .readArray ()
421+ case ">>" :
422+ // stop the object
423+ return nil
422424 }
423425 b .errorf ("unexpected keyword %q parsing object" , kw )
424426 return nil
@@ -480,8 +482,13 @@ func (b *buffer) readDict() object {
480482 if tok == nil || tok == keyword (">>" ) {
481483 break
482484 }
485+ if tok == io .EOF {
486+ tok = b .readToken ()
487+ break
488+ }
483489 n , ok := tok .(name )
484490 if ! ok {
491+ fmt .Printf ("DEBUG: %T(%v)\n . Skip dict" , tok , tok )
485492 b .errorf ("unexpected non-name key %T(%v) parsing dictionary" , tok , tok )
486493 continue
487494 }
You can’t perform that action at this time.
0 commit comments