Saturday, March 30, 2019

Force Page Break in PDF File Created by Using nlapiXMLtoPDF

The <pbr/> tag forces a page break at the specified point in the document. More information about this tag can be found in the BFO Tag Documentation.

A sample Suitelet which creates a two-paged document, by splitting the pages with the <pbr/> tag, can be found below:

function suitelet(request, response){     // Build the XML.     var xml = "<?xml version=\"1.0\"?>\n<!DOCTYPE pdf PUBLIC \"-//big.faceless.org//report\" \"report-1.1.dtd\">\n";     xml += "<pdf><body>";     xml += "<p>This is the first page.</p>";     xml += "<pbr/>";     xml += "<p>This is the second page.</p>";     xml += "</body></pdf>";     // Use nlapiXMLtoPDF to generate a PDF file and save it to the File Cabinet.     var file = nlapiXMLToPDF(xml);     file.setFolder(233);     nlapiSubmitFile(file);}	

No comments:

Post a Comment