Marty Zigman Marty Zigman
Prolecto Labs Accelerator Templates

How To: Add Custom Fonts to NetSuite Generated PDF Documents

CRM NetSuite Reporting



This article is relevant if you are working with NetSuite Advanced PDF Technologies and you need to reference a custom font.

Background

We are very fortunate to have Mike I., a long-time member of the Prolecto Resources Systems Engineering team, lead us to create great-looking NetSuite generated HTML and PDF documents. For those that have seen previous articles, you know that we give our clients a free-of-license tool to solve the challenges faced with NetSuite saved search technologies which make it difficult to reach data that demands multiple joins. See article, Supercharge NetSuite Advanced PDF/HTML Templates.

A client recently asked us how to include additional fonts into the Advanced PDF technologies.  Mike provided the guidance I thought it would be valuable for the community.

Add New Fonts to NetSuite Advanced PDF Templates

Mike I. offered up the following steps:

  1. Get the Font File: Obtain a copy of the actual .ttf file(s) for the font(s) you wish to use.
  2. Store the Font File: Upload all versions of the .ttf files (Regular, Bold, Italic, Bold-Italic, etc.) to a designated location in the NetSuite File Cabinet. Be sure the .ttf font file(s) is/are accessible from NetSuite and the switch “Available Without Login” is set to ON. Get the URL that is supplied by the file information.
  3. Reference the Font File: Code up the font linkage in the template file (see example below).

NetSuite Template File Sample for Additional Font Definition

Mike I. provided the following NetSuite Advanced PDF file definition:

<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
<head>

<#assign font_notosans_regular = "https://tstdrv1030358.app.netsuite.com/core/media/media.nl?id=64862&c=TSTDRV1030358&h=ffaf3cf738e4a580f9d6&_xt=.ttf" />
<#assign font_notosans_bold = "https://tstdrv1030358.app.netsuite.com/core/media/media.nl?id=64860&c=TSTDRV1030358&h=dafa1f767234034bb616&_xt=.ttf" />
<#assign font_notosans_italic = "https://tstdrv1030358.app.netsuite.com/core/media/media.nl?id=64861&c=TSTDRV1030358&h=e288e0b7f19cdf549bbb&_xt=.ttf" />
<#assign font_notosans_bolditalic = "https://tstdrv1030358.app.netsuite.com/core/media/media.nl?id=64860&c=TSTDRV1030358&h=dafa1f767234034bb616&_xt=.ttf" />

<link type="font" name="NotoSans" subtype="TrueType" src="${font_notosans_regular?html}" src-bold="${font_notosans_bold?html}" src-italic="${font_notosans_italic?html}" src-bolditalic="${font_notosans_bolditalic?html}" />

<style type="text/css">
* {
  font-family: NotoSans, Arial, sans-serif;
}
body {
  font-family: NotoSans, Arial, sans-serif;
  font-size: 18pt;
}
</style>
</head>
<body>
  <table><tr><td>
    <p><b><span style="font-size: 24pt;">Example Font Addition: Noto Sans</span></b></p>
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
    <p>123456790</p>
    <p>ABCDEFGHIJKLMNOPQRSTUVWXYZ</p>
    <p>abcdefghijklmnopqrstuvwxyz</p>
    <p><b>ABCDEFGHIJKLMNOPQRSTUVWXYZ</b></p>
    <p><b>abcdefghijklmnopqrstuvwxyz</b></p>
    <p><b><i>ABCDEFGHIJKLMNOPQRSTUVWXYZ</i></b></p>
    <p><b><i>abcdefghijklmnopqrstuvwxyz</i></b></p>
    <p><i>ABCDEFGHIJKLMNOPQRSTUVWXYZ</i></p>
    <p><i>abcdefghijklmnopqrstuvwxyz</i></p>
    <p><i>${font_notosans_regular?html}</i></p>
  </td></tr></table>
</body>
</pdf>

Extend NetSuite Advanced PDF and HTML Technologies

We are experts in NetSuite’s Advanced PDF and HTML Technologies. Our expertise is demonstrated by the tool we give to our clients free of charge called the Content Renderer Engine. If you found this article helpful, feel free to receive notifications of new articles as I publish them. If you have a challenging NetSuite HTML or PDF concern, let’s have a conversation.

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

More Posts - Website - Twitter - Facebook - LinkedIn - YouTube

About Marty Zigman

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

Biography • Website • X (Twitter) • Facebook • LinkedIn • YouTube

3 thoughts on “How To: Add Custom Fonts to NetSuite Generated PDF Documents

  1. Pete says:

    Brilliant, worked like a charm. Thanks Marty

  2. Puja says:

    Hi,
    I am trying to use MICR font file for check printing but thats not working, could you please help

  3. Marty Zigman says:

    Hello Puja,

    Did you download and reference the MICR fonts? Here is a reference:
    https://www.1001fonts.com/micr-encoding-font.html

    Folks on Reddit are talking about it too:
    https://www.reddit.com/r/Netsuite/comments/1csm69y/printing_checks_out_of_netsuite/

    If you need our analysts support, contact me direct:
    https://www.prolecto.com/contact-us/

    Marty

Leave a Reply

Your email address will not be published. Required fields are marked *