Returns the page in PDF, regardless of the <apex:page> component’s renderAs
attribute.
Signature
public Blob getContentAsPDF()
Usage
If you use getContentAsPDF in a test method,
the test method fails. getContentAsPDF is treated
as a callout in API version 34.0 and later.
This method can’t be used in:
- Triggers
- Test methods
- Apex email services