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
subodh chaturvedi 17subodh chaturvedi 17 

how to bring the Checkbox in pdf through visualforce page

Hi ,
I have a requirement Where i have a wrapper page  multiple checkboxes with Values  in a vf page & on the same vf page i have a custom Button so when i click on that button the copy of the vf page should open in pdf  but the hurdle is the checkbox is not displaying in pdf  how i can bring the checkboxes  either  Checked & unchecked values of it bcoz it will change based On new Record Open  .   
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Subodh,

Instead of Input checkbox, you can use Salesforce standard image to display checkbox as below.
 
Visualforce Page:
<apex:page showHeader="false" renderAs="PDF" cache="true"  >
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />    
    <style type="text/css">
        @page{
            size:A4 portrait;
            
            @bottom-right {
                content: "Page " counter(page) " - " counter(pages);
                font-family: 'Arial', 'Helvetica', sans-serif;
                font-size:10px;
            }
        }
    </style>
    </head>
    <apex:form>
    My Checkbox : 
                <img src="/img/checkbox_unchecked.gif"/>
                <img src="/img/checkbox_checked.gif"/>
    </apex:form>
</apex:page>
hope it helps.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar
subodh chaturvedi 17subodh chaturvedi 17
Hi Rahul,

I tried your approch by adding the Images in the Vf page through static resource but the problem is i want the checkbox checked & unchecked same as in My vf wrapper page currently . suppose 10 checkbox are checked & 15 are unchecked randomly  in a wrapper page so that same checkboxes should appear in pdf.


<apex:page standardController="Account" extensions="SolutionParticipationPDFController" sidebar="False" renderAs="Pdf" standardStylesheets="true" applyHtmlTag="false" showHeader="false"  > 
<head>
   <style>
    @page {
 size: A4 landscape;
 margin: 25mm;
 @top-center {
 content: "Key Solutions Inventory";
 font-family: sans-serif, Arial, Helvetica !important;
 }
 @bottom-center {
 content: counter(page);
 }
}

 body, p, label, table, td, tr, th
    {
        font-family: sans-serif, Arial, Helvetica !important;
        font-size :9px;
    }
       
 @page {
 @bottom-right {
 content: "Page " counter(page) " of " counter(pages);
 }
}       
    </style>
</head> 
<body>
    <apex:form >
        <apex:pageBlock > 
            <table style="border-collapse: collapse;padding:50px; font-size:5px">
                <tr>
                    <apex:repeat value="{!resultPickValuesMap}" var="M">
                  
                        <td style="vertical-align: top;padding:20px;text-align:left; font-size:10px">
                            <b style="text-align:center;">{!M}</b><br/>
                                <apex:repeat value="{!resultPickValuesMap[M]}" var="temp">
                                    <table>
                                        <tr>
                                            <td style="padding-top:5px;">
                                           
                                              <apex:image url="{!$Resource.Unchecked_Checkbox}" value="{!temp.isSelected}" width="9" height="9"  />
                                            
                                              <!--  <apex:inputcheckbox value="{!temp.isSelected}" />--> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                              <!-- <apex:commandLink id="theLink" action="{!solutionList}" target="_blank"> -->
                                                   <apex:param assignTo="{!solName}" value="{!temp.value}" name="solName"/>
                                                   <apex:outputText value="{!temp.value}"/>
                                              <!-- </apex:commandLink> -->
                                            </td>
                                        </tr>
                                   </table>
                               </apex:repeat>
                        </td>
                    </apex:repeat>
                </tr>
            </table>
        </apex:pageblock> 
    </apex:form>
</body>                     
</apex:page>
subodh chaturvedi 17subodh chaturvedi 17
This Is My Wrapper page where i need these Checkbox in Pdf with there exact checkbox values