Author Topic: Barcodes  (Read 2606 times)

0 Members and 1 Guest are viewing this topic.

Offline Mad Axeman

  • Newbie
  • Posts: 74
    • View Profile
    • My web site - Harrythetrout
Barcodes
« on: July 21, 2020, 04:55:11 pm »
Have any of you had any success with printing barcodes to Brother label printers, specificaly the QL-700 ? I believe they don't use standard codes but Brother specific ones??
Oh look - a sig file :-)

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Barcodes
« Reply #1 on: July 21, 2020, 06:35:08 pm »
@Mad Axeman My job, before my promotion, was the person in charge of barcodes and barcode printers. I've never worked with that model of printer though. Mine has been primarily Printronix and Zebra. However, I have code for the SDK for Printronix printers converted to QB64 if you wish to have it. It can print to any printer.
Shuwatch!

Offline Mad Axeman

  • Newbie
  • Posts: 74
    • View Profile
    • My web site - Harrythetrout
Re: Barcodes
« Reply #2 on: July 25, 2020, 05:01:21 pm »
Thanks. I can give it a try and see if I can work anything with it.
Oh look - a sig file :-)

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Barcodes
« Reply #3 on: July 25, 2020, 05:10:48 pm »
Here is the BI file for the Printronix SDK:
Attached is the dll file and here is the link for the reference manual:
https://printronixautoid.com/wp-content/uploads/2019/07/P180121A_PRM_SDK.pdf

You can't print Printronix language barcodes to other printers using the Forms but you can use sendcommand to send a string containing the label in the language of the printer you are using.
You're mostly going to need "openport" and "sendcommand". With openport, you just pass it the string of the name of the printer as it appears in Devices and Printers in Control Panel.

Code: QB64: [Select]
  1. $IF PTXBI = UNDEFINED THEN
  2.     $LET PTXBI = TRUE
  3.     DECLARE DYNAMIC LIBRARY "PTXLIB"
  4.         FUNCTION DLLinit ALIAS PTXA_DLLinit
  5.         FUNCTION DLLexit ALIAS PTXA_DLLexit
  6.         FUNCTION GetDLLVersion$ ALIAS PTXA_GetDllVersion
  7.         FUNCTION PrinterReset$ ALIAS PTXA_PrinterReset
  8.         FUNCTION SetupStatus ALIAS PTXA_SetupStatus (BYVAL mode AS LONG)
  9.         FUNCTION GetStatus$ ALIAS PTXA_GetStatus
  10.         FUNCTION JobSetup ALIAS PTXA_JobSetup (BYVAL mode AS LONG, BYVAL value AS LONG)
  11.         FUNCTION CreateForm ALIAS PTXA_CreateForm (FormName AS STRING)
  12.         FUNCTION FormSetup ALIAS PTXA_FormSetup (BYVAL mode AS LONG, BYVAL value AS LONG)
  13.         FUNCTION Scale ALIAS PTXA_Scale (BYVAL hdpi AS LONG, BYVAL vdpi AS LONG)
  14.         FUNCTION DrawBox ALIAS PTXA_DrawBox (BYVAL lForm AS LONG, BYVAL LT AS LONG, BYVAL SR AS LONG, BYVAL SC AS LONG, BYVAL ER AS LONG, BYVAL EC AS LONG)
  15.         FUNCTION DrawLine ALIAS PTXA_DrawLine (BYVAL lForm AS LONG, BYVAL LT AS LONG, BYVAL SR AS LONG, BYVAL SC AS LONG, BYVAL ER AS LONG, BYVAL EC AS LONG)
  16.         FUNCTION PrintTextEng ALIAS PTXA_PrintTextEng (BYVAL lForm AS LONG, BYVAL SR AS LONG, BYVAL SC AS LONG, BYVAL VE AS LONG, BYVAL HE AS LONG, datas AS STRING)
  17.         FUNCTION PrintTextCH ALIAS PTXA_PrintTextCH (BYVAL lForm AS LONG, BYVAL SR AS LONG, BYVAL SC AS LONG, BYVAL VE AS LONG, BYVAL HE AS LONG, datas AS STRING)
  18.         FUNCTION PrintImage ALIAS PTXA_PrintImage (BYVAL lForm AS LONG, BYVAL SR AS LONG, BYVAL SC AS LONG, logoname AS STRING)
  19.         FUNCTION SetBarcode ALIAS PTXA_SetBarcode (BYVAL BcdType AS LONG, BYVAL mode AS LONG, value AS STRING)
  20.         FUNCTION PrintBarcode ALIAS PTXA_PrintBarcode (BYVAL lForm AS LONG, BYVAL BcdType AS LONG, BYVAL SR AS LONG, BYVAL SC AS LONG, datas AS STRING)
  21.         FUNCTION PrintForm ALIAS PTXA_PrintForm (BYVAL lForm AS LONG)
  22.         FUNCTION GetFormData$ ALIAS PTXA_GetFormData (BYVAL lForm AS LONG)
  23.         FUNCTION SetupRFID ALIAS PTXA_SetupRFID (BYVAL length AS LONG, BYVAL incremental AS LONG, format AS STRING, BYVAL increment_amount AS LONG, datas AS STRING)
  24.         FUNCTION WriteRFID ALIAS PTXA_WriteRFID (BYVAL lForm AS LONG, LOCK AS STRING, membank AS STRING)
  25.         FUNCTION VerifyRFID ALIAS PTXA_VerifyRFID (BYVAL lForm AS LONG, UNLOCK AS STRING, membank AS STRING, BYVAL length AS LONG, format AS STRING)
  26.         FUNCTION FontSetup ALIAS PTXA_FontSetup (BYVAL mode AS LONG, value$)
  27.         FUNCTION PTXA_Read$ (EndSymbol AS STRING)
  28.         FUNCTION about
  29.         FUNCTION openport (printername AS STRING)
  30.         FUNCTION openethernet (ipaddress AS STRING, BYVAL portnumber AS LONG)
  31.         FUNCTION closeport
  32.         FUNCTION sendcommand (printercommand AS STRING)
  33.     END DECLARE
  34.     '----------------------------------------------------------------------------------
  35.     'PTXA_SetupStatus()
  36.     CONST SnoopOff = 0 'Disable snooper
  37.     CONST SnoopSer = 1 'Serial
  38.     CONST SnoopPar = 2 'Parallel
  39.     CONST SnoopEth = 3 'Ethernet
  40.  
  41.     'PTXA_JobSetup()
  42.     CONST JobModeReset = 0 'There is no Job parameter setting before the form
  43.     CONST JobModeWidth = 1 'Width
  44.     CONST JobModeLength = 2 'Height
  45.     CONST JobModeSpeed = 3 'Speed IPS
  46.     CONST JobModeIntensity = 4 'Intensity
  47.     CONST JobModeLabel = 5 'Label Sensor
  48.     CONST JobModeMedia = 6 'Media
  49.     CONST JobModeRotate = 7 'Rotation
  50.     '----------------------------------------------------------------------------------
  51.     'PTXA_JobModeLabel
  52.     CONST JobLabelNoSensor = 0 'No sensor
  53.     CONST JobLabelMark = 1 'Mark
  54.     CONST JobLabelGap = 2 'Gap
  55.     CONST JobLabelAdvGap = 3 'Advanced gap
  56.     CONST JobLabelAdvNotch = 4 'Advanced notch
  57.     '----------------------------------------------------------------------------------
  58.     'PTXA_JobModeMedia
  59.     CONST JobMediaCon = 0 'Continuous mode
  60.     CONST JobMediaTearoffStrip = 1 'Tear-off script
  61.     CONST JobMediaTearoff = 2 'Tear-off mode
  62.     CONST JobMediaPeeloff = 3 'Peel-off
  63.     CONST JobMediaCut = 4 'Cut
  64.     '----------------------------------------------------------------------------------
  65.     'PTXA_JobModeRotate
  66.     CONST JobRotatePort = 0 'Portrait
  67.     CONST JobRotateLand = 90 'Landscape
  68.     CONST JobRotateInvPort = 180 'Inverted portrait
  69.     CONST JobRotateInvLand = 270 'Inverted landscape
  70.     '----------------------------------------------------------------------------------
  71.     'PTXA_SetBarcode()
  72.     'bcdtype (PTXA_SetBarcode() and PTXA_PrintBarcode())
  73.     CONST BCD_C39 = 0 'Code39
  74.     CONST BCD_C128A = 1 'CODE128A
  75.     CONST BCD_C128B = 2 'CODE128B
  76.     CONST BCD_C128C = 3 'CODE128C
  77.     CONST BCD_EAN13 = 4 'EAN13
  78.     CONST BCD_UPCA = 5 'UPCA
  79.     CONST BCD_MAXICODE = 6 'MAXICODE
  80.     CONST BCD_QR = 7 'QR
  81.     CONST BCD_PDF417 = 8 'PDF417
  82.     '----------------------------------------------------------------------------------
  83.     CONST BCDOptParam_RESET = 0 'No optional parameter attached to barcode
  84.     CONST BCDOptParam_HEIGHT = 1 'Height
  85.     CONST BCDOptParam_ROTATE = 2 'Rotation
  86.     CONST BCDOptParam_MAGNIFY = 3 'Magnify
  87.     CONST BCDOptParam_PDF = 4 'PDF
  88.     CONST BCDOptParam_Ratio = 5 'Ratio
  89.     '----------------------------------------------------------------------------------
  90.     'PTXA_BCDOptParam_ROTATION
  91.     CONST BcdRotatePort = 0 'Portrait
  92.     CONST BcdRotateLand = 90 'Landscape
  93.     CONST BcdRotateInvPort = 180 'Inverted portrait
  94.     CONST BcdRotateInvLand = 270 'Inverted landscape
  95.     '----------------------------------------------------------------------------------
  96.     'PTXA_BCDOptParam_PDF
  97.     CONST BcdPDFOff = 0 'Barcode PDF disabled
  98.     CONST BcdPDFOn = 1 'Barcode PDF enabled
  99.     '----------------------------------------------------------------------------------
  100.     'PTXA_FormSetup()
  101.     CONST FormSetupLength = 1 'form length set to CREATE form
  102.     CONST FormSetupCount = 2 'counter of EXECUTE the form
  103.     '----------------------------------------------------------------------------------
  104.     'PTXA_FontSetup()
  105.     CONST FontName = 0 'FontName
  106.     CONST FontBold = 1 'FontBold
  107.     CONST FontSlant = 2 'FontSlant
  108.     CONST FontEncoding = 3
  109.  
  110.     CONST BoldOn = "ON" 'Bold on
  111.     CONST BoldOff = "OFF" 'Bold off
  112.     CONST SlantRight = "R" 'Italic slant
  113.     CONST SlantLeft = "L" 'Backward slant
  114.     CONST CPAscii = "ASCII" 'ASCII encoding
  115.     CONST CPGB = "GB" 'GB encoding
  116.     CONST CPBig5 = "BIG5" 'Taiwan encoding
  117.     CONST CPKSC = "KSC" 'Korean encoding
  118.     CONST CPSJIS = "SJIS" 'Kanji Japanese encoding
  119.     CONST CPUTF8 = "UTF8" 'UTF-8 encoding
  120.     '----------------------------------------------------------------------------------
  121.     'Return value from APIs
  122.     CONST OK = 0 'good return
  123.     CONST INVALID = 1 'wrong input parameter mode/value/lForm/barcodetype
  124.     '----------------------------------------------------------------------------------
  125.     DIM SHARED IP AS STRING
« Last Edit: July 25, 2020, 05:13:57 pm by SpriggsySpriggs »
Shuwatch!

Offline Mad Axeman

  • Newbie
  • Posts: 74
    • View Profile
    • My web site - Harrythetrout
Re: Barcodes
« Reply #4 on: July 30, 2020, 05:49:24 am »
Thanks. I'm currently on 2 weeks holiday and the signal where I'm staying is terrible. I'll wait until get home to download and try it out. Shame as with two weeks spare time I could have had 2 weeks of evenings to play around.
Oh look - a sig file :-)