<aura:component implements="force:lightningQuickAction" >
<aura:attribute name="TTDLetter" type="object"/>
<lightning:button label="PDF" onclick="{!c.PDF}" /> </aura:component>
<aura:component implements="force:lightningQuickAction" >
<!-- attribute to accept Visualforce page's javascript method -->
<aura:attribute name="TTDLetter" type="object"/>
<!-- Button component to invoke PDF download -->
<lightning:button label="PDF"
onclick="{!c.PDF}" />
</aura:component>
<apex:page controller="MyController" renderAs="pdf" applyBodyTag="false">
<head>
<style>
body { font-family: 'Arial Unicode MS'; }
@page{
size: letter;
margin:10%;
@top-left{
content: "Dear,";
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
}
@bottom-right{
content: "Yours Sincerely,";
font-family: Helvetica, Arial, sans-serif;
font-size: 10px;
}
}
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 11px;
}
</style>
</head>
<div align="right"><strong>Date</strong>: {!DAY(Today())} {!CASE(MONTH(Today()), 1, 'January', 2, 'February', 3, 'March', 4, 'April', 5, 'May', 6, 'June', 7, 'July', 8, 'August', 9, 'September', 10, 'October', 11, 'November', 12, 'December', 'Unknown')} {!YEAR(Today())}</div>
<center>
<h1> Letter</h1>
</center>
<p>{!custom_object__C.Name__C}</p>
</apex:page>
body{ font-family: 'Arial Unicode MS';}@page{ size: letter; margin:10%; @top-left{ content: "Dear,"; font-family: Helvetica, Arial, sans-serif; font-size: 12px; } @bottom-right{ content: "Yours Sincerely,"; font-family: Helvetica, Arial, sans-serif; font-size: 10px; } }
body { font-family: Helvetica, Arial, sans-serif; font-size: 11px; }
Date:{!DAY(Today())}{!CASE(MONTH(Today()), 1, 'January', 2, 'February', 3, 'March', 4, 'April', 5, 'May', 6, 'June', 7, 'July', 8, 'August', 9, 'September', 10, 'October', 11, 'November', 12, 'December', 'Unknown')}{!YEAR(Today())}Letter
{!custom_object__C.Name__C}
For the Lightning component If have created a quick action called "PDF", when I have clicked on PDF button from my object , I got a error stating : A Component Error has occurred!.
A Component Error has occurred!.