+ Start a Discussion
Santosh Reddy9989Santosh Reddy9989 

I am implementing the InstallHandler interface for a managed package which creates a scheduled job to run

I developed a post installation script using  InstallHandler interface for a managed package which creates a scheduled job to run batch apex. In batch apex iam fetching transaction status if it is settled then iam sending email to customer with pdf attachment. But iam getting empty pdf in email attachment (no errors).
If i scheduled that job manually (without using post installation script), it is working fine.
For generating pdf, iam using below code
PageReference pdf = new PageReference('/apex/pdfpage?id='+aid);
body = pdf.getcontentAsPdf();