Adding Files to Advanced PDF Templates
In NetSuite, you can add files, such as spreadsheets, images, or other types of documents to your PDF templates to provide additional information to your customers. You can also add XML files that contain structured, machine-readable data, so your customers can use accounting software of their choice to extract and process invoice details efficiently.
This article provides a step-by-step guide on how to add an attachment to your advanced PDF template.
To add an attachment to your advanced template:
-
Add a file to the File Cabinet.
-
Go to Documents > Files > File Cabinet and open the folder where you want to upload the file.
-
In the top-left corner, click Add File and select the file you want to upload.
-
Click Open to upload the file.
-
Click Edit next to the uploaded file.
-
Check the Available Without Login setting to ensure the file is accessible.
-
Copy the URL of the file.
-
Click Save to save the changes.
-
-
Edit your advanced PDF template. In this example, an XML file is added to your template.
-
Go to Customization > Forms > Advanced PDF/HTML Template.
-
Click Customize or Edit next to the template you want to add the attachment to.
-
In the top-right corner, switch to Source Code mode.
-
Add the following line of code to your chosen location.
<link type="attachment/data" name="example.xml" subtype="application/xml" src="https://system.netsuite.com/core/media/media.nl?id=2.xml"/>
-
Make the following updates:
-
Replace the value of
src
with the URL you copied in Step 1f. -
Replace any
&
characters in the link with&
. -
Update the
name
value with the name of your file (for example, data.xls).
-
-
Instead of using a link from the File Cabinet, you can also add a reference to a field that contains the path to your file, for example:
<link type="attachment/data" name="data2_document_field.xml" subtype="application/xml" src="${record.custbody4@url}"/>
Related Topics
- Source Code Editing in the Template Editor
- Source Code Editing to Customize Advanced Templates
- Syntax for Advanced Template Fields
- Setting a Template to Use a Font Unavailable in NetSuite
- Languages for Printed Forms that Use Advanced Templates
- Adding Translated Content in Advanced Printouts
- Adding Striping to Line Items in Advanced Templates
- Adding Page Breaks to Tables
- Printing Subsidiary Logo on Advanced Templates
- Adding Apply Sublist to Check Templates
- Using FreeMarker to Work with Hidden Fields Used in Advanced Templates
- Adding Bar Codes in Advanced Templates
- XML Formatting in Advanced PDF/HTML Templates