Please have look for arguments which you are passing in foreach it seems going null for few customers. Please validate if created pdf have valid data to print a pdf. you can debug foreach arguments for those customers what you are getting to know the exact issues.
Problem solved? Click Kudos & Accept as Solution! https://www.manishmittal.com/