Add Custom Fonts to PDF

With Pdf Invoice Pro on Magento 2, now you can add a custom font to use on your printing template very easy

 

Please follow the steps below to download, install & use the PdfProFont plugin for adding custom font

  • Step 1: Download & Install
  • Go to this link to download the package:PdfProFont, after downloading, unzip the package then upload to your Magento directory by this path: /app/code/Vnecoms. Access to your SSH then run this command: "php bin/magento module:enable Vnecoms_PdfProFont” and continue run “php bin/magento setup:upgrade”. After installing, remember to "chmod var" directory and clean cache.

     
  • Step 2: Upload Font
  • On your Magento root directory, you go: /lib/Vnecoms/mpdf/ttfonts. This path will lead you to the directory where you will upload and store the font. Note: Only the font with extension .ttf or .otf is supported.

     
  • Step 3: Using new font for your printing template
  • Login to your Magento Admin Panel then open your using PDF template (PDF Pro > Manage PDF Template), In the editing page of PDF Template, you find tab Advance :

     
     

    In this tab you will find a table for adding your custom font for both regular font style or italic font style. In order to call the font to your template, in the tab Addition CSS you can use this example:

     
    .easypdf-template-001-red {font-family: led !important;} #table {font-family: led !important;} .tbl-info {font-family: led !important;}