You need to sign in to do that
Don't have an account?
pdf and page numbers not displaying...
So I have previously managed to get a vf page rendered as pdf using standard apex page blocks to show page number when in landscape mode...but can anyone shed some light on why this seemingly simpler test doesn't display page numbers...? I've tried it in various instances, but no joy...any insights appreciated.
CSS, loaded as static resource test7
<style type="text/css"> @page { @top-right { /* page numbers */ content: "Page " counter(page); } } </style>
Page
<apex:page standardController="Account" renderas="pdf"> <apex:stylesheet value="{!$Resource.test7}"/> This is test text for {!account.name} <div style="page-break-after: always;"> </div> This is test to show page 2 </apex:page>
So somehow this code is now working for me...if anyone else is in need:
<apex:page standardcontroller="Contact" renderas="PDF" tabstyle="Contact"> <head> <style type="text/css"> @page { @bottom-center { font-size: 8pt; } @bottom-right { content: "Page " counter(page) "/" counter(pages); font-size: 8pt; } } </style> </head> <apex:stylesheet value="{!$Resource.capportrait10}"/> <apex:outputPanel STYLE="font-size: x-large;"> {!contact.Firstname} {!contact.Lastname} </apex:outputPanel> <apex:pageBlock > ...Rest of page </apex:pageBlock> </apex:page>
All Answers
So somehow this code is now working for me...if anyone else is in need:
<apex:page standardcontroller="Contact" renderas="PDF" tabstyle="Contact"> <head> <style type="text/css"> @page { @bottom-center { font-size: 8pt; } @bottom-right { content: "Page " counter(page) "/" counter(pages); font-size: 8pt; } } </style> </head> <apex:stylesheet value="{!$Resource.capportrait10}"/> <apex:outputPanel STYLE="font-size: x-large;"> {!contact.Firstname} {!contact.Lastname} </apex:outputPanel> <apex:pageBlock > ...Rest of page </apex:pageBlock> </apex:page>
Hi Can we have page numbers in body rather than bottom or top of page ?