14 minutes Read

Published On

How to Append Two Or More PDF Documents In NetSuite

While working on NetSuite implementations you may have come across situations where you had to generate a PDF report from a particular record by appending two or more PDF documents together. We recently encountered this requirement while working on an ERP implementation for one of our NetSuite clients.

CTA - NetSuite Implementation Banner

The client wanted us to provide a button on the Estimate record that would enable them to generate a record specific PDF. The catch here was that in order to generate this PDF report, we had to append two existing PDF documents with our newly generated PDF via SuiteScript. To solve this problem, we used the PDFSET tag provided by BFO for appending PDFs (as shown below).

<pdfset>

<pdf>

<body>

Document body here

</body>

</pdf>

<pdf src=”resource/pdf1.pdf” />

<pdf src=”resource/pdf2.pdf” />

</pdfset>

CTA - NetSuite Integration Connector Banner

Here’s the code snippet we used in NetSuite.

var xml = “<?xml version=”1.0”?>n<!DOCTYPE pdf PUBLIC “-//big.faceless.org//report” “report-1.1.dtd”>n”;

xml += “<pdfset>n”;

xml += “<pdf>n<body font-size=”12″>n<h3>Genereated PDft</h3>n”;

xml += “<p></p>”;

xml += “Document body here”;

xml += “</body>n</pdf>”;

xml += “<pdf src=”resource/pdf1.pdf” />”;

xml += “<pdf src=”resource/pdf2.pdf” />”;

xml += “</pdfset>”;

var file = nlapiXMLToPDF( xml );

file.setFolder(<FOLDER_ID>);

nlapiSubmitFile(file);

If you have a NetSuite implementation requirement you would like to discuss, or would like to know more about our NetSuite implementation services, please get in touch with us  

Table of Contents

Contact Us

By submitting this form, you agree to our privacy policy and terms of service.

Related resources you might be interested in

Deeper in to NetSuite, Development & Customization
Deeper in to NetSuite, Operations & Supply Chain

We'd love to help you with all your NetSuite needs

Folio3 Your Top Choice:

Middle East Partner 2025
education award 2025
Winner Award
Software and IT Services 2024
Financial-Services-2023
SuiteCommerce 2023

Let's discuss your NetSuite needs

Hello, How can we help you?