  We investigate the impact of a stochastic background of Primordial Magnetic
Fields (PMF) generated before recombination on the ionization history of the
Universe and on the Cosmic Microwave Background radiation (CMB).
Pre-recombination PMFs are dissipated during recombination and reionization via
decaying MHD turbulence and ambipolar diffusion. This modifies the local matter
and electron temperatures and thus affects the ionization history and Thomson
visibility function. We use this effect to constrain PMFs described by a
spectrum of power-law type, extending our previous study (based on a
scale-invariant spectrum) to arbitrary spectral index. We derive upper bounds
on the integrated amplitude of PMFs due to the separate effect of ambipolar
diffusion and MHD decaying turbulence and their combination. We show that
ambipolar diffusion is relevant for $n_{\rm B}>0$ whereas for $n_{\rm B}<0$ MHD
turbulence is more important. The bound marginalized over the spectral index on
the integrated amplitude of PMFs with a sharp cut-off is $\sqrt{\langle B^2
\rangle}<0.83$ nG. We discuss the quantitative relevance of the assumptions on
the damping mechanism and the comparison with previous bounds.
