Different papers sizes on Zebra printers

I'm trying to print labels with Zebra Browser Print. What I'm trying to figure out is how to support different papers size for printing the same label. Any ideas to achieve this ?

 

 

var available_printers = null;

var selected_category = null;

var default_printer = null;

var selected_printer = null;

var format_start = "^XA^LL200^FO80,50^A0N36,36^FD";

var format_end = "^FS^XZ";

var default_mode = true;        

 

 

var labelText = "^XA^PW400^LL400^PON^FO0,10^A0,20,20^FD" + firstLine

                      + "^FS^FO0,50^A0,15,15^FD" + secondLIne +      "^FS^FO0,90^A0,15,15^FD,"

                      + thirdLine + "," + "^FS^FO0,130^A0,15,15^FD" + fourthLine

                      + "^FS^FO0,150^A0,15,15^FD" + fifthLine + "^FS"

                      + "^FO0,180^BY3^B8N,50,Y,N^FD"+barcode+"^FS"

                      + "^XZ";

 

 

      sendData(labelText);

 

 

 

 

function sendData(sDivText)

{

showLoading("Printing...");

checkPrinterStatus(function (text) {

 

 

    selected_printer.send(format_start + sDivText + format_end,  printComplete, printerError);

 

 

 

 

});