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
MikeGillMikeGill 

Renderas PDF - Page breaks and default font

I have built a Visualforce page which produces an output in PDF. Everything works ok.

 

The two main challenges I am facing now ar:

 

1. Handling multiple pages. For quotes which have 10 lines I need to be able split the document cleanly and include page numbers. Just looking for a few pointers.

 

2. No matter what I try, I cannot seem to override the default which looks like Times New Roman. I have tried various methods, inline CSS, embedded at the top and using external CSS. Very strange.

 

Thanks,

 

Mike

 

Best Answer chosen by Admin (Salesforce Developers) 
MikeGillMikeGill

Excellent - that's great

 

Still stuck with getting the font to be anything but TimesNewRoman - what's the trick with that?

 

 

All Answers

Ispita_NavatarIspita_Navatar

Putting of headers and footers and page number etc is handled via styles.

 

Refer to code enclosed for reference:-

 

<tfoot >
<div class="Section1">
 <div style="mso-element:footer;">
<table id='tbFoot' width="100%" border="0" cellspacing="0" cellpadding="0" >
    <tr>
    <td>
    <p class='MsoFooter' align="left" style="font-size: 10px">Aeroflex {!oppAeroflexLocation}, Inc. <b>.</b> 35 South Service Road <b>.</b> Plainview, New York 11803 Phone: 516-694-6700 <b>.</b> Fax: 516-694-6715 <b>.</b> www.aeroflex.com</p>
    </td>
     <td>
    <p class='MsoFooter' align="right" style="font-size: 10px"><span style='mso-field-code: PAGE '></p>
    </td>
    </tr>
</table>
</div>
</div>
</tfoot>

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

MikeGillMikeGill

Excellent - that's great

 

Still stuck with getting the font to be anything but TimesNewRoman - what's the trick with that?

 

 

This was selected as the best answer
NielsSchepersNielsSchepers

The code below enabled for me to get Arial and also use bold font weight

 

        <style type="text/css">
            body {font-family: "Arial" "Sans-Serif"; font-size:12px; }
        </style>

 Hope it will also work for you...