We present images of part of the photodissociation region and ionization front in the northern bar of M17, in the infrared lines of H-2, H+ and the 3.28-mu-m emission feature, a tracer of the edge of the molecular cloud. Spatial coincidence between the 3.28-mu-m and H2 emission regions is established to within 1 arcsec, which implies a gas density of n > 10(5) cm-3. The peak observed surface brightness in the H-2 V = 1-0 S(1) line is 1.5 X 10(-7) W m-2 sr-1 and if we assume a 70-degrees inclination to the line of sight, this intensity implies a density of 10(5) cm-3, from modelling of one-dimensional, uniform-density photodissociation regions. However, our images reveal clumpy structure down to a scale of 2 arcsec, which means that a clumpy two-component PDR model, one component of high density and the other component at lower density, would be the preferred solution. The value of the density determines whether the attenuation of FUV photons is dominated by dust shielding or line shielding. The possible geometry of the region is also discussed.