function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RDeepaRDeepa 

How to display the page numbers dynamically on the visualforce page?

Hi,

 

I am displaying a detail mode of a record in the form of PDF. It will have multiple pages which is dynamic based on the entered values for some textarea fields. There is a requirment to display the page numbers.

 

How to add page numbers at the bottom of the page dynamically?

 

Can anyone help me on this.

 

Regards,

Deepa

Best Answer chosen by Admin (Salesforce Developers) 
Edwin VijayEdwin Vijay

<apex:page showHeader="false" renderAs="pdf"> <head> <style type="text/css"> @page { /* Landscape orientation */ size:landscape; /* Put page numbers in the bottom right corner of each page in the pdf document. */ @bottom-right { content: "Page " counter(page); } } body { font-family: Arial Unicode MS; font-size:9pt; } td { font-size:11pt; font-family:Tahoma; } /* you can even define custom classes that utilize your static resources */ .checkbox { width: 19px; height: 16px; background-image:url({!URLFOR($Resource.Checkbox)}); background-repeat: no-repeat; } </head> <body> </body> </apex:page>

 

Source : Salesforce Source

All Answers

Edwin VijayEdwin Vijay

<apex:page showHeader="false" renderAs="pdf"> <head> <style type="text/css"> @page { /* Landscape orientation */ size:landscape; /* Put page numbers in the bottom right corner of each page in the pdf document. */ @bottom-right { content: "Page " counter(page); } } body { font-family: Arial Unicode MS; font-size:9pt; } td { font-size:11pt; font-family:Tahoma; } /* you can even define custom classes that utilize your static resources */ .checkbox { width: 19px; height: 16px; background-image:url({!URLFOR($Resource.Checkbox)}); background-repeat: no-repeat; } </head> <body> </body> </apex:page>

 

Source : Salesforce Source
This was selected as the best answer
RDeepaRDeepa
Thanks Edwin1