function helloWorld()
{
var xml = "<?xml version=\"1.0\"?>\n<!DOCTYPE pdf PUBLIC \"-//big.faceless.org//report\" \"report-1.1.dtd\">";
xml += "<pdf>\n";
xml += "<head>";
xml += "<macrolist>";
xml += "<macro id=\"watermark\">";
xml += "<p rotate=\"-45\" font-size=\"30pt\" color=\"#C0C0C0\">";
xml += "Confidential";
xml += "</p>";
xml += "</macro>";
xml += "</macrolist>";
xml += "</head>";
xml += "<body font-size=\"18\" background-macro=\"watermark\">\nHello World!\n</body>\n";
xml += "</pdf>";
var file = nlapiXMLToPDF( xml );
response.setContentType('PDF','helloworld.pdf');
response.write( file.getValue() );
}
Notice that I have used "macro". According to BFO's user guide, macro is used as a block of XML which can be repeated multiple times throughout the document.
No comments:
Post a Comment