how to print zpl barcode vertically in vertical label

Krishna38 picture Krishna38 · Oct 8, 2014 · Viewed 14.9k times · Source

i am using zebraGk420d printer. i am using vertical barcode label. how to print the text and barcode in vertically. my zpl code like this

$barcode_ZPL_code="^XA
^FO 150,50^AD,40^FH^FDSALABED_20CARGO^FS 
^FO80,100^AD^BY2
^BCN,100,Y,N,N
^MD10
^FDLTX81316-1(1)-APP^FS
^FO1,250^A0N,20,20^FH^FDCOURIER_20TYPE_3ACHEDDI_20JAGAN_20AIPORT_20GUYANA_20OWN_20CLEARING_20TEST^FS
^FO1,280^A0N,20,20^FH^FDDESTINATION_3ASALABED_202CARGO_20PLOT_20710_20BLOCK_2012_20KISENYI_20ROAD_2E_2E_2E^FS
^FO1,310^A0N,20,20^FH^FDHEAD_20OFFICE_3AUNIT_204A_20ORBITAL_20BUSINESS_20PARK_205_20ARGON_20ROAD^FS
^FO106,340^A0N,20,20^FH^FDEDMONTON_20LONDON_20N18_203BW_20EMAIL_3AINFO_40SALABED_2ECO_2EUK^FS
^FO106,370^A0N,20,20^FH^FDTEL_3A_2B44_28020_29_208884_204060_20WEBSITE_3AWWW_2ESALABED_2ECO_2EUK^FS
^XZ";

This code prints in horizontal format.Thanks in advance.

Answer

user3025177 picture user3025177 · Oct 8, 2014

You can specify orientation for each text/barcode field individually, for example if some fields should print horizontally and others at 90 degrees, or use a default orientation for all fields, and then only specify orientation for exceptions to that rule.

The individual field orientation in your label for text and barcodes are specified in the fourth letter of ^AON and ^BCN commands. To change the orientation of any of these fields, use the appropriate letter from following list:

  • N = normal
  • R = rotated 90 degrees (clockwise)
  • I = inverted 180 degrees
  • B = read from bottom up, 270 degrees

For example, to print the barcode at 90 degrees, replace ^BCN,.... to ^BCR,..., or to print a particular text line at 90 degrees, replace ^AON,... to ^AOR,....

To change the default orientation of all fields in your label, you can use ^FWx before any text / barcode fields are called out, where x represents the desired default orientation (from above list of orientation options), and only include the orientation letter in individual text / barcode commands (i.e., change ^BCN,... to ^BC,... and ^AON,... to ^AO,...) for any exceptions to that default orientation.

For example, to print all fields at 90 degrees except the last text line you can use the following (notice the added ^FWR command and the orientation letter removed from all text / barcode fields except the last text command):

$barcode_ZPL_code="^XA
^FWR
^FO 150,50^AD,40^FH^FDSALABED_20CARGO^FS 
^FO80,100^AD^BY2
^BC,100,Y,N,N
^MD10
^FDLTX81316-1(1)-APP^FS
^FO1,250^A0,20,20^FH^FDCOURIER_20TYPE_3ACHEDDI_20JAGAN_20AIPORT_20GUYANA_20OWN_20CLEARING_20TEST^FS
^FO1,280^A0,20,20^FH^FDDESTINATION_3ASALABED_202CARGO_20PLOT_20710_20BLOCK_2012_20KISENYI_20ROAD_2E_2E_2E^FS
^FO1,310^A0,20,20^FH^FDHEAD_20OFFICE_3AUNIT_204A_20ORBITAL_20BUSINESS_20PARK_205_20ARGON_20ROAD^FS
^FO106,340^A0,20,20^FH^FDEDMONTON_20LONDON_20N18_203BW_20EMAIL_3AINFO_40SALABED_2ECO_2EUK^FS
^FO106,370^A0N,20,20^FH^FDTEL_3A_2B44_28020_29_208884_204060_20WEBSITE_3AWWW_2ESALABED_2ECO_2EUK^FS
^XZ";

Also, you will need to adjust the x/y coordinates once you change field orientation.