Support & Downloads

Example of Creating Template Files Using Web Page (Visual Basic Script)

Create a Template File (Label Layout File)

  1. 1. Enter the following using a text editor and save it with a file name "asset.html".
    
    <HTML>
    <HEAD>
    <META http-equiv="x-ua-compatible" content="IE=8">
    <TITLE>Fixed asset label creation</TITLE>
    
    <SCRIPT LANGUAGE="VBScript">
    <!--
    Sub DoPrint()
     Dim TheForm
     Set TheForm = Document.ValidForm
    
     'Create b-PAC object
     Dim ObjDoc
     Set ObjDoc = CreateObject("bpac.Document")
    
     'Open template file created with P-touch Editor
     'Locate fixed asset name.lbx file at any place
     strDir = "Folder containing LBX file"
     bRet = ObjDoc.Open(strDir & "Fixed asset name.lbx")
    
     If (bRet <> False) Then 'normally open?
    
      'Set input data
      'to text object of "Fixed asset name"
      ObjDoc.GetObject("Name").Text = TheForm.FixedAsset.Value
    
      'Set input data
      'to text object of "Management section"
      ObjDoc.GetObject("Section").Text = TheForm.SectionName.Value
    
      'Set input data
      'to text object of "Management No"
      ObjDoc.GetObject("Number").Text = TheForm.SectionNo.Value
    
      'Set input data
      'to barcode object
      ObjDoc.GetObject("QRCode1").Text = TheForm.SectionNo.Value
    
      'Execute printing
      ObjDoc.StartPrint "DocumentName", 0
      ObjDoc.PrintOut 1, 0
      ObjDoc.EndPrint
      ObjDoc.Close
     End If
    
     'Release b-PAC object
     Set ObjDoc = Nothing
    End Sub
    -->
    </SCRIPT>
    
    </HEAD>
    <FORM NAME="ValidForm">
    Fixed asset name : <INPUT VALUE="" NAME="FixedAsset" SIZE=30><BR>
    Management section : <INPUT VALUE="" NAME ="SectionName" SIZE=30><BR>
    Management No : <INPUT VALUE="" NAME ="SectionNo" SIZE=30><P>
    <INPUT TYPE="button" VALUE="PRINT" onClick='DoPrint'>
    </FORM>
    </BODY>
    </HTML>
    
    

    Notes

    • Enter an absolute path of an lbx file in the "Folder containing LBX file" section above.
    • You can also change an image object and configure the font settings.
    • For methods available from b-PAC, refer to the b-PAC SDK documentation.
  2. 2. Display the created "asset.html", fill in each entry field and click the Print button.

Labels are printed with values of cells of selected rows while the label layout file created with P-touch Editoris used as the template.

Notes

The following conditions need to be met to locate the above-mentioned page on the server and connect P-touch to a client computer for use.

  • The client computer is installed with the following.
    - b-PAC component
    - P-touch printer driver
    - A template file created with P-touch Editor
  • A web browser used on the client computer is Internet Explore and ActiveX is allowed.

Download

FAQ

For Developers

  • Choose from Purposes

    Label printing, printer setup and management information.

  • b-PAC

    Information on application development tools for Windows

  • Mobile SDK

    Information on application development tools for mobile terminals

  • Command Reference

    Information on control command reference for label printers and mobile printers

  • Versatile software

    Information on versatile software provided by Brother

  • Choose from Models

    Introduction of Brother tools applicable to your model

  • Video Library

    Videos showing how to use SDK and other information

  • Contact Us

    Fill out the contact us form if you have questions about Brother developer tool.