You need to sign in to do that
Don't have an account?

Input Text values to PDF
I have a Visualforce Page, with some input text fields. (There is NO standard or custom object associated with this Page). There is a button 'Generate PDF'. On click of this button, PDF needs to be generated having all the input text values.
How do we send the input text values to the PDF? (PDF is getting generated having only labels, no values) Please let me know!
How do we send the input text values to the PDF? (PDF is getting generated having only labels, no values) Please let me know!
Visualforce Page
Controller
Let me know if this helps
All Answers
Can you please share you Visualforce Page with those input text fields?
Here is the Visualforce Page:
<apex:page renderAs="{!if($CurrentPage.parameters.isPdf == $CurrentPage.parameters.vcity, '', 'pdf')}" >
<script >
function CheckAmount(){
var vendorsName = document.getElementById('{!$Component.vendorreg.vendor.pbsId.vName}');
if(document.getElementById('{!$Component.vendorreg.vendor.pbsId.vName}').value == ''){
alert("Vendor Name is mandatory");
}
var inputAmount = document.getElementById('{!$Component.vendorreg.vendor.pbsId.amount}');
if(document.getElementById('{!$Component.vendorreg.vendor.pbsId.amount}').value ==''){
alert('Amount is mandatory to Send email');
}
}
function CheckCity(){
if((document.getElementById('{!$Component.vendorreg.vendor.pbsId.vcity}').value =='') || (document.getElementById('{!$Component.vendorreg.vendor.pbsId.vcountry}').value =='')){
alert("Both City and Country are required to Generate PDF!");
};
}
</script>
<apex:form id="vendorreg">
<apex:pageBlock id="vendor" title="Vendor Registration Form">
<apex:pageblockSection id="pbsId" columns="2" >
<apex:inputText id="vName" label="Vendor Company Name" required="true"/>
<apex:inputText id="vpereson" label="Vendor Contact Person"/>
<apex:inputText id="vcity" label="City"/>
<apex:inputText id="vcountry" label="Country"/>
<apex:inputText id="amount" label="Amount per event"/>
</apex:pageblockSection>
<apex:pageBlockButtons >
<apex:commandButton value="Send Email" onclick="CheckAmount();" />
<apex:commandButton value="Reset" />
<apex:commandButton value="Generate PDF" onclick="CheckCity();" action="/apex/Vendor_Registraion?isPdf=true"/>
</apex:pageBlockButtons>
<apex:pageMessages id="showmsg"></apex:pageMessages>
</apex:pageBlock>
</apex:form>
</apex:page>
When I click the 'Generate PDF' button, a PDF should be generated having all the Input values.
Thank You!
Visualforce Page
Controller
Let me know if this helps
Any further help?
It is working for me.
Input Visualforce Page:
pdf
I tried with the same code. It is not coming!
Sorry I doubt you the same code as I see * in your pdf which is not coming in mine. I also have a controller class.
I am glad it worked.
Would you be kind to mark it a best answer? That would really be appreciated.
Regards.
Above code is working fine. but When i clicked on pdf button it is showing "Page Vendor_Registration does not exist". Kindly help me