Sometimes we need to show the dynamic values on a visualforce page and rendered it as pdf. In this blog I will show you how we can show fields and their values. You can write your own logic for rendering pdf. This code will work for any Object which is not having composite fields like Address in Contact. It will show error for composite fields.
Apex Class:

Visualforce Page:

Test Class:
Output:

Special Thanks to Sumeet Sangle without his guidance I couldn’t complete this.
Leave a comment