use binmode raw to avoid corrupting PDF