Dear all,
does anyone know how to set barcode printout in suitelet?
below are the suitelet code that I used for generating barcode, but the outcome the barcode printout is very small.
function printDOReceipt(request, response) { var recId = request.getParameter('id'); nlapiLogExecution('DEBUG', 'Record Id', recId); var objFulfillment = nlapiLoadRecord('itemfulfillment', recId); var Addressee = objFulfillment.getFieldValue('shipcompany'); var tranid = objFulfillment.getFieldValue('tranid'); var strName = ""; strName = strName + "<table width ="100%" >"; strName = strName + "<tr>"; strName = strName + "<td style="font-size:50pt;border-top:0; border-bottom:0; border-left:0; border-right:0;" width ="100%" align="center">Penerima,</td>"; strName = strName + "</tr>"; strName = strName + "</table>"; strName = strName + "<br/>"; strName = strName + "<br/>"; strName = strName + "<table width ="100%" >"; strName = strName + "<tr>"; strName = strName + "<td style="font-size:50pt;border-top:0; border-bottom:0; border-left:0; border-right:0;" width ="100%" align="center">_______________</td>"; strName = strName + "</tr>"; strName = strName + "<tr>"; strName = strName + "<td style="font-size:50pt;border-top:0; border-bottom:0; border-left:0; border-right:0;" width ="100%" align="center">" + Addressee + "</td>"; strName = strName + "</tr>"; strName = strName + "<tr>"; strName = strName + "<td style="font-size:50pt;border-top:0; border-bottom:0; border-left:0; border-right:0;" width ="100%" align="center"><barcode codetype="code128" showtext="true" value="" + tranid + ""/></td>"; strName = strName + "</tr>"; strName = strName + "</table>"; //build up BFO-compliant XML using well-formed HTML var xml = "<?xml version="1.0"?>n<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">"; xml += "<pdf>n"; xml += "<head>"; xml += "</head>"; xml += "<body font-size="50">"; xml += "<p align="center"><h3>DO Receipt</h3></p>"; xml += strName; xml += "</body>n</pdf>"; var file = nlapiXMLToPDF( xml ); response.setContentType('PDF','DO Receipt - ' + tranid + '.pdf', 'inline'); response.write( file.getValue() ); } function addCommas(n){ var rx= /(d+)(d{3})/; return String(n).replace(/^d+/, function(w){ while(rx.test(w)){ w= w.replace(rx, 'Dear all,
does anyone know how to set barcode printout in suitelet?
below are the suitelet code that I used for generating barcode, but the outcome the barcode printout is very small.
.function printDOReceipt(request, response)
{
var recId = request.getParameter('id');
nlapiLogExecution('DEBUG', 'Record Id', recId);
var objFulfillment = nlapiLoadRecord('itemfulfillment', recId);
var Addressee = objFulfillment.getFieldValue('shipcompany');
var tranid = objFulfillment.getFieldValue('tranid');
var strName = "";
strName = strName + "<table width =\"100%\" >";
strName = strName + "<tr>";
strName = strName + "<td style=\"font-size:50pt;border-top:0; border-bottom:0; border-left:0; border-right:0;\" width =\"100%\" align=\"center\">Penerima,</td>";
strName = strName + "</tr>";
strName = strName + "</table>";
strName = strName + "<br/>";
strName = strName + "<br/>";
strName = strName + "<table width =\"100%\" >";
strName = strName + "<tr>";
strName = strName + "<td style=\"font-size:50pt;border-top:0; border-bottom:0; border-left:0; border-right:0;\" width =\"100%\" align=\"center\">_______________</td>";
strName = strName + "</tr>";
strName = strName + "<tr>";
strName = strName + "<td style=\"font-size:50pt;border-top:0; border-bottom:0; border-left:0; border-right:0;\" width =\"100%\" align=\"center\">" + Addressee + "</td>";
strName = strName + "</tr>";
strName = strName + "<tr>";
strName = strName + "<td style=\"font-size:50pt;border-top:0; border-bottom:0; border-left:0; border-right:0;\" width =\"100%\" align=\"center\"><barcode codetype=\"code128\" showtext=\"true\" value=\"" + tranid + "\"/></td>";
strName = strName + "</tr>";
strName = strName + "</table>";
//build up BFO-compliant XML using well-formed HTML
var xml = "<?xml version=\"1.0\"?>\n<!DOCTYPE pdf PUBLIC \"-//big.faceless.org//report\" \"report-1.1.dtd\">";
xml += "<pdf>\n";
xml += "<head>";
xml += "</head>";
xml += "<body font-size=\"50\">";
xml += "<p align=\"center\"><h3>DO Receipt</h3></p>";
xml += strName;
xml += "</body>\n</pdf>";
var file = nlapiXMLToPDF( xml );
response.setContentType('PDF','DO Receipt - ' + tranid + '.pdf', 'inline');
response.write( file.getValue() );
}
function addCommas(n){
var rx= /(\d+)(\d{3})/;
return String(n).replace(/^\d+/, function(w){
while(rx.test(w)){
w= w.replace(rx, '$1.$2');
}
return w;
});
}'); } return w; }); }