Modal approach for tailoring the absorption in a photonic crystal membrane