We derive the Sommerfeld precursor and present the first calculations for the Brillouin precursor that result from the transmission of a pulse through a photonic crystal. The photonic crystal is modelled by a one-dimensional N-layer medium and the pulse is a generic electromagnetic plane wave packet which is incident perpendicular onto the crystal. Each layer of the crystal consists of two slabs that may differ in their relative thickness and in their refractive indices. The resulting precursors are then compared to those that would arise after propagation through a reference homogeneous medium of the same length and the same optical length in order to isolate the effect of the slab contrast onto the shapes of the precursors. The Sommerfeld precursor is not influenced by this slab contrast; its wavefront invariantly propagates at the speed of light in vacuum and its amplitude and period only depend on the spatial average of the two squared plasma frequencies of the slabs which coincides with the plasma frequency squared of the reference medium. The Brillouin precursor does experience the slab contrast; its arrival time increases with increasing slab contrast.