We report grazing incidence X-ray scattering measurements of the near surface structure of an aromatic polyimide, poly(pyromellitic dianhydride-oxydianiline) (PMDA-ODA). The structure parallel to the film surface was investigated as a function of thermal treatment and film thickness. By variation of the X-ray incidence angle, the X-ray penetration into the polymer was changed from approximately 50 angstrom (surface sensitive) to the polymer film thickness, and the PMDA-ODA structure was studied as a function of this penetration depth. For thick films (congruent-to 2500 angstrom), we found that near the air surface the PMDA-ODA was more ordered than in the bulk of the specimen, and for thermal treatments above 300-degrees-C, a crystalline-like ordering was observed. In the near surface region the PMDA-ODA molecules locally assumed a more planar zigzag conformation. However, the interchain packing, i.e., the coherence of order normal to the chain axis, was markedly improved. Studies of 100-angstrom-thick films showed that these had a crystalline-like structure comparable to that seen near the surface of the thick films. Investigations were also performed on films approximately 400 angstrom thick where the structure near the air and substrate interfaces could be assessed. While crystalline-like ordering was found near the air surface, no such ordering was evident near the substrate interface.