  We investigate parametric X-ray radiation (PXR) under condition of the
extremely asymmetric diffraction, when the ultra-relativistic electron bunch is
moving in \textit{vacuum} parallel to the crystal-vacuum interface, close to
the crystal surface. This type of geometry coincides with the well known
mechanism of generation of radiation, when the self-field of the particle beam
interacts with the reflecting metal grating, namely the Smith-Purcell effect.
We demonstrate that in this geometry the main contribution is given via a tail
region of the beam distribution, which penetrates the crystal and X-rays are
radiated along the normal to the crystal surface. We determine the electron
beam characteristics, when this phenomenon can be observed. It is essential
that in this geometry the majority of electrons does not undergo multiple
scattering and consequently the characteristics of the particle beam are not
changed, thus allowing the usage of the emitted X-rays for the purpose of
non-destructive beam diagnostics, which can complement the traditional
knife-edge method.
