PHP 7 HTML2PDF.js Script to Insert Custom TTF Fonts to PDF Document in Browser Using HTML5 & Javascript

You are currently viewing PHP 7 HTML2PDF.js Script to Insert Custom TTF Fonts to PDF Document in Browser Using HTML5 & Javascript

PHP 7 HTML2PDF.js Script to Insert Custom TTF Fonts to PDF Document in Browser Using HTML5 & Javascript

<span class="hljs-variable">$html2pdf</span>->setDefaultFont(<span class="hljs-string">"the_name_you_called_your_font"</span>);
 
<span class="hljs-variable">$html2pdf</span>->AddFont(<span class="hljs-string">'opensans'</span>, <span class="hljs-string">'normal'</span>, <span class="hljs-string">'opensans.php'</span>);
<span class="hljs-variable">$html2pdf</span>->setDefaultFont(<span class="hljs-string">'opensans'</span>);
 
<span class="hljs-keyword">default</span>: opensans
bold: opensansb
italic: opensansi
bold italic: opensansbi
 
<span class="hljs-variable">$html2pdf</span>->AddFont(<span class="hljs-string">'opensans'</span>, <span class="hljs-string">'normal'</span>, <span class="hljs-string">'opensans.php'</span>);
<span class="hljs-variable">$html2pdf</span>->setDefaultFont(<span class="hljs-string">'opensans'</span>);
 
<span class="hljs-keyword">default</span>: opensans
bold: opensansb
italic: opensansi
bold italic: opensansbi
 

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply