diff --git a/pdf.c b/pdf.c
index fefa03b3ff8d05b9149640025cf9750fe30b45ed..7ee7759d0437f2e04649247ee09ae40d6bdfd970 100644
--- a/pdf.c
+++ b/pdf.c
@@ -1147,8 +1147,9 @@ init_parser(struct Env *aux)
 
 	H_RULE(xr_td,	SEQ(xrefs, KW("trailer"), ws, dict));
 
-	H_RULE(hdr_junk,    VIOL(h_many1(h_butnot(h_ch_range(0, 255), SEQ(npair, wel, KW("obj")))),
-				 "Uncommented junk after header (severity=1)"));
+	H_RULE(hdr_junk,    CHX(comment,
+                                VIOL(h_many1(h_butnot(h_ch_range(0, 255), SEQ(npair, wel, KW("obj")))),
+                                              "Uncommented junk after header (severity=1)")));
 	H_RULE(tail,	SEQ(body, CHX(SEQ(h_optional(xr_td), startxr),
 				      VIOL(SEQ(xr_td, OPT(SEQ(nl, KW("startxref"), nl, lws, nat, nl)),
 					       OPT(nl), OPT(LIT("%%EOF")), OPT(nl)),