Adding exception throwing to PDF