private static iTextSharp.text.Image checkImage(this iTextSharp.text.Image img) { if (img == null) throw new InvalidOperationException("iTextSharp.text.Image is null."); return img; }