diff --git a/pdf.c b/pdf.c
index 678788d039042d77fefc99416a206fb7a25fa76a..e5cf938f4f565637ed5bbba6bb0288dc0cf1babb 100644
--- a/pdf.c
+++ b/pdf.c
@@ -686,7 +686,7 @@ init_parser(struct Env *aux)
 	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, OPT(junk), h_many1(tail), end));
+	H_RULE(pdf,	SEQ(header, OPT(hdr_junk), h_many1(tail), end));
 
 	/* debug parser to consume as much as possible */
 	H_RULE(pdfdbg,	SEQ(header, h_many(tail), body, OPT(xr_td), OPT(startxr)));