Marty Zigman Marty Zigman
Prolecto Labs Accelerator Templates

How To: Password Protect NetSuite Generated PDF Files

NetSuite Technical

Tags:

This article is relevant if you need to generate password protected PDF files in NetSuite.

Background

Some organizations need to distribute information to interested parties (customers, partners, and others) but they are concerned that the information should not get in the hands of unintended parties. One simple way to handle this is to password protect a PDF so that only the intended recipient can open and read it.

How to Password Protect a NetSuite Generated PDF File

The way to password protect a file in NetSuite is quite simple. The assumption is that you are using the Advanced PDF template tool which will give you control over the content generation. All that is needed is a new meta tag in the head portion of your template. See below:

<head>
   <meta name="password" value="PrAH62ScUgVBUxho" />
</head>

You will need to produce agreement in advanced with your intended recipient what key to use so they will know how to open the PDF.  I have seen some tax accountants use the last four digits of a social security number as a key. You could use an account number that both parties know. Of course, another technique is to store a unique key in NetSuite that only the intended party should know. Ultimately, your job will be to get this key into the PDF generator.

Related NetSuite PDF Generation Tools

Remember, NetSuite’s PDF generation utilize two primary technologies:

  1. FreeMarker:  String template framework.  Many mistake this as the technology that generates the PDF;
  2. Big Faceless (BFO) Report Generator: The technology that assembles XML generated from FreeMarker with special syntax to generate a PDF.   This is the technology that produces the Password Protected PDF file.
My firm has generated an extended framework to generate PDFs that can span and link multiple saved searches while offering other string template frameworks such as TrimPath and HandleBars.  The FreeMarker template language, as implemented by NetSuite, has important limitations that template developers should understand.   See these related articles:
  1. Supercharge NetSuite Advanced PDF/HTML Templates
  2. Interrogating NetSuite’s Advanced PDF / HTML Templates
  3. Framework for Generating Custom NetSuite PDF Files
  4. How To: Leverage NetSuite’s Advanced PDF / HTML Generation Tools

Get Help with Your PDF Generation Requirements

NetSuite’s Advanced PDF template tool does a good job to open the possibilities for creating PDFs.  However, there are some important limitations that we have overcome by extending the framework.  If you have a demanding PDF generation requirements, 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

4 thoughts on “How To: Password Protect NetSuite Generated PDF Files

  1. Mollie says:

    Hi Marty, I found this post on your blog while trying to find a way to password protect a NetSuite-generated PDF from being edited. I’ve set the access levels through a meta tag like , but I’d like to allow some people to edit if they have the password. Is this possible?

  2. Marty Zigman says:

    Hello Mollie,

    That’s an interesting question. It appears that the underlying PDF generating engine does support different password management. See this article. However, this method is not exposed to us in NetSuite’s implementation of the BFO library.

  3. Sheetal says:

    above code is not working for Customer statement advanced PDF, it is working in Preview but not working through print statement

  4. Marty Zigman says:

    Hello Sheetal,

    I am speculating here but the method that drive printing customer statements my be going through the legacy print processor. Please consider these articles which will indeed get full control:

    https://blog.prolecto.com/2021/06/05/extend-netsuite-customer-statements/
    https://blog.prolecto.com/2020/06/27/take-control-scalable-netsuite-customer-statement-generation/

Leave a Reply

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