diff --git a/pdf.c b/pdf.c index 2729f9a4718c973e826e9db1b385e75c41b7f1e9..8afa86866317dfb9b8900153ad23240fb8a17c30 100644 --- a/pdf.c +++ b/pdf.c @@ -657,6 +657,12 @@ init_parser(struct Env *aux) H_RULE(startxr, SEQ(nl, KW("startxref"), nl, lws, nat, nl, LIT("%%EOF"), CHX(nl, end))); + // XXX the real world sometimes omits nl after %%EOF inside the file. + // the next 'tail' would be appended right after the 'F', + // presumably because the previous version of the file + // ended without a trailing newline. m) + // this is invalid per spec, because it creates a run-on + // comment, but we should probably accept-and-warn. // XXX should lws be allowed before EOF marker? // NB: lws before xref offset is allowed, cf. p.48 (example 4) H_RULE(xr_td, SEQ(xrefs, KW("trailer"), ws, dict));