using macro error messages instead of static strings
open PDF from Buffer