78
b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L. 1 Brother P-touch Applicable Component (b-PAC) SDK Specifications Version 1.0.1 Brother Industries, Ltd. P&H Company ©Copyright Brother Industries, Ltd. 1998-2002 Unauthorized reproduction or duplication is prohibited.

Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

Embed Size (px)

Citation preview

Page 1: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

1

Brother P-touch ApplicableComponent (b-PAC)

SDK Specifications Version 1.0.1

Brother Industries, Ltd. P&H Company©Copyright Brother Industries, Ltd. 1998-2002

Unauthorized reproduction or duplication is prohibited.

Page 2: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

2

– Table of Contents –1. ..................................................................................................................................Introduction 32. ..........................................................................................................................During operation 43. .................................................................................................................Creating template f iles 64. ....................................................................................................BrssCom.Document reference 105. ........................................................................................................................ Sample programs 19

– History of Revisions – 08/02/2001 ...........................................................................................................New ly created 11/13/2002 ...... Version 1.0.1 Addition of the bpoContinue flag to DoPrint() 11/13/2002 ............................ Addition of Mobile Printer to the list of printers

Microsoft®, Window s®, Visual Basic®, Visual C++®, and ActiveX® are registered trademarks ofMicrosoft Corporation in the United States and/or other countries. All other company and productnames used w ith this softw are are trademarks or registered trademarks of their respectivecompanies.

Page 3: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

3

1. IntroductionThese specif ications include explanations and references for the SDK (Softw are DevelopmentKit) and the Brother P-touch Applicable Component (hereafter, simply referred to as “b-PAC”. The b-PAC provides an automation function for using P-touch® Editor document f iles (*.lbl)as templates and for outputting them from the user’s program to a P-touch series printer w ithoutusing the Editor.

1.1. What is b-PAC?b-PAC is a component that uses P-touch® Editor document f iles as templates, replaces text,barcodes and images (illustrations), and outputs to P-touch, Mobile Printer(MW series) andStampcreator series hardw are. (hereafter, simply referred to as "P/M/S series") Therefore,template f iles created using P-touch® Editor and drivers for the P/M/S series printer used foroutputting are required.

b-PAC is packaged as a COM automation server. If an application that can handle COMautomation servers, such as Visual Basic® or Visual C++®, or a development environment isused, outputting is possible w ithout using P-touch Editor.

b-PAC Componentb-PAC Component

U ser ProgramU ser Program

((V is ual Basic, Visual C++, VB Script, et c. )V is ual Basic, Visual C++, VB Script, et c. )

Print(Via Driver)

(Created with P-touch Editor)(Created with P-touch Editor)Read templateRead templateChange text and b arco desChange text and b arco des

Control

Page 4: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

4

2. During operation

2.1. User license agreement

In order to use the component and the SDK containing the component, you must agree to theuser license agreement during installation. For details on the user license agreement, refer to thefile bPACEula.rtf also contained in the same folder w here this document w as found.

2.2. Installation

In order to use the component and the SDK containing the component, run “Setup.exe” in“Brother b-PAC SDK”. Installation can also be performed by double-clicking “bPacSdk.msi” in anoperating environment already containing the Window s Installer, such as Window s® Me/2000/XP.

(Note1)A sample project is included in “Brother b-PAC SDK”; how ever, the sample project assumes thatthe templates are located in the folder C:\Program Files\Brother bPAC SDK\Templates.If Brother b-PAC SDK is installed into a folder other than C:\Program Files\Brother bPAC SDK\,copy all f iles in the installed Templates folder to C:\Program Files\Brother bPAC SDK\Templates.In order to use the various sample projects, the necessary development environment andexecution environment must be installed separately. For more details, refer to 5 Sampleprograms.

(Note2)When installing Brother b-PAC SDK on Window s® 95 or w hen the b-PAC component isredistributed, registration of the type library for the component may fail. If this occurs, run“DCOM95.exe” or install Internet Explorer 4.0 or higher. “DCOM95.exe” can be dow nloaded byperforming a keyw ord search on “DCOM95” at the follow ing URL.http://w w w .microsoft.com/dow nloads/search.asp

2.3. Installed files

When Brother b-PAC SDK is installed, f iles are copied to the follow ing folders.

� Application folder (normally C:\Program Files\Brother bPAC SDK\)\Doc This document, the user license agreement, and a list of redistributable samples\Redist Merge Module for redistribution (BrssCom.msm)\Samples VB, VBA, VBS, and VC sample projects\Templates Template f iles for use w ith the sample projects

� Common files folder (normally C:\Program Files\Common Files\Brother BrssCom)Component and type library

2.4. Uninstallation

To uninstall Brother b-PAC SDK, remove it using “Add/Remove Programs” in the Control Panel.

Page 5: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

5

2.5. Program redistribution

When redistributing programs created using Brother b-PAC SDK, other than the user’s program,the follow ing components and f iles must be installed on the client computer that the redistributedprogram is installed on.Brother b-PAC SDK, itself, cannot be redistributed.

1. b-PAC componentThe easiest and most reliable method for installing the component is to add “BrssCom.msm” from“Redist” in the application folder (normally C:\Program Files\Brother bPAC SDK\) to the installproject for Window s® Installer. With BrssCom.msm, the component can be used w ith multipleprojects, and the registry and type library of the component are also registered.

To install only the component onto a client PC, use the b-PAC client component dow nloaded fromthe b-PAC dow nload site.For detailed operating instructions on the client component, refer to the dow nload site.

2. Printer driv er of target printerSet up the driver by running the driver installer from the P-touch Editor CD-ROM, or bydow nloading the appropriate driver from the Brother Web site (http://w w w .brother.com/).Furthermore, if the target driver has been installed together w ith P-touch Editor onto the clientcomputer, it is not necessary to set up the driver separately.

3. Template filesSince b-PAC refers to the templates, the templates created using P-touch Editor are needed. Thetemplates can even be stored on a server accessible by the client computer.In addition, if the target driver is installed and the template f iles are available, P-touch Editor is notneeded to run b-PAC.

Page 6: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

6

3. Creating template files

3.1. What are template files?

In order to use b-PAC, template f iles must be created using P-touch® Editor Version 3.x. With P-touch® Editor, it is not necessary to save template f iles in a special format; they can be saved asa normal layout f ile (*.lbl).b-PAC outputs the template f ile (=layout f ile) w ith the same size (w idth and length) that w as setusing the printer driver that w as set. Therefore, regardless of the current printer settings, youcan output using the desired driver and label size.(*Note) Also refer to the “Limitations on b-PAC templates”.

3.2. Creating a template

3.2.1. Procedure

1. Start up P-touch Editor Version 3.x. Before continuing, select [File] – [Printer Setup], and checkthat the currently selected driver is the one that you w ish to create a template f ile for. If adifferent driver is selected, select the desired driver, click the [Set as Default] button, and thenclick the [OK] button.

2. Specify the label size using the settings in the Page Properties.

3. Enter the desired label data. Observe the precautions described below w hen adding eachtype of object to the layout.

4. After creating the layout is f inished, save the layout f ile.

3.2.2. Text objects

� Single text objects should consist of complete meaningful units. For example, a long addressthat w ould extend over tw o lines should be entered at a single multi-line object, instead oftw o separate objects.

� The font, and character size and style w ithin each text object should be kept to only onetype if possible. Each character can be formatted differently; how ever, during output, allcharacters w ill be changed to the formatting specif ied for the f irst character.

� Text option settingsSince certain characteristics of the template text w ill change, the text alignment and themerge option settings (in the Text Properties) should be used so that the position of the textdoes not change, even if the w idth of the text object does. The merge option setting can beused as described below .

Auto: This option should be used w hen there is extra space around the text, but the fontsize and height-to-w idth ratio should be maintained w ithout cutting off some of the text, orw hen the text data in the object is small enough so that the size of the object can bereduced. How ever, w ith b-PAC, this option produces the same result as “Clip”.

Page 7: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

7

Clip: This option is recommended for templates used w ith b-PAC. If this option is selectedand the number of characters is reduced, the font size and height-to-w idth ratio aremaintained w ithout changing the size of the text object. If the number of characters isincreased and the size of the text object is enlarged, the font size is reduced w ithoutchanging the height-to-w idth ratio.

Fit: Select this option to automatically adjust the size of the text to f it the size of the object.With this option, the font size and height-to-w idth ratio change depending on the number ofcharacters.

� With the Auto and Clip options, the normal font size w ill have the standard height-to-w idthratio (ratio immediately after changing the font size).

� Text objects are not enlarged or reduced linearly, as opposed to graphics objects, etc.For this reason, if text is positioned inside a graphics object w ith a similar shape, changingthe size may result in the text becoming larger than the graphics object. It is recommendednot to use excessive precision, but rather to provide extra space w hen positioning objects.

� When indexed w ith a method such as SetText(), objects of the same type are arranged inthe Z order, starting from the top. When indexed, the topmost object becomes 0, and theremaining become 1, 2, etc.To check the Z order w ith P-touch® Editor, select the [Auto Text] command. With Auto Text,objects containing text are displayed in order, starting from the top.Therefore, after all text has been entered, start w ith the text object (or Arrange Text object)entered last and select [Layout] – [Order] – [Bring to Front] to bring the object to the front.(Repeat this operation on all entered text objects to reverse their order.)

In addition, if a text object contains multiple lines of text, the lines are numbered starting fromthe top. The order w ithin an object cannot be changed. (Each single line of text is indexed.)

3.2.3. Graphics objects (illustration)

� If graphics objects (illustrations) contained in the template are to be replaced, templatescontaining smaller images w ith few er colors can be loaded more quickly. b-PAC can importJpeg f iles; how ever, w hen creating templates, it is recommended that images be replacedw ith the smaller Bmp files.

3.2.4. Barcode objects

� Like text objects, barcode objects cannot be resized linearly. For this reason, it isrecommended that they be positioned w ith extra space around them.

3.2.5. Other objects

� If text is positioned in a frame, the frame is sent behind the text.

Page 8: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

8

3.2.6. Limitations on b-PAC templates

Of the layout f iles (*.lbl) created w ith P-touch® Editor Version 3.x, many can be used as templatesw ith b-PAC. How ever, the follow ing limitations apply.

� Layout f iles containing merged database f ields cannot be used as templates.

� Layout f iles containing a barcode using the QRCODE protocol cannot be used as templates.

� Clip art, Make Picture objects cannot be displayed w ith the current version of b-PAC. If youw ish to use templates containing these types of objects, contact us for more information.

� Printer for outputting the (template) data

The information for the printer driver used for outputting is saved w ith the template; therefore,the computer w ill try to use the set printer driver w henever outputting the template. If the printerdriver that w as set w hen the template w as created is not installed on the PC that w ill output theb-PAC data, the follow ing w ill occur.

No printer driver has been installed: The b-PAC component cannot be used.

If a printer driver has been installed, but a P-touch/Mobile Printer/Stampcreator-series(hereafter, referred to as "P/M/S-series")printer driver has not:

The template can be opened, but it cannotbe printed.

When only oneP/M/S-series driveris installed:

The data w ill be outputted from the printerfor the installed P/M/S-series driver.

If a P/M/S-seriesprinter driver hasbeen installed, but it isdifferent than the oneused w hen thetemplate w ascreated:

When multipleP/M/S-series drivershave been installed:

The data w ill be outputted from the P/M/S-series printer w ith the driver name that isf irst alphabetically. In this case, the templateis adjusted to match the printer driverinstalled on the PC.

3.2.7. Sample templates included with SDK

The print area and printer for the templates in the b-PAC SDK template folder (normallyC:\Program Files\Brother bPAC SDK\Templates) are have been set for the PT-9200PC.

If output is possible w ith P/M/S-series printer drivers other than the PT-9200PC, use P-touchEditor to open a layout f ile (*.lbl) from the above-mentioned template folder, select [File] - [PrinterSetup], select the printer that w ill be used to output the data, adjust the layout if it extends out ofthe print area, and then save the f ile. (How ever, if the printer driver for the PT-9200DX or PT-2500PC from the P/M/S series is installed on the computer, try performing the operation w ithoutchanging the sample template.)

Page 9: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

9

3.3. Checking a template

After creating the template f ile, open it and check that it is displayed correctly.Below is a checklist that should be referred to w hen creating a template.

3.3.1. Overall layout

� With label templates, do the objects have enough extra space w ithin the print area?� With stamp templates, do all objects f it w ithin the print area? (How ever, special layouts

containing many Arrange Text objects and clip art are excluded.)� Have all unnecessary objects been removed from the layout? (Check by holding dow n the

Tab key to select each object.)� With no object selected, select the [Auto Text] command. Is the order in w hich the text

appears the desired order?

3.3.2. Text

� Except w hen the Fit option is selected, does the font of all text appear in the original height-to-w idth ratio (especially w hen the Auto option is selected)?

� If the Clip option is selected, is the text object located so that it w ill not hide other objects(lines, etc.), does it provide for characters being added, and is it adjusted to a size w ithenough extra space?

� Have no unnecessary spaces been added to the text? Instead, is it not possible to adjust thecharacter spacing?

� Is any necessary character formatting lost w hen the text is displayed using the [Auto Text]command (w hen character formatting is applied)?

3.3.3. Barcode

� Is there enough space around the barcode object to prevent it from extending beyond theprint area if the length changes due to the barcode data or from covering other objects oneither side (w hen the barcode is horizontally positioned)?

3.3.4. Others

� Display the layout at a zoom ratio of 1:1. Check how the objects overlap. Be particularlycareful w hen grouping rectangles and straight lines and w hen draw ing lines. In addition, if abitmap is used in the template, check how it w ill be reproduced.

� Display the layout at a zoom ratio of 100%. Are there no missing parts in the objects and isthe balance of the objects the same as w hen the layout is displayed normally?

Page 10: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

10

4. BrssCom.Document reference

4.1. Interface name

The name of the interface for b-PAC is “BrssCom.Document”.

4.2. List of methods

Method SummaryOpen() Opens the lbl fi le at the specified path (UNC).

Close() Closes the document.

Save() Saves the document.

Export() Outputs the fi le in the specified format (LBL, LBI or BMP).For the LBI and BMP formats, the bitmap resolution can bespecified.

GetSheetSize() Retrieves the string of characters that define the paper size.

GetTextCount() Returns with the number of l ines of text in the document.

GetTextIndex () Returns with an index for the text consistent with the field name.

GetText() Retrieves the text data in the specified line.

GetFontInfo() Retrieves the font for the specified line.

SetText() Sets the text data for the specified line.

SetFontInfo() Sets the font for the specified line.

SetBarcodeData() Sets and updates the barcode data.

ReplaceImageFile() Replaces the graphics object.DoPrint() Prints the document.

Page 11: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

11

4.2.1. Open()

boolean Open(BSTR szFilePath)[Arguments]szFilePath Path (UNC) to the document f ile[Returned v alue]“0” is returned if the open failed; a value other than “0” is returned if it succeeded.

[Description]Opens the lbl fi le at the specified path (UNC).

4.2.2. Close ()

boolean Close()[Returned v alue]“0” is returned if the document failed to close; a value other than “0” is returned if it succeeded.

[Description]Closes the fi le opened with Open.

4.2.3. Save ()

boolean Save()[Returned v alue]“0” is returned if saving the f ile failed; a value other than “0” is returned if it succeeded.

[Description]Saves the fi le opened with Open.

4.2.4. Export()

boolean Export(long FileType, BSTR szFilePath, long dpi)[Arguments] FileType Type of f ile to be exported as

(0: LBL format; 1: LBI format1; 2: BMP (monochrome) format szFilePath Path (UNC) of the exported f ile dpi Resolution w hen exporting as a bitmap; valid only if FileType is the LBI or

BMP formatSpecify the resolution of the output device (72 or 96 for a display; 360 for

output to the PT-9200PC/9200DX, 600 for output to the SC-2000)

[Returned v alue]“0” is returned if the export of the f ile failed; a value other than “0” is returned if it succeeded.

[Description]Exports the f ile in the format specif ied w ith FileType.

1 In order to increase the portability of the fonts, create a binary f ile w ith all proprietary P-touch(Stamp) Editor objects converted to bitmaps. The paper size information is maintained.

Page 12: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

12

If FileType is the LBI or BMP format, specify the resolution w ith dpi.

4.2.5. GetSheetSize ()

VARIANT GetSheetSize(short vt)[Arguments] vt VARIANT format for the size information; Normally VT_BSTR (8) is

specif ied.

[Returned v alue]Returns the size information in the VARIANT form. For size 1850, “1850” is set for the VT_BSTRform.

[Description]Retrieves the paper size for the current document in the VARIANT form.

4.2.6. GetTextCount ()

long GetTextCount()[Returned v alue]Number of lines in the current document w here text can be entered

[Description]Returns the number of lines in the current document w here text can be entered.

4.2.7. GetTextIndex ()

long GetTextIndex (BSTR szFieldName)[Arguments]szFieldName Field name (template text) for the text w hose index is to be retrieved

[Returned v alue]-1: No corresponding lines of text; 0, etc.: Index of the text corresponding to the f ield name

[Description]Returns the index for text w ith the specif ied f ield name (template text). By specifying a f ieldname in the template, the text can simply be entered.If there are multiple lines of text w ith the same field name (template text) in the same template f ile,the index for the f irst text line is returned.Refer to 3.2.2 Text objects for details on the rules for numbering indexes for text lines.

Page 13: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

13

4.2.8. GetText ()

boolean GetText(long nIndex, BSTR* lpszText)[Arguments]nIndex Index (from 0) for the text line to be retrievedlpszText Pointer to the buffer w here the text is to be retrieved

[Returned v alue]“0” is returned if retrieving the text in the specif ied line failed; a value other than “0” is returned ifit succeeded.

[Description]Retrieves the text data in the specif ied line.

4.2.9. GetFontInfo ()boolean GetFontInfo(long nIndex, BSTR* lpszFontInfo)[Arguments] nIndex Index (from 0) for the line w hose font information is to be retrieved lpszFontInfo Pointer to the text of the font information to be retrieved; Refer to [Description]

for details.

[Returned v alue]“0” is returned if retrieving the font information for the specif ied line failed; a value other than “0”is returned if it succeeded.

[Description]Retrieves the font information for the specif ied line. The text specif ied by lpszFontInfo isseparated by “,” (commas), and each token has the meaning described below .

Index Name Value0 Font name Name of font1 Orientation 0: Horizontally w ritten; 1: Vertically w ritten (invalid

w ith SetFontInfo())2 Bold specif ication 0: Normal; 1: Bold3 Italic specif ication 0: Normal; 1: Italic4 Underline

specif ication0: None; 1: Applied

5 Strikeoutspecif ication

0: None; 1: Applied

6 Maximum pointsize

1~: Maximum point size (in 0.1 point units)

7 Character style

0: None;1: Shadow Light; 2: Shadow3: Horizontal; 4: Outline5: Surround; 6: Frame Out

Example: “Arial, 0, 1, 1, 0, 0,120,0” indicates the Arial font, horizontally w ritten, bolded, italicized,maximum 12 points, w ith no character styles.

Page 14: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

14

SetText ()boolean SetText(long nIndex, BSTR szText)[Arguments] nIndex Index (from 0) for the text line to be set szText Text to be set

[Returned v alue]“0” is returned if setting the text of the specif ied line failed; a value other than “0” is returned if itsucceeded.

[Description]Updates and sets the text for the specif ied line.

4.2.10. SetFontInfo ()boolean SetFontInfo(long nIndex, BSTR szFontInfo)[Arguments] nIndex Index (from 0) for the line w hose font information is to be set szFontInfo Text of the font information to be set; Refer to “GetFontInfo ()” for details on

the settings.

[Returned v alue]“0” is returned if setting the font information for the specif ied line failed; a value other than “0” isreturned if it succeeded.

[Description]Updates and sets the font information for the specif ied line. For details on the font informationparameters to be set, refer to “GetFontInfo ()”. If omitted (or if set to “-1”), the current fontinformation for that parameter is adopted.

Page 15: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

15

4.2.11. SetBarcodeData ()boolean SetBarcodeData(long nIndex, BSTR szData)[Arguments] nIndex Index (from 0) for the barcode object to be set szData Barcode data text to be set

[Returned v alue]“0” is returned if setting the barcode failed; a value other than “0” is returned if it succeeded.

[Description]Sets and updates the barcode data for the specif ied barcode.

4.2.12. ReplaceImageFile()boolean ReplaceImageFile(long nIndex, BSTR szFilePath, long dwFlag)[Arguments] nIndex Index (from 0) for the graphics object to be set szFilePath Path of the image f ile, w hich should replace the graphics object dwFlag Flag for replacing images (Specify “0”.)

[Returned v alue]“0” is returned if replacing the image failed; a value other than “0” is returned if it succeeded.

[Description]Replaces the specif ied graphics object w ith the graphics f ile specif ied by szFilePath. Theformats for the graphics f ile that can be specif ied by szFilePath are BMP or uncompressed TIFF,WMF, EMF, ICO or JPEG.

Page 16: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

16

4.2.13. DoPrint()void DoPrint(long dwOption, BSTR szOption)[Arguments] dwOption Printing options; 0: Adopts the settings of the current driver; Others: Refer to

“[Descriptions]”. szOption Printing parameter Specify the printing parameters w ith strings of characters

separated by “,” (commas); Refer to [Description] for details.[Description]Prints the current document. DoPrint() is valid only w hen printing to a Brother P-touch/MobilePrinter(MW series) /Stampcreator-series printer. It is not used w ith other printers.

� Printing option: dw Option

If the driver’s print option settings are not to be adopted and the printing options are to be setusing DoPrint, specify the settings by combining the follow ing f lags in dwOption. If the settingsare to be adopted, set dwOption to “0”.(With Visual Basic®, w hen the f lag is specif ied w ith a direct numeral, not an enumerating valuethat begins w ith bpo, the half cut f lag 0x200, for example, is specif ied as &H200.)

Driver Flag Description

bpoAutoCut (0x1)Performs an auto cut.*Valid only w ith models supporting the auto cutfunction.

bpoCutPause (0x2)Performs a cut pause or prints cut marks.Valid only w ith models not supporting the autocut function.

bpoHalfCut (0x200) Performs a half cut.*bpoChainPrint(0x400) Performs “Chain Printing”*bpoNoCut (0x10000000) Do not cut.bpoMirroring (0x4) Prints a mirror image.*bpoColor (0x8) Prints in color.*bpoMono (0x10000000) Print in monochrome.

Label printer(P-touch)

bpoContinue(0x40000000)

Combines w ith printing for the follow ingDoPrint() so that it is a single print job. As aresult, w hen the next DoPrints are called up,the front margins are not outputted. Refer to the "Precautions and limitations foruse of the bpoContinue flag" described below.

Mobile Printer(MW Series) bpoContinue(0x40000000)

Combines w ith printing for the follow ingDoPrint() so that it is a single print job. As aresult, multiple labels can be printed togetheron a single sheet for precut labels. Refer to the "Precautions and limitations foruse of the bpoContinue flag" described below.

bpoStamp (0x80) Engraves a stamp. If this f lag is set to “OFF”,an ID label is printed.

Stamp(Stampcreator) bpoIdLabel (0x10000000) Print the ID label.

Page 17: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

17

*Note: Valid only for models supporting the function. The setting is invalid w ith models notsupporting the function, even if the f lag is set.

� Printing parameter: dw Option

Specify the printing parameters szOption using text separated by “,” (commas). Each token hasthe meaning described below .

Index Name Description0 Name of

document beingprinted

Specify the document name that w ill appear in theprinter display.If not specif ied or if “0” is specif ied, “b-PAC” w illappear in the displayed.

1 Number of copies Specify the number of copies. If not specif ied, thenumber of copies is normally “1”.With stamps, the number of copies setting is invalid.

Example: “MyDoc, 2” indicates that “MyDoc” w ill appear in the printer display, and 2 copies w ill beprinted.

[Precautions and limitations for use of the bpoContinue flag]� Each time the normal DoPrint method is called up, a print job is created. How ever, by

specifying a bpoContinue f lag, the end of the print job is postponed until the next one iscalled up. In addition, if the same flag is also specif ied for the next DoPrint, the end of theprint job continues to be postponed.

� If the bpoContinue f lag is set, other specif ied f lags for the printing options (dw Option) andspecif ied printing parameters (szOption) other than the number of copies are valid for thefirst DoPrint method called up, but are ignored for follow ing DoPrint methods called up untilthe print job is f inished.

� Once the bpoContinue f lag is set in a DoPrint method, the print job can be f inished (=printingactually begins) in any of the follow ing w ays.a). Not setting a bpoContinue f lag w hen calling up one of the follow ing DoPrint methodsb). Calling up an Open or Close method from the next timec). Releasing the b-PAC object

� After setting a bpoContinue f lag and calling up the DoPrint method, it w ill not enter theprocess w here it w aits for an end-user event, such as data input or selection, until the printjob is f inished (=printing actually begins) w ith one of the three w ays (a, b or c) mentionedabove.

� The maximum number of times a DoPrint method w ith the bpoContinue f lag specif ied can becalled up (number of pages that can be output during one print job) depends on the maximumnumber of pages that each printer can print or on the computer's resource.

Page 18: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

18

[Usage example of the DoPrint method with Visual Basic®]

� Prints one copy w ith the print option settings of the current driver

...ObjDoc.DoPrint 0, "0"

� Prints one copy w ithout cutting betw een the labels

ObjDoc.DoPrint bpoNoCut, "0" orObjDoc.DoPrint &H10000000, "0"

� Prints three copies w ith the print option settings of the current driver

...ObjDoc.DoPrint 0, "b-PAC Sample,3"

� Example of batch printing of multiple labels using the bpoContinue f lag

'Prints five labels as one print job (PT-9200DX/PT-9200PC)...iTotal = 5nIndex = ObjDoc.GetTextIndex("Name")For iCount = 1 To iTotal

strCount = "Count = " + CStr(iCount)ObjDoc.SetText nIndex, strCountIf iCount < iTotal Then

'Continues the print job and prints with half cutsObjDoc.DoPrint &H40000200, "test,1"

Else'Last print (end of the job)ObjDoc.DoPrint 0, "0"

End IfNext

Page 19: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

19

5. Sample programsThe sample projects assume that the templates are located in the folder C:\Program Files\BrotherbPAC SDK\Templates. If Brother b-PAC SDK is copied into any other folder, refer to the precautionsin Installation. In addition, this limitation only applies to the sample projects, not to the b-PACcomponent.

5.1. Visual Basic® (VB folder)

SummaryApplication for creating nameplatesEnter the name and company to create nameplates. Selectone of the follow ing tw o templates: simple and framed.

Methods used Open(), GetTextIndex(), SetText(), DoPrint()NamePlt

Operabledevelopmentenvironment

Microsoft® Visual Basic® Version 6.0 SP4

The follow ing show s the b-PAC methods used in the NamePlt sample.

Public Sub DoPrint(strPath As String, strExport As String)

‘ Creates the b-PAC objectDim ObjDoc As BrssCom.DocumentSet ObjDoc = CreateObject("BrssCom.Document")

‘ Opens the templateIf (ObjDoc.Open(strPath) <> False) Then

‘ Searches for text from the field names, and replaces thetext

Dim nIndex As IntegernIndex = ObjDoc.GetTextIndex("Company")ObjDoc.SetText nIndex, edPosition.TextnIndex = ObjDoc.GetTextIndex("Name")ObjDoc.SetText nIndex, edName.Text

‘ Printing or exportingIf (strExport = "") Then

ObjDoc.DoPrint 0, "0" ' PrintElse

ObjDoc.Export 2, strExport, 180 ' ExportEnd If

End IfSet ObjDoc = Nothing

End Sub

Page 20: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

20

5.2. Visual C++® (VC folder)

Summary

Application for creating nameplatesEnter the name and department to create nameplates.Select one of the follow ing tw o templates: simple andframed.Visual C++ version of the Visual Basic® sample NamePlt

Methods used Open(), GetTextIndex(), SetText(), DoPrint()NamePlt

Operabledevelopmentenvironment

Microsoft® Visual C++® Version 6.0 SP4

5.3. Visual Basic® for Application (VBA folder)

Summary

Microsoft® Excel application for creating shipping labels.Using an interactive interface, a shipping label is createdfrom text entered in the cells. In addition, the fonts for thetext can be changed.

Methods used Open(), SetText(), DoPrint(), GetTextCount(), Save(),Close()

ShipForm.xls

Operabledevelopmentenvironment

Microsoft® Excel 97 or, 2000

SummaryMicrosoft® Access application for creating nameplates.References the database record data, and prints anameplate.

Methods used Open(), GetTextIndex(), SetText(), DoPrint()NamePlt.mdb

Operabledevelopmentenvironment

Microsoft® Access 97With Access 2000, f iles can be converted.

SummaryMicrosoft® Access application for creating a price labelsReferences the database record data, and prints a aprice label containing the barcode data.

Methods used Open(), GetTextIndex(), SetText(), DoPrint(),SetBarcodeData()ShopLbl.mdb

Operabledevelopmentenvironment

Microsoft® Access 97With Access 2000, f iles can be converted.

Page 21: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

21

5.4. VB Script (for Windows Scripting Host) (VBS folder)

SummaryScript for creating nameplatesScript printing version of the Visual Basic® sampleNamePlt

Methods used Open(), SetText(), DoPrint()NamePrn.vbs

Operabledevelopmentenvironment

Microsoft® Window s® Script Host Version 1.0

5.5. VB Script (for Internet Explorer) (VBS folder)

In order to use the follow ing sample, Internet Explorer 4.0 or higher is required.

Summary

HTML page for creating nameplatesEnter the name and department to create nameplates.Select one of the follow ing tw o templates: simple andframed.HTML version of the Visual Basic® sample NamePlt

VBS_NamePlate.html

Methods used Open(), GetTextIndex(), SetText(), Export(), DoPrint()

SummaryHTML page for creating labels containing imagesSpecify the image and enter the name to create the label.Optional bitmap f iles can be specif ied for the graphics.VBS_ChangeI

mage.htmlMethods used Open(), SetText(), Export(), DoPrint(), ReplaceImageFile()

Summary

HTML page for accessing a database and printing labelscontaining the barcode data and name for the specif ieditemFirst, create a Microsoft® Access MDB file correspondingto the items and barcode data. While holding dow n theprint or preview buttons, access the database via ADO,retrieve the barcode data corresponding to the item, andthen print after the component has performed thereplacement w ith the actual barcode.

Methods used Open(), SetText(), Export(), DoPrint(), SetBarcodeData()

VBS_DB_Bcd.html

Note

In order to access the database using ADO, the MDACcomponent (mdac_typ.exe) must be dow nloaded fromthe follow ing page, and installed.http://w w w .microsoft.com/data/dow nload.htm(This component is already installed on Window s®

2000/XP and the Millennium Edition.)

Page 22: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

22

5.6. Console (command prompt) application (Console folder)

Summary

A sample application that uses the b-PAC componentfrom the console (command prompt) application andoutputs barcodes. For an explanation of the program,refer to the follow ing.

Methods used Open(), SetText(), SetBarcodeData(), DoPrint()ConsoleLabel

Operabledevelopmentenvironment

Microsoft® Visual C++® Version 6.0 SP4Microsoft® Window s® Script Host Version 1.0

Description

ConsoleLabel.c

Source of the console program created w ith C.The VB Script engine w script is called from the function system() of the C run-time library. Inaddition, the script f ile name (BcdLabel.vbs) and the tw o arguments transferred to the scriptf ile are specif ied as arguments of w script. When simplif ied, it appears as show n below .

system("wscript script-file-name parameter1 parameter2");

BcdLabel.vbs

The b-PAC component is called w ith the VB Script f ile, called up from ConsoleLabel.c, and thebarcode label is printed.This script f ile uses tw o arguments. The f irst argument is used as the item name, and thesecond argument is used as the code for the item that w ill be made into the barcode.

Page 23: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

23

Page 24: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

24

Composant applicable Brother b-PACSpécifications du SDK version 1.0.1

Brother Industries, Ltd. Société P&H©Copyright Brother Industries, Ltd. 1998-2002

Toute reproduction ou duplication non autorisée est interdite.

Page 25: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

25

- Table des matières -1. Introduction...................................................................................................................... 262. Fonctionnement ............................................................................................................... 273. Création des f ichiers modèles ......................................................................................... 304. Référence pour BrssCom.Document............................................................................... 355. Exemples de programmes ............................................................................................... 45

– Historique des modif ications – 08/02/2001 .......................................................................................... Création du document 11/13/2002 .... Version 1.0.1 Ajout de l’indicateur bpoContinue à DoPrint()

11/13/2002 ............ Ajout des imprimantes portables à la liste des imprimantes

Microsoft®, Window s®, Visual Basic®, Visual C++® et ActiveX® sont des marques déposées ou

non de Microsoft Corporation aux Etats-Unis et/ou dans d'autres pays. Tous les autres noms desociétés et de produits utilisés avec ce logiciel sont des marques ou marques déposées de leursdétenteurs respectifs.

Page 26: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

26

1. IntroductionCes spécif ications comprennent les explications et références pour le SDK (Softw areDevelopment Kit ou Kit de développement logiciel) et le composant applicable Brother b-PAC(Brother P-touch Applicable Component) (appelé “b-PAC” dans la suite du document). Le b-PAC offre une fonction d’automatisation pour utiliser les documents P-touch® Editor (*.lbl) commemodèles et pour les envoyer du programme de l’utilisateur vers une imprimante de la série P-touch, sans utiliser l’Editor.

5.7. Qu’est-ce que le b-PAC ?b-PAC est un composant qui utilise des documents P-touch® Editor comme modèles, remplace dutexte, des codes barres et des images (illustrations), et envoie le résultat vers du matériel P-touch, des imprimantes portables (série MW) et la série Stampcreator (appelés "série P/M/S"dans la suite de ce document). Les f ichiers modèles sont donc créés à l’aide de P-touch® Editoret les pilotes des imprimantes de la série P/M/S sont utilisés en fonction des besoins.

b-PAC se présente sous la forme d’un serveur d’automatisation COM. Si vous utilisez uneapplication compatible avec les serveurs d’automatisation COM, comme Visual Basic®, VisualC++® ou un environnement de développement, vous pouvez imprimer sans utiliser P-touch Editor.

b-PACb-PAC

UserProgramme utilisateurVisual Basic, Visual C++, VBVisual Basic, Visual C++, VB Script,

etc

Imprimer(via pilote)

(Created with P-touch(Créé avec P-touch Editor)ReadLire modèleChange text andChanger texte et codes à barres

Contrôler

Page 27: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

27

2. Fonctionnement

5.8. Contrat de licence utilisateur

Pour utiliser le composant et le SDK le contenant, vous devez accepter les termes du contrat delicence utilisateur lors de l’installation. Pour obtenir des détails sur ce contrat, veuillez consulter lef ichier bPACEula.rtf qui se trouve dans le même dossier que ce document.

2.1. Installation

Pour utiliser le composant et le SDK le contenant, exécutez “Setup.exe” dans “Brother b-PACSDK”. Vous pouvez aussi lancer l’installation en double-cliquant sur “bPacSdk.msi” dans unenvironnement d’exploitation contenant déjà Window s Installer, comme par exemple Window s®Me/2000/XP.

(Remarque 1)“Brother b-PAC SDK” contient un exemple de projet mais cet exemple suppose que les modèlesse trouvent dans le dossier C:\Program Files\Brother bPAC SDK\Templates.Si Brother b-PAC SDK est installé dans un dossier autre que C:\Program Files\Brother bPACSDK\, copiez tous les f ichiers du dossier Templates installé dans C:\Program Files\Brother bPACSDK\Templates.Pour être en mesure d’utiliser les divers exemples de projets, vous devez installerl’environnement de développement et l’environnement d’exécution séparément. Pour obtenir descompléments d’information, veuillez vous reporter à la section 5 Exemples de programmes.

(Remarque 2)Quand vous installez Brother b-PAC SDK sous Window s® 95 ou quand le composant b-PAC estredistribué, il est possible que l’enregistrement de la bibliothèque de types échoue. Dans ce cas,exécutez “DCOM95.exe” ou installez Internet Explorer 4.0 ou une version ultérieure. Vouspouvez télécharger “DCOM95.exe” en faisant une recherche de mot clé sur “DCOM95” àl’adresse suivante :http://w w w .microsoft.com/dow nloads/search.asp

2.2. Fichiers installés

Quand Brother b-PAC SDK est installé, les f ichiers sont copiés dans les dossiers suivants.

� Dossier Application (en général C:\Program Files\Brother bPAC SDK\)\Doc Ce document, le contrat de licence utilisateur et une liste des exemples

redistribuables\Redist Module de fusion pour la redistribution (BrssCom.msm)\Samples Exemples de projets VB, VBA, VBS et VC\Templates Fichiers modèles à utiliser avec les exemples de projet

� Dossier des fichiers communs (en général C:\Program Files\Fichierscommuns\Brother BrssCom)

Bibliothèque de composants et de types

Page 28: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

28

2.3. Désinstallation

Pour désinstaller le Brother b-PAC SDK, supprimez-le à l’aide de l'application Ajout/Suppressionde programmes du Panneau de configuration.

Page 29: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

29

2.4. Redistribution des programmes

Pour redistribuer des programmes créés à l’aide du Brother b-PAC SDK, autre que le programmeutilisateur, il faut installer les composants et f ichiers suivants sur l’ordinateur client où réside leprogramme redistribué.Le programme Brother b-PAC SDK lui-même ne peut pas être redistribué.

1. Composant b-PACLa méthode la plus facile et la plus f iable pour installer le composant consiste à ajouter“BrssCom.msm”, qui se trouve dans “Redist” du dossier des applications (en général C:\ProgramFiles\Brother bPAC SDK\), dans le projet d’installation pour Window s® Installer. AvecBrssCom.msm, le composant peut être utilisé avec des projets multiples, et le registre et labibliothèque de types du composant sont également enregistrés.

Pour seulement installer le composant sur un PC client, utilisez le composant client b-PACtéléchargé du site de téléchargement b-PAC.Pour obtenir des instructions sur l’utilisation du composant client, veuillez consulter le site detéléchargement.

2. Pilote de l’imprimante cibleConfigurez le pilote en exécutant l’installateur de pilote du CD-ROM P-touch Editor, ou entéléchargeant le pilote approprié du site Web Brother (http://w w w .brother.com/).Si le pilote cible a été installé sur l’ordinateur client avec P-touch Editor, il n’est pas nécessaire deconfigurer le pilote séparément.

3. Fichiers modèlesLes modèles créés avec P-touch Editor sont nécessaires car b-PAC les utilise. Les modèlespeuvent être stockés sur un serveur accessible par l’ordinateur client.En outre, si le pilote cible est installé et si les f ichiers modèles sont disponibles, vous n’avez pasbesoin de P-touch Editor pour exécuter b-PAC.

Page 30: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

30

3. Création des fichiers modèles

3.1. Que sont les fichiers modèles ?

Pour utiliser b-PAC, il faut créer des f ichiers modèles à l’aide de P-touch® Editor Version 3.x.Avec P-touch® Editor, il n’est pas nécessaire d’enregistrer les f ichiers modèles sous un formatspécial ; ils peuvent être enregistrés comme fichiers de mise en page normaux (*.lbl).b-PAC génère le f ichier modèle (=fichier de mise en page) en utilisant la même taille (largeur etlongueur) que celle qui a été définie à l’aide du pilote d’imprimante. Par conséquent, quels quesoient les paramètres de l’imprimante, vous pouvez imprimer avec le pilote et la taille d’étiquettechoisis.(*Remarque) Voir aussi les “Limites des modèles b-PAC”.

3.2. Création d’un modèle

3.2.1. Procédure

1. Lancez P-touch Editor Version 3.x. Avant de continuer, sélectionnez [File] – [Printer Setup] etvérif iez que le pilote sélectionné est bien celui pour lequel vous souhaitez créer un f ichiermodèle. Si un autre pilote est sélectionné, choisissez le pilote voulu, cliquez sur le bouton [Setas Default] puis cliquez sur [OK].

2. Spécif iez la taille de l’étiquette à l’aide des paramètres dans Page Properties.

3. Entrez les données d’étiquette voulues. Suivez les précautions décrites ci-dessous pourajouter chaque type d’objet à la mise en page.

4. Quand vous avez terminé de créer la mise en page, enregistrez le f ichier correspondant.

3.2.2. Objets texte

� Les objets texte simples doivent se composer d’entités complètes et compréhensibles. Parexemple, une longue adresse qui prendrait deux lignes doit être saisie comme un seul objetmulti-lignes et non pas deux objets séparés.

� La police, ainsi que la taille et le style des caractères de chaque objet texte, doivent sipossible rester uniques. Chaque caractère peut être formaté différemment, mais lors del’impression tous les caractères adopteront le formatage spécif ié pour le premier caractère.

� Paramètres d’option de texteComme certaines caractéristiques du modèle vont changer, il faut utiliser les paramètresd’option d’alignement du texte et de fusion (dans Text Properties) de sorte que la position dutexte ne change pas, même si la largeur de l’objet texte change. Le paramètre d’option defusion peut être utilisé comme indiqué ci-dessous.

Auto : Cette option doit être utilisée quand il y a un espace supplémentaire autour du texte etque la taille de la police et le rapport hauteur/largeur doivent être maintenus sans couper detexte, ou quand les données de texte dans l’objet sont assez petites pour que la taille del’objet puisse être réduite. Cependant, avec b-PAC, cette option produit le même résultat que

Page 31: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

31

“Clip”.

Clip : Cette option est conseillée pour les modèles utilisés avec b-PAC. Si cette option estsélectionnée et que le nombre de caractères est réduit, la taille de la police et le rapporthauteur/largeur sont maintenus sans changer la taille de l’objet texte. Si le nombre decaractères est augmenté et que la taille de l’objet texte est élargie, la taille de la police estréduite sans changer le rapport hauteur/largeur.

Fit : Sélectionnez cette option pour régler automatiquement la taille du texte pour qu’il s’ajusteà la taille de l’objet. Avec cette option, la taille de la police et le rapport hauteur/largeur varienten fonction du nombre de caractères.

� Avec les options Auto et Clip, la taille de police normale utilise le rapport hauteur/largeurstandard (le rapport tel qu’il est, immédiatement après le changement de la taille de police).

� Les objets texte ne sont plus élargis ou réduits de façon linéaire, contrairement aux objetsgraphiques, etc...Par conséquent, si le texte est placé à l’intérieur d’un objet graphique de forme similaire,changer sa taille peut rendre le texte plus grand que l’objet graphique. Il est recommandé dene pas être excessivement précis quand vous positionnez les objets, mais de prévoir del’espace supplémentaire.

� Quand ils sont indexés avec une méthode comme SetText(), les objets de même type sontdisposés dans l’ordre Z, en partant du haut. Quand ils sont indexés, l’objet le plus hautdevient 0 et les autres deviennent 1, 2, etc.Pour vérif ier l’ordre Z avec P-touch® Editor, sélectionnez la commande [Auto Text]. AvecAuto Text, les objets contenant du texte sont aff ichés dans l’ordre, en partant du haut.Par conséquent, quand tout le texte a été saisi, commencez par l’objet texte (ou l’objetArrange Text) saisi en dernier puis sélectionnez [Layout] – [Order] – [Bring to Front] pourplacer l’objet au premier plan. (Répétez cette opération sur tous les objets texte entrés pourinverser leur ordre.)

En outre, si un objet texte contient plusieurs lignes de texte, les lignes sont numérotées enpartant du haut. L’ordre dans un objet ne peut pas être changé. (Chaque ligne de texte estindexée.)

3.2.3. Objets graphiques (illustrations)

� S’il faut remplacer des objets graphiques (illustrations) contenus dans le modèle, il est plusrapide de charger des modèles contenant des images plus petites et comportant moins decouleurs. b-PAC peut importer des f ichiers Jpeg mais il est recommandé de remplacer lesimages par des f ichiers Bmp plus petits lors de la création de modèles.

3.2.4. Objets code à barres

� Comme les objets texte, les objets code à barres ne peuvent pas être redimensionnés defaçon linéaire. Par conséquent, il est recommandé de les positionner en prévoyant unespace supplémentaire autour.

Page 32: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

32

3.2.5. Autres objets

� Si le texte est positionné dans un cadre, le cadre est placé derrière le texte.

3.2.6. Limites des modèles b-PAC

Parmi les f ichiers de mise en page (*.lbl) créés à l’aide de P-touch® Editor Version 3.x, nombreuxsont ceux qui peuvent être utilisés comme modèles avec b-PAC. Cependant, les limites suivantess’appliquent.

� Les f ichiers de mise en page contenant des champs de base de données fusionnés nepeuvent pas être utilisés comme modèles.

� Les f ichiers de mise en page contenant un code à barres utilisant le protocole QRCODE nepeuvent pas être utilisés comme modèles.

� La version courante de b-PAC ne peut pas aff icher les objets Clip art ou Make Picture. Sivous souhaitez utiliser des modèles contenant ce type d’objets, contactez-nous pour obtenirdes compléments d’information.

� Imprimante utilisée pour imprimer les données (de modèle)

Les informations du pilote utilisé pour imprimer sont enregistrées avec le modèle ; parconséquent, l’ordinateur essaye d’utiliser le pilote d’imprimante défini à chaque fois qu’il imprime lemodèle. Si le pilote d’imprimante défini lors de la création du modèle n’est pas installé sur le PC quilancera l’impression des données b-PAC, vous observerez les scénarios suivants.

Aucun pilote installé : Le composant b-PAC ne peut pas êtreutilisé.

Si un pilote d’imprimante a été installé, maisce n’est pas un pilote de la série P-touch/imprimante portable/Stampcreator(appelé ensuite "série P/M/S") :

Le modèle peut être ouvert mais il ne peutpas être imprimé.

Quand seulementun piloted’imprimante de lasérie P/M/S estinstallé :

Les données sont imprimées par l’imprimanteavec le pilote de la série P/M/S installé.

Si un pilote de la sérieP/M/S a été installé,mais s’il est différentde celui utilisé lors dela création dumodèle : Quand plusieurs

pilotes d’imprimantede la série P/M/Ssont installés :

Les données sont imprimées par l’imprimantede la série P/M/S avec le pilote dont le nomvient en premier dans l’ordre alphabétique.Dans ce cas, le modèle est modif ié pourcorrespondre au pilote d’imprimante installésur le PC.

Page 33: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

33

3.2.7. Exemples de modèles compris dans le SDK

La zone d’impression et l’imprimante pour les modèles du dossier de modèles b-PAC SDK (engénéral C:\Program Files\Brother bPAC SDK\Templates) sont tels qu’ils ont été définis pour le PT-9200PC.

Si l’impression est possible avec des pilotes d’imprimante de la série P/M/S autres que le PT-9200PC, utilisez P-touch Editor pour ouvrir un f ichier de mise en page (*.lbl) du dossier demodèles mentionné ci-dessus, sélectionnez [File] - [Printer Setup], sélectionnez l’imprimante quisera utilisée pour imprimer les données, ajustez la mise en page si elle dépasse la zoned’impression puis enregistrez le f ichier. (Cependant, si le pilote d’imprimante pour le PT-9200DXou le PT-2500PC de la série P/M/S est installé sur l’ordinateur, essayez de procéder sanschanger l’exemple de modèle.)

Page 34: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

34

3.3. Vérification d’un modèle

Quand vous avez créé le f ichier modèle, ouvrez-le et vérif iez qu’il s’aff iche correctement.Vous trouverez ci-dessous un aide-mémoire à utiliser pour créer des modèles.

3.3.1. Mise en page générale

� Avec les modèles d’étiquette, les objets ont-ils assez d’espace supplémentaire dans la zoned’impression ?

� Avec les modèles de tampon, tous les objets tiennent-ils dans la zone d’impression ? (Notezque les mises en page spéciales contenant de nombreux objets Arrange Text et clip art sontexclus.)

� Tous les objets superflus ont-ils été supprimés de la mise en page ? (Vérif iez en maintenantla touche de tabulation enfoncée pour sélectionner chaque objet.)

� Aucun objet n’étant sélectionné, exécutez la commande [Auto Text]. L’ordre d’aff ichage dutexte est-il correct ?

3.3.2. Texte

� A part quand l’option Fit est sélectionnée, la police de tout le texte apparaît-elle avec le mêmerapport hauteur/largeur que celui d’origine (notamment quand l’option Auto estsélectionnée) ?

� Si l’option Clip est sélectionnée, l’objet texte est-il placé de façon à ne pas cacher les autresobjets (lignes, etc.), prévoit-t-il de la place pour l’ajout de caractères et est-il ajusté à unetaille avec assez d’espace supplémentaire ?

� Des espaces superflus ont-ils été ajoutés au texte ? Dans ce cas, n’est-il pas possibled’ajuster l’espacement des caractères ?

� Des formatages nécessaires de caractère sont-ils perdus quand le texte est aff iché à l’aidede la commande [Auto Text] (quand le formatage des caractères est appliqué) ?

3.3.3. Code à barres

� Y a-t-il assez de place autour de l’objet code à barres pour l’empêcher de dépasser la zoned’impression si la longueur varie à cause des données de code à barres, ou pour l’empêcherde recouvrir d’autres objets de chaque côté (quand le code à barres est placé àl’horizontale) ?

3.3.4. Divers

� Aff ichez la mise en page avec une échelle de zoom de 1:1. Vérif iez la superposition desobjets. Faites particulièrement attention quand vous groupez des rectangles et des lignesdroites et quand vous dessinez des lignes. De plus, si un bitmap est utilisé dans le modèle,vérif iez comment il sera reproduit.

� Aff ichez la mise en page avec une échelle de zoom de 100%. Les objets ont-ils des partiesmanquantes et l’équilibre des objets est-il le même que quand la mise en page est aff ichéenormalement ?

Page 35: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

35

4. Référence pour BrssCom.Document

4.1. Nom de l’interface

Le nom de l’interface pour b-PAC est “BrssCom.Document”.

4.2. Liste des méthodes

Méthode RésuméOpen() Ouvre le fichier lbl qui se trouve au chemin d’accès spécifié

(UNC).Close() Ferme le document.

Save() Enregistre le document.

Export() Imprime le fichier au format spécifié (LBL, LBI ou BMP).Pour les formats LBI et BMP, vous pouvez spécifier la résolutionbitmap.

GetSheetSize() Récupère une chaîne de caractères qui définit la tail le dupapier.

GetTextCount() Renvoie le nombre de lignes de texte dans le document.

GetTextIndex () Renvoie un index pour le texte correspondant au nom duchamp.

GetText() Récupère les données de texte de la l igne spécifiée.

GetFontInfo() Récupère la police pour la l igne spécifiée.

SetText() Définit les données de texte pour la l igne spécifiée.

SetFontInfo() Définit la police pour la l igne spécifiée.

SetBarcodeData() Définit et met les données de code barre à jour.

ReplaceImageFile() Remplace l’objet graphique.

DoPrint() Imprime le document.

Page 36: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

36

4.2.1. Open()

boolean Open(BSTR szFilePath)[Arguments]szFilePath Chemin d’accès (UNC) au f ichier document[Valeur renv oyée]“0” est renvoyé si l’ouverture a échoué ; une valeur différente de “0” est renvoyée si elle aréussi.

[Description]Ouvre le fichier lbl qui se trouve au chemin d’accès spécifié (UNC).

4.2.2. Close ()

boolean Close()[Valeur renv oyée]“0” est renvoyé si la fermeture du document a échoué ; une valeur différente de “0” estrenvoyée si elle a réussi.

[Description]Ferme le fichier ouvert avec Open.

4.2.3. Save ()

boolean Save()[Valeur renv oyée]“0” est renvoyé si l’enregistrement a échoué ; une valeur différente de “0” est renvoyée s’il aréussi.

[Description]Enregistre le fichier ouvert avec Open.

4.2.4. Export()

boolean Export(long FileType, BSTR szFilePath, long dpi)[Arguments] FileType Type de f ichier sous lequel il doit être exporté

(0 : format LBL ; 1 : format LBI1; 2 : format BMP (monochrome) szFilePath Chemin d’accès (UNC) du f ichier exporté dpi Résolution pour l’exportation bitmap ; seulement valide quand FileType est le

format LBI ou BMPSpécif iez la résolution du périphérique de sortie (72 ou 96 pour un

aff ichage ; 360 pour une sortie sur le PT-9200PC/9200DX, 600 pour unesortie sur le SC-2000)

1 Pour augmenter la portabilité des polices, créez un f ichier binaire avec tous les objetspropriétaires P-touch (Stamp) Editor convertis en bitmaps. Les informations de taille de papiersont conservées.

Page 37: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

37

[Valeur renv oyée]“0” est renvoyé si l’exportation du f ichier a échoué ; une valeur différente de “0” est renvoyée sielle a réussi.

[Description]Exporte le f ichier au format spécif ié avec FileType.Si FileType est le format LBI ou BMP, spécif iez la résolution à dpi.

4.2.5. GetSheetSize ()

VARIANT GetSheetSize(short vt)[Arguments] vt format VARIANT pour les informations de taille ; En règle générale VT_BSTR

(8) est spécif ié.

[Valeur renv oyée]Renvoie les informations de taille au format VARIANT. Pour la taille 1850, “1850” est défini pour leformat VT_BSTR

[Description]Renvoie la taille de papier pour le document courant au format VARIANT.

4.2.6. GetTextCount ()

long GetTextCount()[Valeur renv oyée]Nombre de lignes du document courant où il est possible de saisir du texte

[Description]Renvoie le nombre de lignes du document courant où il est possible de saisir du texte.

4.2.7. GetTextIndex ()

long GetTextIndex (BSTR szFieldName)[Arguments]szFieldName Nom du champ (texte du modèle) correspondant au texte dont l’index doit être

récupéré

[Valeur renv oyée]-1 : Pas de lignes de texte correspondantes ; 0, etc. : Index du texte correspondant au nom duchamp

[Description]Renvoie l’index du texte correspondant au nom de champ spécif ié (texte du modèle). Enspécif iant un nom de champ dans le modèle, le texte peut être simplement saisi.S’il y a plusieurs lignes de texte avec le même nom de champ (texte du modèle) dans le mêmefichier modèle, l’index de la première ligne de texte est renvoyé.Voir 3.2.2 Text objects pour obtenir des détails sur les règles de numérotation des index pour leslignes de texte.

Page 38: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

38

GetText ()

boolean GetText(long nIndex, BSTR* lpszText)[Arguments]nIndex Index (à partir de 0) de la ligne de texte à récupérerlpszText Pointeur vers le tampon où le texte doit être récupéré

[Valeur renv oyée]“0” est renvoyé si la récupération du texte dans la ligne spécif iée a échoué ; une valeurdifférente de “0” est renvoyée si elle a réussi.

[Description]Extrait les données de texte de la ligne spécif iée.

4.2.8. GetFontInfo ()boolean GetText(long nIndex, BSTR* lpszText)[Arguments] nIndex Index (à partir de 0) de la ligne pour laquelle il faut récupérer les informations

de police lpszFontInfo Pointeur vers le texte des informations de police à récupérer ; Voir la

[Description] pour les détails.

[Valeur renv oyée]“0” est renvoyé si la récupération des informations de police pour la ligne spécif iée a échoué ;une valeur différente de “0” est renvoyée si elle a réussi.

[Description]Récupère les informations de police pour la ligne spécif iée. Le texte spécif ié par lpszFontInfo estséparé par des “,” (virgules) et la signif ication de chaque entité est décrite ci-dessous.

Index Nom Valeur0 Nom de la police Nom de la police1 Orientation 0 : écrit horizontalement ; 1 : écrit verticalement (non

valide avec SetFontInfo())2 Mise en

caractères gras0 : Normal ; 1 : Gras

3 Mise en italique 0 : Normal ; 1 : Italique4 Soulignement 0: Sans ; 1 : Avec5 Spécif ication de

caractères barrés0 : Sans ; 1 : Avec

6 Taille maximale depoint

1~ : Taille maximale de point (en unités de point de0,1)

7 Style decaractère

0 : Sans ; 1 : Ombre claire ; 2 : Ombre3 : Horizontal ; 4 : Détouré5 : Contour ; 6 : Encadré

Exemple : “Arial, 0, 1, 1, 0, 0,120,0” correspond à la police Arial, écrite à l’horizontale, en gras, enitalique, d’une taille maximale de 12 points et sans style de caractères.

Page 39: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

39

4.2.9. SetText ()boolean SetText(long nIndex, BSTR szText)[Arguments] nIndex Index (à partir de 0) de la ligne de texte à définir szText Texte à définir

[Valeur renv oyée]“0” est renvoyé si la définition du texte de la ligne spécif iée a échoué ; une valeur différente de“0” est renvoyée si elle a réussi.

[Description]Met à jour et définit les données de texte pour la ligne spécif iée.

4.2.10. SetFontInfo ()boolean SetFontInfo(long nIndex, BSTR szFontInfo)[Arguments] nIndex Index (à partir de 0) de la ligne pour laquelle il faut définir les informations de

police szFontInfo Texte des informations de police à définir ; Voir “GetFontInfo ()” pour les

détails des paramètres.

[Valeur renv oyée]“0” est renvoyé si la définition des informations de police pour la ligne spécif iée a échoué ; unevaleur différente de “0” est renvoyée si elle a réussi.

[Description]Met à jour et définit les informations de police pour la ligne spécif iée. Pour les détails sur lesparamètres d’information de police, voir “GetFontInfo ()”. Si un paramètre est absent (ou défini à“-1”), les informations de police courantes pour ce paramètre sont adoptées.

Page 40: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

40

4.2.11. SetBarcodeData ()boolean SetBarcodeData(long nIndex, BSTR szData)[Arguments] nIndex Index (à partir de 0) de l’objet code à barres à définir szData Texte des données de code à barres à définir

[Valeur renv oyée]“0” est renvoyé si la définition du code à barres a échoué ; une valeur différente de “0” estrenvoyée si elle a réussi.

[Description]Met à jour et définit les données de code à barres pour le code à barres spécif ié.

4.2.12. ReplaceImageFile()boolean ReplaceImageFile(long nIndex, BSTR szFilePath, long dwFlag)[Arguments] nIndex Index (à partir de 0) de l’objet graphique à définir szFilePath Chemin d’accès au f ichier image qui doit remplacer l’objet graphique dwFlag Indicateur pour remplacer les images (spécif ier “0”.)

[Valeur renv oyée]“0” est renvoyé si le remplacement de l’image a échoué ; une valeur différente de “0” estrenvoyée s’il a réussi.

[Description]Remplace l’objet graphique spécif ié par le f ichier graphique spécif ié dans szFilePath. Lesformats du f ichier graphique qui peuvent être spécif iés par szFilePath sont BMP ou TIFF, WMF,EMF, ICO ou JPEG décompressé.

Page 41: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

41

4.2.13. DoPrint()void DoPrint(long dwOption, BSTR szOption)[Arguments] dwOption Options d’impression ; 0 : Adopte les paramètres du pilote courant ; Autres :

Voir “[Descriptions]”. szOption Paramètres d’impression Spécif iez les paramètres d’impression avec des

chaînes de caractères séparées par des “,” (virgules) ; Voir [Description]pour les détails.

[Description]Imprime le document courant. DoPrint() est seulement valide pour l’impression sur une imprimantede la série Brother P-touch/Imprimante portable (série MW)/Stampcreator. Cette fonction n’estpas utilisée avec d’autres imprimantes.

� Option d’impression : dw Option

S’il ne faut pas adopter les paramètres des options d’impression du pilote et qu’il faut définir lesoptions d’impression à l’aide de DoPrint, spécif iez les paramètres en associant les indicateurssuivants dans dwOption. S’il faut adopter les paramètres, définissez dwOption à “0”.(Avec Visual Basic®, quand l’indicateur est spécif ié avec un numéral direct, et non pas unevaleur d’énumération commençant par bpo, l’indicateur semi-découpe 0x200, par exemple, estspécif ié comme &H200.)

Pilote Indicateur Description

bpoAutoCut (0x1)Effectue une découpe automatique.*Seulement valide sur les modèles compatiblesavec la fonction de découpe automatique.

bpoCutPause (0x2)

Effectue une pause pour découpe ou imprimeles marques de découpe.Seulement valide sur les modèles noncompatibles avec la fonction de découpeautomatique.

bpoHalfCut (0x200) Effectue une semi-découpe.*bpoChainPrint(0x400) Effectue une "impression en chaîne"*bpoNoCut (0x10000000) Pas de découpe.bpoMirroring (0x4) Imprime une image symétrique.*bpoColor (0x8) Imprime en couleur.*bpoMono (0x10000000) Imprime en monochrome.

Etiqueteuse(P-touch)

bpoContinue(0x40000000)

Se combine avec l’impression du DoPrint()suivant pour obtenir une seule impression.Ainsi, quand les DoPrints suivants sontappelés, les marges de début ne sont pasimprimées. Voir les "Précautions et l imites relatives àl’uti l isation de l’ indicateur bpoContinue"décrites plus loin.

Page 42: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

42

Imprimanteportable(série MW)

bpoContinue(0x40000000)

Se combine avec l’impression du DoPrint()suivant pour obtenir une seule impression.Ainsi, les étiquettes multiples peuvent êtreimprimées ensemble sur une seule feuilled’étiquettes prédécoupées. Voir les "Précautions et l imites relatives àl’uti l isation de l’ indicateur bpoContinue"décrites plus loin.

bpoStamp (0x80)Grave un tampon. Si l’indicateur est défini à“OFF”, une étiquette d’identif ication estimprimée.

Tampon(Stampcreator) bpoIdLabel (0x10000000) Impression de l’étiquette d’identif ication.*Remarque : Seulement valide sur les modèles compatibles avec la fonction. Le

paramétrage n’est pas valide avec les modèles qui ne gèrent pas lafonction, même si l’indicateur est défini.

� Paramètre d’impression : dw Option

Spécif iez les paramètres d’impression szOption à l’aide de texte séparé par des “,” (virgules). Lasignif ication de chaque entité est décrite ci-dessous.

Index Nom Description0 Nom du document

à imprimerSpécif iez le nom du document qui apparaîtra surl’écran de l’imprimante.S’il n’est pas spécif ié ou s’il est défini à “0”, “b-PAC”s’aff ichera sur l’écran.

1 Nombre de copies Spécif ie le nombre de copies. S’il n’est pas spécif ié,le nombre de copies est en général égal à “1”.Avec les tampons, la définition du nombre de copiesest invalide.

Exemple : “MonDoc, 2” indique que “MonDoc” apparaîtra sur l’écran de l’imprimante et que 2copies seront imprimées.

Page 43: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

43

[Précautions et limites relativ es à l’utilisation de l’indicateur bpoContinue]� Une tâche d’impression est créée à chaque fois que la méthode DoPrint normale est appelée.

Cependant, en spécif iant un indicateur bpoContinue, la f in de la tâche d’impression estdifférée jusqu’à l’appel de la prochaine. De plus, si le même indicateur est également spécif iépour le DoPrint suivant, la f in de la tâche d’impression continue à être différée.

� Si l’indicateur bpoContinue est défini, les autres indicateurs spécif iés pour les optionsd’impression (dw Option) et les paramètres d’impression spécif iés (szOption) autres que lenombre de copies, sont valides pour la première méthode DoPrint appelée, mais sont ignoréspour les méthodes DoPrint appelées par la suite, jusqu’à ce que la tâche d’impression soitterminée.

� Quand l’indicateur bpoContinue est défini dans une méthode DoPrint, la tâche d’impressionpeut être terminée (=l’impression commence) de l’une des façons suivantes.a). Ne pas définir un indicateur bpoContinue quand l’une des méthodes DoPrint est appeléeb). Appeler une méthode Open ou Close à partir de la fois suivantec). Libérer l’objet b-PAC

� Après avoir défini un indicateur bpoContinue et appelé la méthode DoPrint, le processusd’attente d’un événement d’utilisateur f inal, tel qu’une saisie ou sélection de données, ne serapas lancé avant la f in de la tâche d’impression (=l’impression commence) de l’une des troisfaçons (a, b ou c) mentionnées ci-dessus.

� Le nombre maximum de fois où une méthode DoPrint avec l’indicateur bpoContinue spécif iépeut être appelée (nombre de pages qu’il est possible d’imprimer en une seule tâched’impression) dépend du nombre maximum de pages que chaque imprimante peut imprimerou des capacités de l’ordinateur.

Page 44: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

44

[Exemple d’utilisation de la méthode DoPrint av ec Visual Basic®]

� Imprime une copie avec les paramètres d’option d’impression du pilote courant

...ObjDoc.DoPrint 0, "0"

� Imprime une copie sans découpe entre les étiquettes

ObjDoc.DoPrint bpoNoCut, "0" ouObjDoc.DoPrint &H10000000, "0"

� Imprime trois copies avec les paramètres d’option d’impression du pilote courant

...ObjDoc.DoPrint 0, "b-PAC Sample,3"

� Exemple d’impression par lots (batch) de plusieurs étiquettes à l’aide de l’indicateurbpoContinue

'Imprime 5 étiquettes en une seule tâche d’impression (PT-9200DX/PT-9200PC)...iTotal = 5nIndex = ObjDoc.GetTextIndex("Name")For iCount = 1 To iTotal

strCount = "Count = " + CStr(iCount)ObjDoc.SetText nIndex, strCountIf iCount < iTotal Then

'Continue la tâche d’impression et imprime avec des semi-découpesObjDoc.DoPrint &H40000200, "test,1"

Else'Dernière impression (fin de la tâche)ObjDoc.DoPrint 0, "0"

End IfNext

Page 45: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

45

5. Exemples de programmesLes exemples de projets partent de l’hypothèse que les modèles se trouvent dans le dossierC:\Program Files\Brother bPAC SDK\Templates. Si le kit Brother b-PAC SDK est copié dans unautre dossier, consultez les précautions sous la rubrique Installation. Cette restriction s’appliqueseulement aux exemples de projet, pas au composant b-PAC.

5.1. Visual Basic® (dossier VB)

Résumé

Application pour créer des plaques d’identitéPour créer des plaques d’identité, entrez le nom et lasociété. Sélectionnez l’un des deux modèles suivants :simple ou encadré.

Méthodesutilisées Open(), GetTextIndex(), SetText(), DoPrint()NamePlt

Environnementdedéveloppementutilisable

Microsoft® Visual Basic® Version 6.0 SP4

L’exemple suivant montre les méthodes b-PAC utilisées dans l’exemple NamePlt.

Public Sub DoPrint(strPath As String, strExport As String)

‘ Crée l’objet b-PACDim ObjDoc As BrssCom.DocumentSet ObjDoc = CreateObject("BrssCom.Document")

‘ Ouvre le modèleIf (ObjDoc.Open(strPath) <> False) Then

‘ Recherche le texte grâce aux noms de champs puisremplace le texte

Dim nIndex As IntegernIndex = ObjDoc.GetTextIndex("Company")ObjDoc.SetText nIndex, edPosition.TextnIndex = ObjDoc.GetTextIndex("Name")ObjDoc.SetText nIndex, edName.Text

‘ Impression ou exportationIf (strExport = "") Then

ObjDoc.DoPrint 0, "0" ' ImpressionElse

ObjDoc.Export 2, strExport, 180 ' ExportationEnd If

End IfSet ObjDoc = Nothing

End Sub

Page 46: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

46

5.2. Visual C++® (dossier VC)

Résumé

Application pour créer des plaques d’identitéPour créer des plaques d’identité, entrez le nom et leservice. Sélectionnez l’un des deux modèles suivants :simple ou encadré.Version Visual C++ de l’exemple Visual Basic®

NamePltMéthodesutilisées Open(), GetTextIndex(), SetText(), DoPrint()

NamePlt

Environnementdedéveloppementutilisable

Microsoft® Visual C++® Version 6.0 SP4

Page 47: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

47

5.3. Visual Basic® pour application (dossier VBA)

Résumé

Application Microsoft® Excel pour créer des étiquettesd’expédition.A l’aide d’une interface interactive, une étiquetted’expédition est créée à partir du texte saisi dans lescellules. Les polices du texte peuvent également êtrechangées.

Méthodesutilisées

Open(), SetText(), DoPrint(), GetTextCount(), Save(),Close()

ShipForm.xls

Environnementdedéveloppementutilisable

Microsoft® Excel 97 ou 2000

Résumé

Application Microsoft® Access pour créer des plaquesd’identité.Référence les données d’enregistrement de la base dedonnées et imprime une plaque d’identité.

Méthodesutilisées Open(), GetTextIndex(), SetText(), DoPrint()NamePlt.mdb

Environnementdedéveloppementutilisable

Microsoft® Access 97Avec Access 2000, les f ichiers peuvent être convertis.

Résumé

Application Microsoft® Access pour créer desétiquettes de prix.Référence les données d’enregistrement de la base dedonnées et imprime une étiquette contenant lesdonnées de code à barres.

Méthodesutilisées

Open(), GetTextIndex(), SetText(), DoPrint(),SetBarcodeData()

ShopLbl.mdb

Environnementdedéveloppementutilisable

Microsoft® Access 97Avec Access 2000, les f ichiers peuvent être convertis.

Page 48: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

48

5.4. VB Script (pour l'environnement d'exécution de scripts Windows) (dossierVBS)

RésuméScript pour créer des plaques d’identitéVersion impression de script de l’exemple Visual Basic®

NamePltMéthodesutilisées Open(), SetText(), DoPrint()NamePrn.vbsEnvironnementdedéveloppementutilisable

Microsoft® Window s® Script Host Version 1.0

Page 49: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

49

5.5. VB Script (pour Internet Explorer) (dossier VBS)

Pour utiliser l’exemple suivant, il faut disposer de Internet Explorer 4.0 ou d’une version ultérieure.

Résumé

Page HTML pour créer des plaques d’identitéPour créer des plaques d’identité, entrez le nom et leservice. Sélectionnez l’un des deux modèles suivants :simple ou encadré.Version HTML de l’exemple Visual Basic® NamePlt

VBS_NamePlate.html

Méthodesutilisées Open(), GetTextIndex(), SetText(), Export(), DoPrint()

Résumé

Page HTML pour créer des étiquettes contenant desimagesPour créer l’étiquette, spécif iez l’ image et entrez le nom.Des f ichiers bitmap optionnels peuvent être spécif iéspour les graphiques.

VBS_ChangeImage.html

Méthodesutilisées Open(), SetText(), Export(), DoPrint(), ReplaceImageFile()

Résumé

Page HTML pour accéder à une base de données etimprimer des étiquettes contenant les données de code àbarres et le nom pour l’élément spécif iéCréez d’abord un f ichier MDB Microsoft® Accesscorrespondant aux éléments et aux données de code àbarres. Tout en maintenant les boutons d’impression oud’aperçu enfoncés, accédez à la base de données avecADO, récupérez les données de code à barrescorrespondant à l’élément puis imprimez quand lecomposant a effectué le remplacement par le code àbarres réel.

Méthodesutilisées Open(), SetText(), Export(), DoPrint(), SetBarcodeData()

VBS_DB_Bcd.html

Remarque :

Pour accéder à la base de données à l’aide de ADO, ilfaut télécharger le composant MDAC (mdac_typ.exe) dusite suivant pour l’installer.http://w w w .microsoft.com/data/dow nload.htm(Ce composant est déjà installé sous Window s® 2000/XPet la Millennium Edition.)

Page 50: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

50

5.6. Application de console (invite de commande) (dossier Console)

Résumé

Exemple d’application qui utilise le composant b-PAC del’application de la console (invite de commande) etimprime les codes à barre. Pour une explication duprogramme, voir la suite.

Méthodesutilisées Open(), SetText(), SetBarcodeData(), DoPrint()ConsoleLabe

lEnvironnementdedéveloppementutilisable

Microsoft® Visual C++® Version 6.0 SP4Microsoft® Window s® Script Host Version 1.0

Description

ConsoleLabel.c

Source du programme de console écrit en C.Le moteur de script VB w script est appelé de la fonction système() de la bibliothèqued’exécution C. De plus, le nom de f ichier du script (BcdLabel.vbs) et les deux argumentstransférés dans le f ichier de script sont spécif iés comme arguments de w script. Une foissimplif ié, on obtient :

system("w script script-file-name parameter1 parameter2");

BcdLabel.vbs

Le composant b-PAC est appelé avec le f ichier Script VB, appelé à partir de ConsoleLabel.c, etle code à barres est imprimé.Ce f ichier de script utilise deux arguments. Le premier correspond au nom de l’élément et ledeuxième au code pour l’élément qui sera transformé en code barres.

Page 51: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

51

Page 52: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

52

Brother P-touch ApplicableComponent (b-PAC)

SDK-Spezifikationen Version 1.0.1

Brother Industries, Ltd. P&H Company©Copyright Brother Industries, Ltd. 1998-2002

Unerlaubte Reproduktion oder Vervielfältigung ist nicht gestattet.

Page 53: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

53

– Inhaltsverzeichnis –1. ...................................................................................................................................Einführung 542. ..............................................................................................................Installation/Deinstallation 553. ............................................................................................................. Vorlagedateien erstellen 584. ..................................................................................................BrssCom.Document-Funktionen 645. ......................................................................................................................Beispielprogramme 76

– Aktualisierungen – 02.08.2001 ................................................................................................................ Neu erstellt 13.11.2002 Version 1.0.1 Ergänzung des bpoContinue-Attributs für DoPrint() 13.11.2002 .......................... Hinzufügen des Mobile Printer zur Liste der Drucker

Microsoft®, Window s®, Visual Basic®, Visual C++® und ActiveX® sind eingetrageneWarenzeichen der Microsoft Corporation in den Vereinigten Staaten und/oder in anderenLändern. Alle anderen Firmen- oder Produktnamen, die in Zusammenhang mit dieser Softw areerw ähnt w erden, sind eingetragene Warenzeichen der entsprechenden Firmen.

Page 54: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

54

1. EinführungDiese Spezif ikationen beschreiben und erklären das SDK (Softw are Development Kit) und dieBrother P-touch Applicable Component (im Folgenden “b-PAC” genannt). Mit Hilfe von b-PAC können mit dem P-touch® Editor erstellte Dateien (*.lbl) als Vorlagen verw endet w erden undüber ein anderes Anw endungsprogramm mit einem P-touch-Gerät einem Mobile Printer (MW-Serie) oder einem StampCreator (im Folgenden "P/M/S-Drucker" genannt) ausgedruckt w erden,ohne dass der P-touch Editor aufgerufen w erden muss.

1.1. Was ist b-PAC?b-PAC ist eine Komponente, die P-touch® Editor-Dateien als Vorlagen verw endet, darinenthaltene Texte, Barcodes und Grafiken ersetzen und mit einem P-touch-Gerät ausdruckenkann. Dazu w erden mit dem P-touch® Editor erstellte Vorlagendateien und Treiber für das P-touch-Gerät, mit dem gedruckt w erden soll, benötigt.

b-PAC ist als COM-Automatisierungsserver angelegt. Wenn eine Anw endung mit COM-Automatisierungsservern arbeiten kann, w ie z.B. Visual Basic® oder Visual C++®, oder eineentsprechende Entw icklungsumgebung benutzt w ird, kann ohne Verw endung des P-touch Editorgedruckt w erden.

b-PAC Komponenteb-PAC-Komponente

UserAnwendungsprogramme

((Visual Basic, Visual C++, VB Script,Visual Basic, Visual C++, VB Script,etc. )

Drucken(über Treiber)

(Created with P-touch(Vorlage erstellt mit P-touch Editor)ReadVorlage lesenChange text andText bzw. Barcode ändern

Steuerung

Page 55: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

55

2. Installation/Deinstallation

2.1. Lizenzvertrag

Um die Komponente sow ie das SDK, das die Komponente enthält, zu nutzen, müssen Siew ährend der Installation bestätigen, dass Sie den Lizenzvertrag akzeptieren. DiesenLizenzvertrag f inden Sie in der Datei bPACEula.rtf, die sich im selben Ordner befindet w ie dasvorliegende Dokument.

2.2. Installation

Zur Verw endung der Komponente und des SDK, das die Komponente enthält, starten Sie dasProgramm “Setup.exe” im Ordner “Brother b-PAC SDK”. Die Installation kann auch durchdoppelklicken auf “bPacSdk.msi” gestartet w erden (dies ist jedoch nur in einerBetriebssystemumgebung möglich, die den Window s Installer bereits enthält, w ie z. B. unterWindow s® Me/2000/ XP).

Hinw eis 1“Brother b-PAC SDK” enthält Beispielprojekte. Zur Verw endung dieser Projekte müssen dieVorlagen im Ordner C:\Programme\Brother bPAC SDK\Templates gespeichert sein.Wenn das Brother b-PAC SDK in einem anderen Ordner als C:\Programme\Brother bPAC SDK\installiert w urde, sollten Sie alle Dateien des bei der Installation angelegten Templates-Ordners indas Verzeichnis C:\Programme\Brother bPAC SDK\Templates kopieren.Zur Verw endung der verschiedenen Beispielprojekte, muss die dazu notw endige Entw icklungs-und Ausführungsumgebung gegebenenfalls separat installiert w erden. Lesen Sie dazu 5Beispielprogramme.

Hinw eis 2Bei der Installation von Brother b-PAC SDK unter Window s® 95 oder zur Redistribution der b-PAC-Komponente, kann die Registrierung der Typenbibliothek für die Komponente fehlschlagen.Falls dies passieren sollte, starten Sie “DCOM95.exe” oder installieren Sie den Internet Explorer4.0 bzw . eine neuere Version. “DCOM95.exe” können Sie von der folgenden Internetseiteherunterladen, indem Sie auf dieser Seite nach“DCOM95” suchen.http://w w w .microsoft.com/dow nloads/search.asp

2.3. Installierte Dateien

Bei der Installation des Brother b-PAC SDK w erden die Dateien in die folgenden Ordner kopiert:

� Anwendungsordner (normalerweise C:\Programme\Brother bPAC SDK\)\Doc Dieses Dokument, der Lizenzvertrag und eine Liste der Beispiele (Redistribution

möglich)\Redist Merge-Modul für die Redistribution (BrssCom.msm)\Samples VB-, VBA-, VBS- und VC-Beispielprojekte\Templates Vorlagen-Dateien zur Verw endung mit den Beispielprojekten

� Ordner für gemeinsame Dateien (normalerweise C:\Programme\GemeinsameDateien\Brother BrssCom)

Komponente und Typenbibliothek

Page 56: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

56

2.4. Deinstallation

Brother b-PAC SDK kann über "Systemsteuerung", "Softw are", "Entfernen" deinstalliert w erden.

Page 57: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

57

2.5. Programmredistribution

Bei der Redistribution von Programmen, die mit Brother b-PAC SDK erstellt w urden, müssen diefolgenden Komponenten und Dateien auf dem Client-Computer installiert w erden, auf dem auchdas Programm installiert w urde.Die Redistribution von Brother b-PAC SDK ist nicht möglich.

1. b-PAC-KomponentenDie einfachste und zuverlässigste Methode zur Installation der Komponenten ist das Kopierenvon “BrssCom.msm” in das Installationsprojekt des Window s® Installers. Die Datei“BrssCom.msm” befindet sich im Ordner “Redist” des Anw endungsordners (normalerw eiseC:\Programme\Brother bPAC SDK\). Mit BrssCom.msm kann die Komponente von mehrerenProjekten benutzt w erden, die Registry und Typenbibliothek der Komponente sind ebenfallsregistriert.

Falls Sie nur die Komponente auf einem Client-PC installieren möchten, verw enden Sie bitte die b-PAC Client-Komponente, die Sie von der b-PAC Dow nload Site herunterladen können.Ausführliche Informationen zur Verw endung der Client-Komponente f inden Sie ebenfalls auf derDow nload Site im Internet.

2. Druckertreiber für das Gerät, mit dem gedruckt werden sollInstallieren Sie den Treiber mit dem Installationsprogramm, das sich auf der P-touch Editor CD-ROM befindet, oder laden Sie den passenden Treiber von der Brother Web Site(http://w w w .brother.com/) herunter.Wenn der Treiber für das P-touch-Gerät, mit dem gedruckt w erden soll, bereits zusammen mitdem P-touch Editor auf dem Client-Computer installiert w urde, muss er nicht noch einmal installiertw erden.

3. VorlagendateienFür die Verw endung von b-PAC w erden mit dem P-touch Editor erstellte Vorlagedateien benötigt.Diese Vorlagen können auch auf einem Server gespeichert w erden, auf den der Client-Computerzugreifen kann.Wenn der Treiber installiert und die Vorlagedateien verfügbar gemacht w urden, w ird der P-touchEditor zur Verw endung von b-PAC nicht benötigt.

Page 58: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

58

3. Vorlagedateien erstellen

3.1. Was sind Vorlagedateien?

Zur Verw endung von b-PAC müssen Vorlagedateien mit dem P-touch® Editor Version 3.x erstelltw erden. Es ist nicht notw endig diese Vorlagedateien in einem besonderen Format zu speichern,sie können ganz normal als Layoutdatei (*.lbl) gesichert w erden.b-PAC gibt die Vorlagedatei (=Layoutdatei) in derselben Größe (Breite und Länge) und mitdemselben Druckertreiber aus, der beim Erstellen der Vorlage eingestellt w ar. Dadurch könnenSie das Etikett unabhängig von den aktuellen Druckereinstellungen mit dem gew ünschten Gerät inder gew ünschten Größe drucken.(*Hinw eis) Lesen Sie auch “Einschränkungen für b-PAC-Vorlagen”.

3.2. Vorlagedateien erstellen

3.2.1. Verfahren

1. Starten Sie den P-touch Editor Version 3.x. Wählen Sie dann "Datei" – "Druckereinstellungen"und vergew issern Sie sich, dass der richtige Treiber für das Gerät, mit dem später die Vorlagegedruckt w erden soll, gew ählt ist. Falls nicht der passende Treiber eingestellt ist, w ählen Sieden richtigen Treiber, klicken Sie dann auf "Als Standard verw enden" und abschließend auf"OK".

2. Wählen Sie nun in den "Seiteneigenschaften" die gew ünschte Etikettengröße.

3. Erstellen Sie die Beschriftung. Beachten Sie bei der Eingabe die Hinw eise zu den einzelnenObjekten in den folgenden Abschnitten.

4. Speichern Sie das fertige Etikett w ie gew ohnt als Layoutdatei.

3.2.2. Textobjekte

� Die einzelnen Textobjekte sollten aus vollständigen, sinnvollen Einheiten bestehen. ZumBeispiel sollte eine lange zw eizeilige Adresse als ein Objekt mit zw ei Zeilen und nicht alszw ei separate Textobjekte eingegeben w erden.

� Innerhalb eines Textobjektes sollten keine unterschiedlichen Zeichengrößen und Druckstileverw endet w erden. Es kann zw ar jeder Buchstabe eines Textobjektes unterschiedlichformatiert w erden, beim Ausdruck w ird jedoch für alle Zeichen das für das erste Zeichengew ählte Format verw endet.

� TextoptionenDa sich bestimmte Eigenschaften des Vorlagentextes ändern können, sollten dieTextausrichtung und das Verhältnis "Größe Text/Textobjekt" (in den Texteigenschaften)eingestellt w erden, so dass sich die Position des Textes selbst dann nicht verändert, w ennsich die Breite des Textobjektes ändert. Die "Größe Text/Textobjekt"-Einstellung kann w iefolgt verw endet w erden.

Auto: Diese Option sollten Sie verw enden, w enn um das Textobjekt herum genug Platz ist

Page 59: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

59

und die Schriftgröße sow ie das Höhe/Breite-Verhältnis erhalten bleiben sollen, ohne dassText abgeschnitten w ird. Oder verw enden Sie diese Option, w enn die Textdaten im Objektklein genug sind, so dass die Größe des Objektes verringert w erden kann.In Verbindung mit b-PAC ergibt diese Option jedoch dasselbe Resultat w ie die Funktion“Schneiden”.

Schneiden: Diese Option w ird für Vorlagen, die von b-PAC verw endet w erden sollen,empfohlen. Wenn diese Option gew ählt ist und sich die Anzahl der Zeichen verringert, bleibtdie Schriftgröße und das Höhe/Breite-Verhältnis erhalten, ohne dass die Größe desTextobjektes geändert w ird. Falls sich die Anzahl der Zeichen erhöht und das Textobjektvergrößert w ird, verringert sich die Schriftgröße, ohne dass das Höhe/Breite-Verhältnisverändert w ird.

Anpassen: Wählen Sie diese Option, w enn die Textgröße automatisch an die Größe desObjektes angepasst w erden soll. Mit dieser Einstellung ändert sich die Schriftgröße und dasHöhe/Breite-Verhältnis mit der Anzahl der eingegebenen Zeichen.

� Wenn die Einstellungen "Auto" oder "Schneiden" gew ählt sind, hat die normale Schriftgrößedas normale Höhe/Breite-Verhältnis (d. h. dasselbe Verhältnis w ie unmittelbar nachEinstellen der Schriftgröße.)

� Textobjekte w erden im Gegensatz zu Grafikobjekten etc. nicht linear vergrößert bzw .verkleinert.Wenn Text innerhalb eines Grafikobjektes mit ähnlicher Form platziert w ird, kann dieÄnderung der Schriftgröße dazu führen, dass der Text größer als das Grafikojekt w ird. Esw ird daher empfohlen, beim Positionieren von Objekten die Größe von Text und Grafik nichtzu genau anzupassen, sondern eher ein w enig freien Platz zu lassen.

� Wenn zur Indizierung eine Funktion w ie SetText () verw endet w ird, w erden Objektederselben Art von oben beginnend in der Z-Reihenfolge angeordnet. Das oberste Objektw ird zu Objekt 0 und die restlichen Objekte w erden Objekt 1, 2 usw .Zur Überprüfung der Z-Reihenfolge mit dem P-touch® Editor w ählen Sie den "AutoText"-Befehl. Mit der AutoText-Funktion w erden Objekte, die Texte enthalten, von oben beginnendin der aktuellen Reihenfolge angezeigt.Um die Reihenfolge zu ändern, sollten Sie nachdem der gesamte Text eingegeben w urde, mitdem zuletzt eingegebenen Textobjekt (oder "Text anordnen"-Objekt) beginnen und "Layout" –"Objekt nach vorne/hinten" – "In den Vordergrund" w ählen, um das Objekt in denVordergrund zu bringen. (Wiederholen Sie diesen Vorgang für alle Textobjekte, um ihreReihenfolge zu ändern.)

Falls ein Textobjekt mehrere Textzeilen enthält, w erden die Zeilen von oben nach untennummeriert. Die Reihenfolge innerhalb eines Objektes kann nicht geändert w erden. (Es w irdjede Textzeile einzeln indiziert.)

3.2.3. Grafikobjekte (Abbildungen, Bilder)

� Wenn Grafikobjekte (Abbildungen), die in der Vorlage enthalten sind, ersetzt w erden sollen,können Vorlagen, die kleinere Abbildungen mit w eniger Farben enthalten, schneller geladenw erden. b-PAC kann Jpeg-Dateien importieren, beim Erstellen von Vorlagen w ird jedoch

Page 60: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

60

empfohlen, Bilder durch kleinere Bmp-Dateien zu ersetzen.

3.2.4. Barcode-Objekte

� Wie Textobjekte können Barcode-Objekte nicht linear verkleinert bzw . vergrößert w erden.Es w ird daher empfohlen, genügend Platz um die Barcodes herum freizulassen.

3.2.5. Andere Objekte

� Wenn sich Text in einem Rahmen befindet, w ird der Rahmen nach dem Text gesendet.

Page 61: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

61

3.2.6. Einschränkungen für b-PAC-Vorlagen

Viele der mit dem P-touch® Editor Version 3.0/3.1 erstellten Layoutdateien (*.lbl) können alsVorlagen für b-PAC verw endet w erden. Bitte beachten Sie jedoch die folgendenEinschränkungen.

� Layoutdateien, die eingefügte Datenbankfelder enthalten, können nicht als Vorlageverw endet w erden.

� Layoutdateien, die einen Barcode mit QRCODE-Protokoll enthalten, können nicht als Vorlageverw endet w erden.

� Clipart-Dateien und mit der Funktion "Grafik erstellen" erstellte Grafikobjekte können mit deraktuellen Version von b-PAC nicht angezeigt w erden.

� Drucker zur Ausgabe der Vorlage

Die Informationen über den zu verw endenden Druckertreiber w erden mit der Vorlagegespeichert, daher versucht der Computer beim Ausdrucken der Vorlage stets den beim Erstellender Vorlage eingestellten Treiber zu verw enden. Wenn dieser Druckertreiber nicht auf dem PC,über den die Vorlage gedruckt w erden soll, installiert ist, geschieht Folgendes:

Es ist kein Druckertreiber installiert: Die b-PAC-Komponente kann nicht benutztw erden.

Wenn ein Druckertreiber installiert ist, aberkein P-touch/Mobile Printer/Stampcreator-Treiber (im Folgenden “P/M/S” abgekürzt):

Die Vorlage kann geöffnet, aber nichtgedruckt w erden.

Wenn nur eineinziger P/M/S-Treiber installiert ist:

Die Daten w erden mit dem P/M/S-Gerätausgedruckt, dessen Treiber installiert ist.

Es ist ein P/M/S-Treiber installiert,jedoch nicht derselbeTreiber w ie der beimErstellen der Vorlageverw endete Treiber:

Wenn mehrereP/M/S-Treiberinstalliert sind:

Die Daten w erden mit dem P/M/S-Treibergedruckt, dessen Name alphabetisch sortiertan erster Stelle steht. Die Vorlage w ird indiesem Fall entsprechend angepasst.

3.2.7 Mit dem SDK gelieferte Beispielvorlagen

Druckbereich und Drucker der im b-PAC SDK Templates-Order (normalerw eise C:\Programme\Brother bPAC SDK\Templates) enthaltenen Vorlagen w urden für den Ausdruck mit einem PT-9200PC eingestellt.Wenn eine dieser Vorlagen mit einem anderen P/M/S-Treiber gedruckt w erden soll, öffnen Siebitte mit dem P-touch Editor die Layoutdatei (*.lbl) im oben erw ähnten Templates-Ordner, w ählen"Datei" – "Druckereinrichtung" und dann den Treiber, der zum Drucken der Daten verw endetw erden soll. Falls das Layout den Druckbereich überschreitet, passen Sie es an und speichernSie anschließend die Datei. /Wenn jedoch ein Druckertreiber für den P-touch 9200DX oder PT-

Page 62: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

62

2500PC der P/M/S-Serie auf dem Computer installiert ist, versuchen Sie den Ausdruck ohneÄnderung der Vorlage.)

Page 63: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

63

3.3. Prüfen der Vorlage

Nachdem Sie die Vorlage erstellt haben, sollten Sie sie öffnen und überprüfen, ob alle Objektew ie gew ünscht dargestellt w erden.Überprüfen Sie beim Erstellen der Vorlage die zu beachtenden Punkte mit Hilfe der folgendenCheckliste.

3.3.1. Allgemeines Layout

� Beim Erstellen von Vorlagen für Etiketten: Ist genug Platz rund um die Objekte innerhalb desDruckbereiches?

� Beim Erstellen von Stempelvorlagen: Passen alle Objekte in den Druckbereich (besondereLayouts mit vielen "Text anordnen"-Objekten und Cliparts sind nicht möglich)?

� Wurden alle unnötigen Objekte im Layout gelöscht? (Halten Sie zur Überprüfung die Tab-Taste gedrückt, um alle Objekte zu markieren.)

� Achten Sie darauf, dass kein Objekt gew ählt ist und w ählen Sie dann den "AutoText"-Befehl. Erscheint der Text in gew ünschten Reihenfolge?

3.3.2. Text

� Wenn die Anpassen-Option nicht gew ählt ist: Wird die Schrift aller Texte im ursprünglichenHöhe/Breite-Verhältnis angezeigt (vor allem, w enn die Option "Auto" gew ählt ist)?

� Wenn die Schneiden-Option gew ählt ist: Ist das Textobjekt so platziert, dass es nicht andereObjekte verdeckt (Linien etc.), können noch Zeichen hinzugefügt w erden und ist die Größedes Objektes so gew ählt, dass noch genug Platz frei ist?

� Befinden sich im Text überflüssige Leerzeichen? Ist es stattdessen nicht möglich, denZeichenabstand zu ändern?

� Ist eine verw endete Zeichenformatierung nicht mehr vorhanden, w enn der Text mit der"AutoText"-Funktion angezeigt w ird?

3.3.3. Barcode

� Befindet sich um den Barcode herum genügend Platz, damit er nicht den Druckbereichüberschreitet oder von anderen Objekten überdeckt w ird, sobald sich seine Länge durchden Umfang der Barcode-Daten ändert (w enn der Barcode horizontal angeordnet ist)?

3.3.4. Anderes

� Wählen Sie mit der Zoom-Funktion die Einstellung 1:1. Überprüfen Sie, ob sich die Objekteüberlappen. Gehen Sie besonders sorgfältig vor, w enn Rechtecke und gerade Liniengruppiert und Linien gezeichnet w urden. Wenn eine Bitmap-Grafik in der Vorlage enthaltenist, prüfen Sie bitte, ob sie richtig angezeigt w ird.

� Wählen Sie mit der Zoom-Funktion die Einstellung 100%. Fehlen Teile der Objekte und sind dieObjekte genauso ausgew ogen angeordnet w ie in der normalen Ansicht?

Page 64: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

64

4. BrssCom.Document-Funktionen

4.1. Schnittstellenname

Der Name der b-PAC-Schnittstelle ist “BrssCom.Document”.

4.2. Funktionen

Funktionen ZusammenfassungOpen() Öffnet die Layoutdatei (lbl) im angegebenen Pfad (UNC).

Close() Schließt die Layoutdatei.

Save() Speichert die Layoutdatei.

Export() Gibt die Datei im angegebenen Format aus (LBL, LBI oderBMP).Für die LBl- und BMP-Formate kann die Bitmap-Auflösungfestgelegt werden.

GetSheetSize() Ruft den String ab, der das Papierformat festlegt.

GetTextCount() Ruft die Anzahl der Textzeilen in der Layoutdatei ab.

GetTextIndex () Ruft einen Index für den Text ab, der mit dem Feldnamen(Vorlagentext) übereinstimmt.

GetText() Ruft die Textdaten in der angegebenen Zeile ab.

GetFontInfo() Ruft die Schriftart für die angegebene Zeile ab.

SetText() Setzt die Textdaten für die angegebene Zeile.

SetFontInfo() Legt die Schrift für die angegebene Zeile fest.

SetBarcodeData() Setzt und aktualisiert die Barcode-Daten.

ReplaceImageFile() Ersetzt das Grafikobjekt.

DoPrint() Druckt die Layoutdatei.

Page 65: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

65

4.2.1. Open()

boolean Open(BSTR szFilePath)[Parameter]szFilePath Pfad (UNC) der Datei[Zurückgegebener Wert]“0” w ird zurückgegeben, w enn die Datei nicht geöffnet w erden konnte, ein anderer Wert als “0”w ird zurückgegeben, w enn die Datei erfolgreich geöffnet w urde.

[Beschreibung]Öffnet die Layoutdatei (lbl) mit dem angegebenen Pfad (UNC).

4.2.2. Close ()

boolean Close()[Zurückgegebener Wert]“0” w ird zurückgegeben, w enn die Datei nicht geschlossen w erden konnte, ein anderer Wert als“0” w ird zurückgegeben, w enn die Datei erfolgreich geschlossen w urde.

[Beschreibung]Schließt die mit Open geöffnete Datei.

4.2.3. Save ()

boolean Save()[Zurückgegebener Wert]“0” w ird zurückgegeben, w enn die Datei nicht gespeichert w erden konnte, ein anderer Wert als“0” w ird zurückgegeben, w enn die Datei erfolgreich gespeichert w urde.

[Beschreibung]Speichert die mit Open geöffnete Datei.

4.2.4. Export()

boolean Export(long FileType, BSTR szFilePath, long dpi)[Parameter] FileType Typ der zu exportierenden Datei

(0: LBL-Format; 1: LBI-Format1; 2: BMP(monochrom)- Format szFilePath Pfad (UNC) der exportierten Datei dpi Auflösung für das Exportieren einer Bitmap; nur gültig für FileType LBI oder

BMPGeben Sie die Auflösung des Ausgabegerätes an (72 oder 96 für Anzeige;

360 zur Ausgabe mit einem PT-9200PC/9200DX, 600 zur Ausgabe mit einemSC-2000)

1 Um die Portabilität der Schriften zu erhöhen, sollten Sie eine binäre Datei erstellen, in der alleproprietären P-touch (Stamp) Editor Objekte in Bitmap konvertiert sind. Die Papierformat-Informationen bleiben erhalten.

Page 66: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

66

[Zurückgegebener Wert]“0” w ird zurückgegeben, w enn die Datei nicht exportiert w erden konnte, ein anderer Wert als “0”w ird zurückgegeben, w enn die Datei erfolgreich exportiert w urde.

[Beschreibung]Exportiert die Datei in dem mit FileType festgelegten Format.Wenn als FileType das LBI- oder BMP-Format verw endet w ird, geben Sie die Auflösung mit dpian.

4.2.5. GetSheetSize ()

VARIANT GetSheetSize(short vt)[Parameter] vt VARIANT-Format für die Größeninformation; normalerw eise ist VT_BSTR

(8) gesetzt.

[Zurückgegebener Wert]Gibt die Größeninformation im VARIANT-Format zurück. Für Größe 1850 ist “1850” alsVT_BSTR-Format gesetzt.

[Beschreibung]Ruft die Papiergröße/Etikettengröße der aktuellen Layoutdatei im VARIANT-Format ab.

4.2.6. GetTextCount ()

long GetTextCount()[Zurückgegebener Wert]Anzahl der Zeilen der aktuellen Layoutdatei, in die Text eingegeben w erden kann.

[Beschreibung]Ruft die Anzahl der Zeilen der aktuellen Layoutdatei, in die Text eingegeben w erden kann, ab.

4.2.7. GetTextIndex ()

long GetTextIndex (BSTR szFieldName)[Parameter]szFieldName Feldname (Vorlagentext) für den Text, dessen Index abgerufen w erden soll

[Zurückgegebener Wert]-1: Keine entsprechenden Textzeilen; 0, etc.: Index des Textes entsprechend dem Feldnamen

[Beschreibung]Ruft den Index für Text mit dem angegebenen Feldnamen (Vorlagentext) ab. Durch Angabe einesFeldnamens in der Vorlage, kann der Text leicht eingegeben w erden.Wenn mehrere Textzeilen mit demselben Feldnamen (Vorlagentext) in derselben Vorlagedateivorhanden sind, w ird der Index der ersten Zeile zurückgegeben.Weitere Informationen über Regeln zur Nummerierung von Indizes f inden Sie in Abschnitt "3.2.2Text objects".

Page 67: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

68

4.2.8. GetText ()

boolean GetText(long nIndex, BSTR* IpszText)[Parameter]nIndex Index (beginnend mit 0) der Textzeile, die abgerufen w erden sollIpszText Zeiger auf den Puffer, in dem der Text abgelegt w erden soll

[Zurückgegebener Wert]“0” w ird zurückgegeben, w enn der Abruf des Textes in der angegebenen Zeile fehlgeschlagenist, ein anderer Wert als “0” w ird zurückgegeben, w enn der Text erfolgreich abgerufen w erdenkonnte.

[Beschreibung]Ruft den Text in der angegebenen Zeile ab.

4.2.9. GetFontInfo ()boolean GetFontInfo(long nIndex, BSTR* IpszFontInfo)[Parameter] nIndex Index (beginnend mit 0) der Textzeile, deren Schriftinformationen abgerufen

w erden sollen. IpszFontInfo Zeiger auf den Text mit den Schriftinformationen, die abgerufen w erden

sollen. Weitere Informationen f inden Sie unter [Beschreibung].

[Zurückgegebener Wert]“0” w ird zurückgegeben, w enn der Abruf der Schriftinformationen für die angegebene Zeilefehlgeschlagen ist, ein anderer Wert als “0” w ird zurückgegeben, w enn die Informationenerfolgreich abgerufen w erden konnten.

[Beschreibung]Ruft die Schriftinformationen für die angegebene Zeile ab. Die in lpszFontInfo ausgegebenenInformationen sind durch “,” (Komma) voneinander getrennt. Die einzelnen Token haben die untenbeschriebene Bedeutung:

Index Name Wert0 Schriftname Name of font1 Ausrichtung 0: Horizontal 1: Vertikaldruck (ungültig mit

SetFontInfo())2 Fettdruck 0: Normal; 1: Fett3 Kursiv 0: Normal; 1: Kursiv4 Unterstreichen 0: Aus; 1: Ein5 Ausstreichen 0: Aus; 1: Ein6 Maximale

Punktgröße1~: Maximale Punktgröße (in 0,1-Punkt-Schritten)

7 Druckstil/Effekte

0: Normal;1: leicht schattiert; 2: schattiert3: Horizontal; 4: Umriss5: Konturen; 6: Umrahmt

Page 68: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

69

Beispiel: “Arial, 0, 1, 1, 0, 0,120,0” steht für die Schrift Arial, horizontale Ausrichtung, Fettdruck,Kursivschrift, maximal 12 Punkt ohne besonderen Druckstil/Effekte.

Page 69: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

70

4.2.10. SetText ()boolean SetText(long nIndex, BSTR szText)[Parameter] nIndex Index (beginnend mit 0) der Textzeile, deren Text festgelegt w erden soll. szText Text, der festgelegt w erden soll.

[Zurückgegebener Wert]“0” w ird zurückgegeben, w enn die Aktualisierung des Textes für die angegebene Zeilefehlgeschlagen ist, ein anderer Wert als “0” w ird zurückgegeben, w enn der Text erfolgreichaktualisiert w urde.

[Beschreibung]Aktualisiert den Text der angegebenen Zeile.

4.2.11. SetFontInfo ()boolean SetFontInfo(long nIndex, BSTR szFontInfo)[Parameter] nIndex Index (beginnend mit 0) der Textzeile, deren Schriftinformationen aktualisiert

w erden sollen. szFontInfo Schriftinformationen, die gesetzt w erden sollen (siehe dazu “GetFontInfo

()”).

[Zurückgegebener Wert]“0” w ird zurückgegeben, w enn die Aktualisierung der Schriftinformationen für die angegebeneZeile fehlgeschlagen ist, ein anderer Wert als “0” w ird zurückgegeben, w enn dieSchriftmerkmale erfolgreich aktualisiert w erden konnten.

[Beschreibung]Aktualisiert die Schriftmerkmale der angegebenen Zeile. Eine Beschreibung der Parameter für dieSchriftinformationen f inden Sie unter “GetFontInfo ()”. Wenn dieser Parameter nicht angegebenw ird (oder auf “-1” gesetzt w ird), w erden die aktuellen Schriftinformationen übernommen.

Page 70: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

71

4.2.12. SetBarcodeData ()boolean SetBarcodeData(long nIndex, BSTR szData)[Parameter] nIndex Index (beginnend mit 0) für die Barcode-Daten, die aktualisiert w erden sollen.szData Text für die Aktualisierung der Barcode-Daten.

[Zurückgegebener Wert]“0” w ird zurückgegeben, w enn die Aktualisierung des Barcodes fehlgeschlagen ist, ein andererWert als “0” w ird zurückgegeben, w enn sie erfolgreich w ar.

[Beschreibung]Aktualisiert die Barcode-Daten für den angegebenen Barcode fest.

4.2.13. ReplaceImageFile()boolean ReplaceImageFile(long nIndex, BSTR szFilePath, long dwFlag)[Parameter] nIndex Index (beginnend mit 0) für das Grafikobjekt, das aktualisiert w erden soll. szFilePath Pfad zur Grafikdatei, die das Grafikobjekt ersetzen soll. dwFlag Attribut zum Ersetzen von Bildern (Geben Sie “0” an.)

[Zurückgegebener Wert]“0” w ird zurückgegeben, w enn das Ersetzen des Bildes fehlgeschlagen ist, ein anderer Wert als“0” w ird zurückgegeben, w enn das Bild erfolgreich ersetzt w erden konnte.

[Beschreibung]Ersetzt die angegebenen Grafikobjekte mit der Grafikdatei, die durch lpszFilePath festgelegtw urde. Die folgenden Grafikdateitypen können mit lpszFilePath angegeben w erden: BMP odernicht komprimierte TIFF, WMF, EMF, ICO oder JPEG.

Page 71: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

72

4.2.14. DoPrint()void DoPrint(long dwOption, BSTR szOption)[Parameter] dwOption Druckoptionen; 0: Übernimmt die Einstellungen des aktuellen Treibers; Andere:

siehe “Beschreibung”. szOption Druckparameter: Geben Sie die Druckparameter als Zeichenkette ein, w obei

die einzelnen Parameter durch “,” (Komma) getrennt w erden müssen (siehe“Beschreibung”).

[Beschreibung]Druckt die aktuelle Layoutdatei.DoPrint() kann nur zum Drucken mit einem Brother P-touch/Mobile Printer (MW-Serie)/Stampcreator-Gerät benutzt w erden. Die Verw endung für andere Drucker ist nichtmöglich.

� Druckoption: dw Option

Wenn die im Treiber gesetzten Einstellungen nicht übernommen und statt dessen dieDruckoptionen mit DoPrint festgelegt w erden sollen, geben Sie die Einstellungen durch dieKombination der folgenden Attribute in dwOption an. Wenn die im Treiber gesetzten Einstellungenübernommen w erden sollen, setzen Sie dwOption auf “0”.

Treiber Attribute Beschreibung

bpoAutoCut (0x1) Schneidet das Band automatisch ab.*Nur gültig für Modelle mit Autoschnitt-Funktion.

BpoCutPause (0x2)Bew irkt eine Pause zum Abschneiden desBandes oder druckt Schnittmarkierungen.Nur für Modelle ohne Autoschnitt-Funktion.

bpoHalfCut (0x200) Halbschnitt, schneidet das Band jedoch nicht dieSchutzfolie.*

BpoChainPrint(0x400) Fortlaufender DruckbpoNoCut (0x10000000) Das Band w ird nicht abgeschnitten.bpoMirroring (0x4) Druckt spiegelbildlich.*bpoColor (0x8) Druckt in Farbe.*bpoMono (0x10000000) Druckt monochrom.

Label printer(P-touch)

bpoContinue(0x40000000)

Verbindet den Ausdruck mit dem nachfolgendenDoPrint()-Befehl zu einem Druckauftrag.Dadurch erfolgt am Anfang des folgendenAusdrucks kein Bandvorlauf. Lesen Sie dazu "Hinweise zur Verwendung vonbpoContinue " weiter unten.

Mobile Printer(MW-Serie) bpoContinue(0x40000000)

Verbindet den Ausdruck mit dem folgendenDoPrint()-Befehl zu einem Druckauftrag.Dadurch können mehrere Etiketten auf ein Blattgedruckt w erden. Lesen Sie dazu "Hinweise zur Verwendung vonbpoContinue " weiter unten.

Page 72: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

73

bpoStamp (0x80) Erstellt einen Stempel. Wenn auf “OFF” gesetzt,w ird ein Stempeletikett gedruckt.

Stamp(Stampcreator) bpoIdLabel (0x10000000) Druckt das Stempeletikett.*Hinw eise: Nur gültig für Modelle, die die entsprechende Funktion unterstützen. Auch

w enn das Attribut gesetzt ist, ist die Einstellung für Modelle, w elche die Funktionnicht unterstützen, ungültig.

Page 73: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

74

� Druckparameter: dw Option

Geben Sie die Druckparameter in lpszOption als Text an. Trennen Sie die Token durch “,”(Komma) voneinander. Die einzelnen Token haben die folgende Bedeutung:

Index Name Beschreibung0 Name der zu

druckendenLayoutdatei

Geben Sie den Dateinamen an. Er w ird im Druckerangezeigt.Wenn nicht festgelegt oder auf “0” gesetzt, w ird “b-PAC” angezeigt.

1 Kopienanzahl Geben Sie die Anzahl der Kopien an. Wenn nichtangegeben, ist die Kopienanzahl normalerw eise “1”.Beim Erstellen von Stempeln ist die Kopienanzahl-Einstellung ungültig.

Beispiel: “MyDoc, 2” bedeuted, dass “MyDoc” im Display angezeigt w ird und 2 Kopien gedrucktw erden.

[Hinweise zur Verwendung v on bpoContinue]� Bei jedem normalen Aufruf von DoPrint w ird ein Druckauftrag erstellt. Wenn jedoch das

Attribut bpoContinue angegeben w ird, w ird das Ende des Druckauftrag hinter den nächstenDoPrint-Befehl verschoben. Enthält auch dieser das bpoContinue-Attribut, verschiebt sichdas Ende w iederum.

� Wenn das bpoContinue-Attribut gesetzt ist, sind außer der Kopienanzahl alle anderenangegebene Druckoptionen (dw Option) und Druckparameter (szOption) nur für den erstenDoPrint-Ausdruck gültig und w erden für alle folgenden DoPrint-Befehle bis zum Ende desDruckauftrages ignoriert.

� Wenn das bpoContinue-Attribut einmal in einem DoPrint-Befehl gesetzt w urde, kann derDruckauftrag auf eine der folgenden Weisen beendet w erden (= mit dem Ausdruckbegonnen w erden):a). Durch Aufrufen eines DoPrint-Befehls ohne bpoContinue-Attributb). Aufrufen von Open oder Closec). Freigeben des b-PAC-Objekts

� Nach Setzen eines bpoContinue-Attributs und Aufrufen der DoPrint-Funktion w ird nicht zurnormalen Bereitschaft zurückgekehrt (z. B. zum Warten auf Endbenutzer-Eingabe, w ieFunktionsausw ahl oder Dateneingabe), bis der Druckauftrag durch eine der oben genanntenMethoden (a, b, c) abgeschlossen w urde (d. h. der Ausdruck beginnt).

� Wie oft die DoPrint-Funktion mit bpoContinue-Attribut aufgerufen w erden kann (Anzahl derSeiten/Etiketten, die w ährend eines Druckauftrages gedruckt w erden kann), hängt von dermaximal möglichen Kopienanzahl des Druckers bzw . von den Computerressourcen ab.

Page 74: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

75

[Beispiel zur Verwendung v on DoPrint mit Visual Basic®]

� Druckt eine Kopie mit der Druckoptionen-Einstellung des aktuellen Treibers

...ObjDoc.DoPrint 0, "0"

� Druckt eine Kopie ohne Abschneiden des Etiketts

ObjDoc.DoPrint bpoNoCut, "0" orObjDoc.DoPrint &H10000000, "0"

� Druckt 3 Kopien mit der Druckoptionen-Einstellung des aktuellen Treibers

...ObjDoc.DoPrint 0, "b-PAC Sample,3"

� Beispiel zum kontinuierlichen Drucken mehrerer Etiketten mit dem bpoContinue-Attribut

'Druckt 5 Etiketten hintereinander als einen Druckauftrag (PT-9200DX/PT-9200PC)...iTotal = 5nIndex = ObjDoc.GetTextIndex("Name")For iCount = 1 To iTotal

strCount = "Count = " + CStr(iCount)ObjDoc.SetText nIndex, strCountIf iCount < iTotal Then

'Setzt den Ausdruck mit der Halbschnitt-Funktion fortObjDoc.DoPrint &H40000200, "test,1"

Else'Letzter Ausdruck (Ende des Druckauftrages)ObjDoc.DoPrint 0, "0"

End IfNext

Page 75: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

76

5. BeispielprogrammeBei den Beispielprojekten w ird davon ausgegangen, dass die Vorlagen im Ordner C:\Programme\Brother bPAC SDK\Templates gespeichert sind. Falls Brother b-PAC SDK in einen anderen Ordnerkopiert wurde, lesen Sie bitte die Hinweise unter Installation. Diese Einschränkung gilt nur für dieBeispielprojekte, nicht für die b-PAC-Komponente.

5.1. Visual Basic® (VB-Ordner)

Beschreibung

Anw endung zum Erstellen von NamensschildernGeben Sie Namen und Firma für das Namensschild ein.Wählen Sie eine der beiden folgenden Vorlagen: Einfachoder mit Rahmen.

Verw endeteFunktionen Open(), GetTextIndex(), SetText(), DoPrint()

NamePlt

Entw icklungs-umgebung Microsoft® Visual Basic® Version 6.0 SP4

Im Folgenden w erden die im Beispiel NamePlt benutzten b-PAC-Funktionen gezeigt:

Public Sub DoPrint(strPath As String, strExport As String)

‘ Erstellt das b-PAC-Objekt Dim ObjDoc As BrssCom.Document Set ObjDoc = CreateObject("BrssCom.Document")

‘ Öffnet die Vorlage If (ObjDoc.Open(strPath) <> False) Then

‘ Sucht nach Text für die Feldnamen und ersetzt den Text Dim nIndex As Integer nIndex = ObjDoc.GetTextIndex("Company") ObjDoc.SetText nIndex, edPosition.Text nIndex = ObjDoc.GetTextIndex("Name") ObjDoc.SetText nIndex, edName.Text

‘ Drucken bzw . exportieren If (strExport = "") Then ObjDoc.DoPrint 0, "0" ' Print Else ObjDoc.Export 2, strExport, 180 ' Export End If End If Set ObjDoc = NothingEnd Sub

Page 76: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

77

5.2. Visual C++® (VC-Ordner)

Beschreibung

Anw endung zum Erstellen von NamensschildernGeben Sie Namen und Abteilung für das Namensschildein. Wählen Sie eine der beiden folgenden Vorlagen:Einfach oder mit Rahmen.Visual C++ Version des Visual Basic®-Beispiels NamePlt

Verw endeteFunktionen Open(), GetTextIndex(), SetText(), DoPrint()

NamePlt

Entw icklungs-umgebung Microsoft® Visual C++® Version 6.0 SP4

5.3. Visual Basic® für Anwendungen (VBA-Ordner)

Beschreibung

Microsoft® Excel Anw endung zum Erstellen vonVersandetiketten.Unter Verw endung einer interaktiven Schnittstelle w irdein Versandetikett aus in die Zellen eingegebenem Texterstellt. Außerdem kann die Schriftart des Textesgeändert w erden.

Verw endeteFunktionen

Open(), SetText(), DoPrint(), GetTextCount(), Save(),Close()

ShipForm.xls

Entw icklungs-umgebung Microsoft® Excel 97 oder 2000

Beschreibung Microsoft® Access Anw endung zum Erstellen vonNamensschildern.Verw endet Datensätze der Datenbank und druckt einNamensschild.

Verw endeteFunktionen Open(), GetTextIndex(), SetText(), DoPrint()

NamePlt.mdb

Entw icklungs-umgebung

Microsoft® Access 97Mit Access 2000 können Dateien konvertiert w erden.

Beschreibung Microsoft® Access Anw endung zum Erstellen vonPreisetikettenVerw endet Datensätze der Datenbank und druckt einPreisetikett mit Barcode-Daten.

Verw endeteFunktionen

Open(), GetTextIndex(), SetText(), DoPrint(),SetBarcodeData()

ShopLbl.mdb

Entw icklungs-umgebung

Microsoft® Access 97Mit Access 2000 können Dateien konvertiert w erden.

Page 77: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

78

5.4. VB Script (für Windows Scripting Host) (VBS-Ordner)

Beschreibung Script zum Erstellen von NamensschildernScript Druckversion des Visual Basic® Beispiels NamePlt

Verw endeteFunktionen Open(), SetText(), DoPrint()NamePrn.vbs

Entw icklungs-umgebung Microsoft® Window s® Script Host Version 1.0

5.5. VB Script (für Internet Explorer) (VBS folder)

Zur Verw endung der folgenden Beispiele ist der Internet Explorer 4.0 oder eine neuere Versionnotw endig.

Beschreibung

HTML-Seite zum Erstellen von NamensschildernGeben Sie Namen und Abteilung für das Namensschildein. Wählen Sie eine der beiden folgenden Vorlagen:Einfach oder mit Rahmen.HTML-Version des Visual Basic® Beispiels NamePlt

VBS_NamePlate.html

Verw endeteFunktionen Open(), GetTextIndex(), SetText(), Export(), DoPrint()

Beschreibung

HTML-Seite zum Erstellen von Etiketten, die BilderenthaltenGeben Sie das Bild an und geben Sie den Namen für dasEtikett ein.Optionale Bitmap-Dateien können als Grafik gew ähltw erden.

VBS_ChangeImage.html

Verw endeteFunktionen Open(), SetText(), Export(), DoPrint(), ReplaceImageFile()

Beschreibung

HTML-Seite für den Zugriff auf eine Datenbank und zumDrucken von Etiketten mit Barcode und Name für denangegebenen EintragErstellen Sie zuerst eine Microsoft® Access MDB-Dateientsprechend der Einträge und Barcode-Daten. GreifenSie über ADO auf die Datenbank zu w ährend Sie auf diePrint- bzw . Preview -Schaltf läche klicken, um dieBarcode-Daten entsprechend dem Eintrag abzurufen.Nachdem die Komponente die Ersetzung durch denaktuellen Barcode durchgeführt hat, starten Sie denAusdruck.

VBS_DB_Bcd.html

Verw endeteFunktionen Open(), SetText(), Export(), DoPrint(), SetBarcodeData()

Page 78: Brother P-touch Applicable Component (b-PAC) SDK ... SDK.pdf · b-PAC SDK Specifications Create 8/2/01 B.I,L. U pdate 11/13/02 B .I,L. 2 ... \Program Files\Brother bPAC SDK\Templates

b-PAC SDK Specifications Create 8/2/01 B.I,L. Update 11/13/02 B.I,L.

79

Hinw eis

Um über ADO auf die Datenbank zugreifen zu können,muss die MDAC-Komponente (mdac_typ.exe) von derfolgenden Seite heruntergeladen w erden:http://w w w .microsoft.com/data/dow nload.htm(Diese Komponente ist unter Window s® 2000/XP undMillennium Edition bereits installiert.)

5.6. Konsolenanwendung (Eingabeaufforderung) (Console-Ordner)

Beschreibung

Eine Beispielanw endung, mit der die b-PAC-Komponentevon der Konsole (Eingabeaufforderung) aus verw endetund Barcodes ausgegeben w erden. Eine Erklärung desProgrammes finden Sie unten.

Verw endeteFunktionen Open(), SetText(), SetBarcodeData(), DoPrint()

ConsoleLabel

Entw icklungs-umgebung

Microsoft® Visual C++® Version 6.0 SP4Microsoft® Window s® Script Host Version 1.0

Beschreibung

ConsoleLabel.c

Quelle des mit C erstellten Konsolenprogramms.Die VB Script-Engine w script w ird von der Funktion system() der C-Laufzeitbibliothekaufgerufen. Der Script-Dateiname (BcdLabel.vbs) und die beiden zur Script-Dateiübertragenen Parameter w erden als Parameter von w script angegeben. Vereinfacht kann diesw ie folgt dargestellt w erden:

system("w script script-file-name parameter1 parameter2");

BcdLabel.vbs

Die b-PAC-Komponente w ird über ConsoleLabel.c durch die VB Script-Datei aufgerufen undder Barcode w ird gedruckt.Die Script-Datei verw endet zw ei Parameter. Der erste Parameter w ird als Elementname, derzw eite Parameter als Code für das Element verw endet, das als Barcode gedruckt w erden soll.