Modules

filter

 

Objects/Functions

module (N/render)

SuiteScript 2.0

render.TemplateRenderer

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=render.TemplateRenderer for more information.

N/render Module
render.TemplateRenderer
Object Description: Encapsulates a template engine object that produces HTML and PDF printed forms utilizing advanced PDF/HTML template capabilities. The template engine object includes methods that pass in a template as string to be interpreted by FreeMarker, and render interpreted content in your choice of two different formats: as HTML output to an nlobjResponse object, or as XML string that can be passed to render.xmlToPdf(options) to produce a PDF. This object is available when the Advanced PDF/HTML Templates feature is enabled. For a complete list of this object’s methods and properties, see TemplateRenderer Object Members.
Supported Script Types: Server-side scripts For more information, see SuiteScript 2.0 Script Types.
Module: N/render Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=render.TemplateRenderer

Example:

// Code Example 1
//Add additional code
//Advanced PDF/HTML Templates feature must be enabled
//...
var xmlTmplFile = file.load('Templates/PDF Templates/invoicePDFTemplate.xml');
var myFile = render.create();
myFile.templateContent = xmlTplFile.getContents();
myFile.addRecord('record', record.load({
type: record.Type.INVOICE,
id: 37
}));
var invoicePdf = myFile.renderAsPdf();
//...
//Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4412065265.html