Exporting Active Template to PDF
You can export Active Templates as PDF documents and generate documents with dynamic content. These documents can be used as quotes, order forms, invoices, receipts or for any other purpose.
Here's an example of how you can export an Active Template into PDF:
var contact = Database.Query<Contact>()
.Where(a => a.Id == "00700000000003w0000")
.First();
//contact record is referenced on the page
byte[] bytes = ActivePages.MyPage.ToPDF(contact);
return File(bytes, MimeContentTypes.Pdf);
Here's the sample content of the Active Template:
<html>
<head>
</head>
<body>
Dear <%:Text(Model.Firstname)%>
Thank you for registering with the online webinar!
Regards,
Marketing Team
</body>
</html>