Currently PDF is the only supported content converter. Setting this attribute to "pdf" renders the page as a PDF. If the PDF fails to display all the characters, adjust the fonts in your CSS to use a font that supports your needs. For example, add the following style definition to your page's styles:
body { font-family: 'Arial Unicode MS'; }
This is my first answer here.So please correct me if am wrong somewhere :)
use this coad controller class public class vfpagetopdfformate { public boolean pdfpage {set;get;} public string render{set;get;}
public void pdfpage(){ if(render==null){ render='pdf'; }
} } and vf page is <apex:page renderAs="{!render}" id="rer" controller="vfpagetopdfformate" > <apex:form> the transforming vf page to pdf formate <apex:commandButton value="convertopdf" action="{!pdfpage}" /> </apex:form> </apex:page> I Hope this is help full for u if you are problem is solved make this is best answer thanks sandeep
hi Sandeep Reddy 37, your code worked for me to generate PDF on click on button , thanks howerver its no picking the data being fed in the fields . how do i go about having the VFpage also shows data which is inserted in the fields?
Hi Shekhar Hanchate, No i havent. Could you assist. Is there a possiblilty that this could be achieved from a custom controller and doesnt require an object creation? Because where ever i see online i see the code mentions 'id'.
I looked into the below link: https://www.biswajeetsamal.com/blog/tag/attachment/#inicio_pagina
Do u want in same page or another page .
Regards,
Harish.R
I have pdf button in first vf output page and I want the same to be displayed in pdf by clicking the button in first page
Use Same Controller for to vf pages And Add which Data U required in pdf page In page tag add Render As pdf tag . In side Button Write Page instance .
<apex:page controllere = "harishrao" sidebar="false" >
<apex:form>
<apex:page:block>
:apex:commoundbutton value= "show" action = "{!show}" />
<apex:page:block>
</apex:form>
</apex:page>
2 page
<apex:page renderAs="pdf" showHeader="false" controllere = "harishrao" sidebar="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false">
02 <html>
03 <head>
04 <style>
05 @page {
06 size: letter;
07 margin: 25mm;
08 @top-center {
09 content: "Sample";
10 }
11 @bottom-center {
12 content: "Page " counter(page) " of " counter(pages);
13 }
14 }
15 .page-break {
16 display:block;
17 page-break-after:always;
18 }
19 body {
20 font-family: Arial Unicode MS;
21 }
22 </style>
23 </head>
24 <body>
25 <div class="page-break">Page A</div>
26 <div class="page-break">Page B</div>
27 <div>Page C</div>
28 </body>
29 </html>
30</apex:page>
Regards,
Harish.R.
Did you resolve probleam .
Ragards,
Harish.R
Regards,
Ajay Mishra
https://help.salesforce.com/apex/HTViewSolution?urlname=Formating-VisualForce-Page-rendered-as-PDF-1327108686696&language=en_US
Please try to follow below concept.
VfPage - Page1
<apex:page renderAs="pdf" >
<apex:form>
<apex:pageBlock>
set output that you wan't in pdf
</apex:pageBlock>
</apex:form>
</apex:page>
VfPage - page2
<apex:page >
<apex:form>
<apex:pageBlock>
<apex:commandButton action="/apex/page1" />
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks & Cheers !!
Jakin
https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016Zn3EAE
If the PDF fails to display all the characters, adjust the fonts in your CSS to use a font that supports your needs.
For example, add the following style definition to your page's styles: This is my first answer here.So please correct me if am wrong somewhere :)
Thanks and Regards,
Samir Khan
controller class
public class vfpagetopdfformate {
public boolean pdfpage {set;get;}
public string render{set;get;}
public void pdfpage(){
if(render==null){
render='pdf';
}
}
}
and vf page is
<apex:page renderAs="{!render}" id="rer" controller="vfpagetopdfformate" >
<apex:form>
the transforming vf page to pdf formate
<apex:commandButton value="convertopdf" action="{!pdfpage}" />
</apex:form>
</apex:page>
I Hope this is help full for u if you are problem is solved make this is best answer
thanks
sandeep
your code worked for me to generate PDF on click on button , thanks howerver its no picking the data being fed in the fields .
how do i go about having the VFpage also shows data which is inserted in the fields?
No i havent.
Could you assist. Is there a possiblilty that this could be achieved from a custom controller and doesnt require an object creation? Because where ever i see online i see the code mentions 'id'.
I looked into the below link:
https://www.biswajeetsamal.com/blog/tag/attachment/#inicio_pagina
Hello Flavia, were you able to find any solution for this?