diff --git a/pdf.c b/pdf.c index 9b58c23b05ebddfd48f377591bd411aa871f6902..2729f9a4718c973e826e9db1b385e75c41b7f1e9 100644 --- a/pdf.c +++ b/pdf.c @@ -662,6 +662,8 @@ init_parser(struct Env *aux) H_RULE(xr_td, SEQ(xrefs, KW("trailer"), ws, dict)); H_RULE(tail, SEQ(body, h_optional(xr_td), startxr)); + // XXX the real world likes to omit 'startxr' from all but the + // last trailer. we should accept-and-warn in that case. H_RULE(pdf, SEQ(header, h_many1(tail), end)); /* debug parser to consume as much as possible */