Resolve generate PDF bug