too many nested getContent calls?
Since you are using getContent()
method in the constructor and calling the same page with same controller again from constructor, it causes recursive execution.
You will have to change the creation of blob - blob b = pdf.getContent();
or the code to generate PDF to some other method other than constructor.
I presume what is happening is that the getContent
call results in a request to the same page - the ApexPages.currentPage()
- and so creates another controller instance that does the same getContent
call and so on.
If you put another system.debug
before the getContent
call I think you will see that pattern. Create a separate page and controller or pass a flag to avoid the cycle.