Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The NetSuite Pro

The NetSuite Pro Logo The NetSuite Pro Logo

The NetSuite Pro Navigation

  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • Advanced PDF Templates in NetSuite
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • Advanced PDF Templates in NetSuite
  • Blog
  • Contact Us
Home/ Advanced PDF Templates in NetSuite/Real-World Advanced PDF Examples

Real-World Advanced PDF Examples

Now that you’ve learned the fundamentals of Advanced PDF (FreeMarker, conditional logic, CSS styling, custom fields, and multi-subsidiary support), let’s put it all together with complete real-world examples.

These templates are ready-to-use samples that you can copy, adapt, and apply in your NetSuite account.


🔹 Example 1: Invoice Template (With Logo, Header & Table)

<!-- Company Logo -->
<div style="text-align:center;">
   <img src="${record.logo}" width="200"/>
</div>

<!-- Header Info -->
<h2 style="text-align:center;">Invoice</h2>
<p><b>Invoice #:</b> ${record.tranid}</p>
<p><b>Date:</b> ${record.trandate?string("MMMM dd, yyyy")}</p>
<p><b>Customer:</b> ${record.entity}</p>

<!-- Line Item Table -->
<table width="100%" style="border-collapse: collapse; font-size:12px; margin-top:15px;">
   <tr style="background:#f2f2f2; font-weight:bold;">
      <th style="border:1px solid #ccc; padding:5px;">Item</th>
      <th style="border:1px solid #ccc; padding:5px;">Qty</th>
      <th style="border:1px solid #ccc; padding:5px; text-align:right;">Rate</th>
      <th style="border:1px solid #ccc; padding:5px; text-align:right;">Amount</th>
   </tr>
   <#list record.item as i>
      <tr <#if i_index % 2 == 0>style="background:#f9f9f9;"</#if>>
         <td style="border:1px solid #ddd; padding:5px;">${i.item}</td>
         <td style="border:1px solid #ddd; padding:5px; text-align:center;">${i.quantity}</td>
         <td style="border:1px solid #ddd; padding:5px; text-align:right;">${i.rate?string["#,##0.00"]}</td>
         <td style="border:1px solid #ddd; padding:5px; text-align:right;">${i.amount?string["#,##0.00"]}</td>
      </tr>
   </#list>
</table>

<!-- Total -->
<p style="text-align:right; font-size:14px; font-weight:bold; margin-top:10px;">
   Total Due: ${record.total?string["#,##0.00"]} ${record.currency}
</p>

🔹 Example 2: Sales Order with Conditional Shipping Terms

<h2>Sales Order</h2>
<p><b>Order #:</b> ${record.tranid}</p>
<p><b>Date:</b> ${record.trandate?string("dd-MMM-yyyy")}</p>
<p><b>Customer:</b> ${record.entity}</p>

<#if record.shipmethod?has_content>
   <p><b>Shipping Method:</b> ${record.shipmethod@label}</p>
</#if>

<#if record.terms?has_content>
   <p><b>Payment Terms:</b> ${record.terms@label}</p>
<#else>
   <p><b>Payment Terms:</b> Prepaid</p>
</#if>

✔️ Dynamic shipping method and payment terms.


🔹 Example 3: Multi-Subsidiary Statement Footer

<#switch record.subsidiary>
   <#case "1">
      <p style="font-size:11px; text-align:center; margin-top:20px;">
         © ${.now?string("yyyy")} UK Subsidiary Ltd. VAT: GB123456789
      </p>
      <#break>
   <#case "2">
      <p style="font-size:11px; text-align:center; margin-top:20px;">
         © ${.now?string("yyyy")} Canada Subsidiary Inc. GST/HST: 789456123RT0001
      </p>
      <#break>
   <#default>
      <p style="font-size:11px; text-align:center; margin-top:20px;">
         © ${.now?string("yyyy")} ${record.companyname}
      </p>
</#switch>

✔️ Prints different footer text based on subsidiary.


🔹 Example 4: Highlight High-Value Orders

<#list record.item as i>
   <tr <#if i.amount?number > 5000>style="background:#ffe6e6;"</#if>>
      <td>${i.item}</td>
      <td>${i.description}</td>
      <td>${i.quantity}</td>
      <td style="text-align:right;">${i.rate?string["#,##0.00"]}</td>
      <td style="text-align:right;">${i.amount?string["#,##0.00"]}</td>
   </tr>
</#list>

✔️ Highlights rows where line amount exceeds 5,000.


🔹 Example 5: Custom Fields Section

<#if record.custbody_project_code?has_content>
   <p><b>Project Code:</b> ${record.custbody_project_code}</p>
</#if>
<#if record.custbody_delivery_note?has_content>
   <p><b>Delivery Note:</b> ${record.custbody_delivery_note}</p>
</#if>

✔️ Displays custom body fields only when values exist.


✅ Best Practices

  • Always clone and test before applying to production.
  • Use inline CSS for better compatibility.
  • Keep tables clean and consistent.
  • Validate each section step by step to avoid crashes.
  • Make templates modular (header, body, footer sections).

✅ Summary — What You Learned

By the end of this page, you now have complete Advanced PDF examples for:

  • ✅ A full Invoice layout with logo, header, line items, and totals
  • ✅ A Sales Order template with conditional terms
  • ✅ A Statement footer that changes by subsidiary
  • ✅ A Line item table with conditional highlights
  • ✅ A Custom field section for project codes and notes

With these, you can create professional, branded, and dynamic PDFs in NetSuite.

Share
  • Facebook

Leave a ReplyCancel reply

Sidebar

Ask A Question

Stats

  • Questions 6
  • Answers 6
  • Best Answers 0
  • Users 2
  • Popular
  • Answers
  • Rocky

    Issue in running a client script in NetSuite SuiteScript 2.0 ...

    • 1 Answer
  • admin

    How can I send an email with an attachment in ...

    • 1 Answer
  • admin

    How do I avoid SSS_USAGE_LIMIT_EXCEEDED in a Map/Reduce script?

    • 1 Answer
  • admin
    admin added an answer The issue is usually caused by following Wrong script file… September 14, 2025 at 10:33 pm
  • admin
    admin added an answer Steps to send an Invoice PDF by email: define(['N/email', 'N/render',… August 28, 2025 at 3:05 am
  • admin
    admin added an answer This error means your script hit NetSuite’s governance usage limit… August 28, 2025 at 3:02 am

Top Members

Rocky

Rocky

  • 1 Question
  • 21 Points
Begginer
admin

admin

  • 5 Questions
  • 2 Points

Trending Tags

clientscript netsuite scripting suitescript

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

© 2025 The NetSuite Pro. All Rights Reserved