Acidity is dependent on charge dispersal. Greater the charge dispersal in conjugate base greater the acidity (assuming that both acids being compared have similar stablities).
So in the case of 4-Hydroxybenzaldehyde, in the conjugate base the charge would delocalise over two oxygen atoms as well as the benzene ring.
Whereas in formic acid charge would only delocalise over two oxygen atoms and hence charge would be concentrated. So the predicted order of acidity according to this logic should be formic acid < 4-hydroxybenzaldehyde.
This is contrary to actual data:
$\mathrm{p}K_\mathrm{a}(\text{4-hydroxybenzaldehyde}) = 7.61$ (Source),
$\mathrm{p}K_\mathrm{a}(\text{formic acid}) = 3.7$
Please put forth the correct logic.