0

I am generating a pdf using renderAs pdf in VF page. In the page the <div> is not working as it should(block) , It is overlapping with its parent div .Here is the pdf:

enter image description here

Here is the VF page code:

<apex:page renderAs="pdf" applyHtmlTag="false" showHeader="false" standardStylesheets="false" applyBodyTag="false" controller="TransactionsPDFHandler">
    <html dir='rtl'>
        <head>
            <style>
               
                body {
                    font-family: 'Arial Unicode MS', sans-serif; /* Choose a Hebrew-supporting font */
                    font-size: 12pt;
                }
                 padding : 1px;
            .hidden{
            
            display:none;
            }
            @page {
            padding-top: 70px;
            @top-center {
            content: element(header);
            }
            @bottom-left {
            content: element(footer);
            }
            }
            
            div.header {
            padding: 10px;
            position: running(header);
            
            }
            div.footer {
            display: block !important;
            padding: 5px;
            position: running(footer);
            }
            
            
            .pagenumber:before {
            content: counter(page);
            }
            .pagecount:before {
            content: counter(pages);
            }
            .gridtable {
            border-collapse: collapse;
            }
            
            .gridtabletd{
            border: 1px solid black;
            } 
            table.gridtable {
       font-size:11px;
        color:#333333;
        border-width: 1px;
         border-color: #666666;
     }
        table.gridtable th {
         border-width: 1px;
       padding: 8px;
       border-style: solid;
       border-color: #666666;
      font-weight:bold;

     }
    table.gridtable td {
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #666666;
    background-color: #ffffff;
     }
            table { page-break-inside:auto }
            tr    { page-break-inside:avoid; page-break-after:auto }
            thead { display:table-header-group }
            tfoot { display:table-footer-group }   
            @media print {
            table {
            page-break-inside: avoid;
            }
            }   
            </style>
        </head>
       <body style="font-family: Arial Unicode MS; font-size: 12pt;">
     <div class="header gridtable" style="text-align:center;margin-bottom:30px;" dir='rtl' >
         <span style="text-align:right;">לאוי תירק - ראמטאס'ד י"ברד י"ות אתביתמו הלודג הבישי</span>
         <br/>
         <span style="text-align:right;">א"טילש ר"טע ר"ומדא ןרמ ק"כ תואישנב</span>
         <br/>
         <span style="text-align:right;">ןקסע דומיל רכש רעזנוא טימ ןדניבראפ ךיז ריא טנעק טנעמטיעטס יד עגונב םיטרפ עכעלעוו ייס ראפ</span>
         <br/>
         {!accOwnerName} {!accOwnerPhoneNumber}
         <hr size="2" style="color: black;" />
         <table class="" style="width: 100%;">
             <tbody>
                <tr>
                    <td align="left">
                        
                        {!formattedDate}
                    </td>
                     <td align="center">
                       ד"סב
                    </td>
                     <td align="right">
                       ד"פשת טבש ט ,אב ו
                    </td>
                </tr>
             </tbody>
         </table>

    </div>
           <div style="height:20px;">
           </div>
    
    <div class="" style="margin-top:30px; !important" >
        <!--table data-->
        </div>
        <div class="transactionTable" style="margin-top:30px;display:block !important;">
              <!--table data-->

     </div>        
        <div style="display:block !important;">
      <!--table data-->
        </div>
           
    </div>
    </body>
    </html>
</apex:page>
1
  • When I last created PDF generating VF (2018) I found I had to put all styling in style attributes on the elements themselves - use of CSS as a stylesheet didn't work for me. Dunno why.
    – Phil W
    Commented Feb 1 at 7:05

0

You must log in to answer this question.

Browse other questions tagged .