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:
- FreeMarker: String template framework. Many mistake this as the technology that generates the PDF;
- 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.
- Supercharge NetSuite Advanced PDF/HTML Templates
- Interrogating NetSuite’s Advanced PDF / HTML Templates
- Framework for Generating Custom NetSuite PDF Files
- How To: Leverage NetSuite’s Advanced PDF / HTML Generation Tools
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?
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.
above code is not working for Customer statement advanced PDF, it is working in Preview but not working through print statement
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/