When you click the pdf link you just get the attachment id and not the name so you can't remove the '.png'