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
rvkrvk 

How to display check box in renderAs pdf

I need to convert vf page to pdf, In pdf i am not able to see the check boxs which are displyed in vf page and also having alignment issues.Does any one have suggestions.

 

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

As checkbox is an input element and you can display any element which is expecting input from user. So if you want to display the checkbox on PDF then you need to use the image of checkbox on visualforce page.

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Ankit AroraAnkit Arora

As checkbox is an input element and you can display any element which is expecting input from user. So if you want to display the checkbox on PDF then you need to use the image of checkbox on visualforce page.

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
Cory CowgillCory Cowgill

Ankit is right on.

 

I have done this many times myself. You need to use images.

 

I'd suggest you put them in a Static Resource. Use the apex:image tag and the rendered attributes.

 

You'll need two images. One for unchecked / one for checked.

SidharthSidharth

What if we want real-time checkboxes. i.e the user can check/uncheck the checkbox in VF page (rendered as PDF) ???

alu sfdcalu sfdc
Ankit/Cory

Can you give a code snippet of how to use the images?

I tired uploading both checked and unchecked images to documents and then this

<apex:image value="/img/unchecked.jpeg" rendered="{!IF(lstCheck.Leg_Name__c==false,true,false)}"/>
 <apex:image value="/img/checked.jpeg" rendered="{!IF(lstCheck.Leg_Name__c==true,true,false)}"/>

But I don't see any image on the PDF.
Is there something that I am missing?

Thanks
Alu.
Harshita DwivediHarshita Dwivedi
I have same question as Sidharth

I want real-time select/unselect checkboxes. i.e the user can check/uncheck the checkbox in rendered word/pdf doc.