SATO PV3 User manual

Xamarin SDK
PV3/PV4
BARCODE PRINTER
Ver. 1.01

Ver. 1.01
- 2 -
Xamarin SDK
Table of Contents
1. Manual Guide .......................................................................................................................4
2. Supported Devices ..............................................................................................................4
3. Xamarin SDK Installation ....................................................................................................5
3-1 Supported Platforms.........................................................................................................5
3-1-1 iOS.........................................................................................................................5
3-1-2 Android...................................................................................................................5
3-1-3 Windows ................................................................................................................5
3-2 Supported Communications..............................................................................................6
3-2-1 Bluetooth................................................................................................................6
3-2-2 Wi-Fi.......................................................................................................................6
3-3 Installation Instruction.......................................................................................................7
3-3-1 Installation steps from a local nupkg file.................................................................7
4. ISPVPrinterDeviceFactory Reference ..............................................................................10
4-1 Overview.........................................................................................................................10
4-2 Methods..........................................................................................................................10
4-2-1 createDevice........................................................................................................10
5. IPrinterDevice Reference ..................................................................................................11
5-1 Overview.........................................................................................................................11
5-2 Properties .......................................................................................................................11
5-2-1 IsOpen .................................................................................................................11
5-2-2 InterfaceType.......................................................................................................11
5-3 Methods..........................................................................................................................11
5-3-1 selectInterface......................................................................................................11
5-3-2 openService.........................................................................................................12
5-3-3 closeService.........................................................................................................12
5-3-4 setTransaction .....................................................................................................12
6. IPrinterLookup Reference.................................................................................................13
6-1 Overview.........................................................................................................................13
6-2 Methods..........................................................................................................................13
6-2-1 refreshDevicesList ...............................................................................................13
6-2-2 getDevicesList......................................................................................................14
7. ILabelPrinterDevice Reference.........................................................................................15
7-1 Overview.........................................................................................................................15
7-2 Methods..........................................................................................................................15
7-2-1 setTextEncoding..................................................................................................15
7-2-2 setCharacterset....................................................................................................16
7-2-3 setLength.............................................................................................................17
7-2-4 setSpeed..............................................................................................................17
7-2-5 setWidth...............................................................................................................18
7-2-6 setDensity............................................................................................................18
7-2-7 setMargin.............................................................................................................18
7-2-8 setOffset...............................................................................................................18
7-2-9 setOrientation.......................................................................................................19
7-2-10 setCuttingPosition..............................................................................................19

Ver. 1.01
- 3 -
Xamarin SDK
7-2-11 checkPrinterStatus.............................................................................................19
7-2-12 getModelName...................................................................................................20
7-2-13 getFirmwareVersion...........................................................................................20
7-2-14 printBuffer ..........................................................................................................20
7-2-15 printRawData.....................................................................................................21
7-2-16 drawTextDeviceFont..........................................................................................21
7-2-17 drawTextVectorFont...........................................................................................23
7-2-18 drawBarcode1D.................................................................................................24
7-2-19 drawBarcodeMaxiCode......................................................................................25
7-2-20 drawBarcodePDF417.........................................................................................26
7-2-21 drawBarcodeQRCode........................................................................................27
7-2-22 drawBarcodeDataMatrix.....................................................................................28
7-2-23 drawBarcodeAztec.............................................................................................29
7-2-24 drawBarcodeCode49 .........................................................................................30
7-2-25 drawBarcodeCodaBlock.....................................................................................31
7-2-26 drawBarcodeMicroPDF......................................................................................32
7-2-27 drawBarcodeIMB ...............................................................................................32
7-2-28 drawBarcodeMSI................................................................................................33
7-2-29 drawBarcodePlessey .........................................................................................34
7-2-30 drawBarcodeTLC39...........................................................................................35
7-2-31 drawBarcodeRSS...............................................................................................36
7-2-32 drawBlock ..........................................................................................................37
7-2-33 drawCircle..........................................................................................................38
7-2-34 drawImage.........................................................................................................39
7-2-35 drawImageFile ...................................................................................................40
8. Appendix ............................................................................................................................40
8-1 Error Code Table............................................................................................................40

Ver. 1.01
- 4 -
Xamarin SDK
1. Manual Guide
This SDK manual provides descriptions of contents necessary for developing Xamarin.Forms
(Portable Class Library, NET Standard) applications. Xamarin library and Demo application
were built using Visual Studio 2015 on Windows, and all the contents in this manual are
explained based on Visual Studio 2015 on Windows.
2.
Supported Devices
The below table summarizes the supported devices (printers) that are available in this
Xamarin SDK.
Printer Name
DPI
Supported Communication
Max Printable Width
PV3 203 dpi Bluetooth, Wi-Fi 576 dots
PV4 203 dpi Bluetooth, Wi-Fi 832 dots

Ver. 1.01
- 5 -
Xamarin SDK
3. Xamarin SDK Installation
3-1 Supported Platforms
3-1-1 iOS
iOS 9.0 or later
Note
In your Xamarin project for iOS, set Deployment Target version to 9.0.
3-1-2 Android
Android 4.0.3(API Level 15: ice cream sandwich) or later
Note
In your Xamarin project for android, set minimum android version to API
Level 15.
You should leave the target Android version set to Use Compile using SDK
version (as shown) so that its value automatically matches the target
framework setting. In general, the Target Android Version should be
bounded by the Minimum Android Version and the Target Framework.
That is: Minimum Android Version < Target Android Version < Target
Framework.
3-1-3 Windows
Windows 10 version Build 14393 or later.
Note
In your Xamarin project for Universal Windows, set minimum version to
Winddows 10 (10.0 Build 14393) as below.

Ver. 1.01
- 6 -
Xamarin SDK
3-2 Supported Communications
3-2-1 Bluetooth
HOST must be paired with Bluetooth device for Bluetooth communication in advance. Make
sure to include necessary permissions (or capabilities) to each platform before using APIs in
this manual. Please refer to the table following for permission settings.
3-2-2 Wi-Fi
HOST and device (printer) can only communicate over TCP / IP on the same wired / wireless
network. Make sure to include necessary permissions (or capabilities) to each platform before
using APIs in this manual. Please refer to “3-3” in this manual for permission settings.
Platform
Required permission / capabilities
iOS
1. Update the Info.plist file by opening it in XML editor or text editor. Add the
following to the file. This is to allow your app to access the Bluetooth port.
<key>UISupportedExternalAccessoryProtocols</key>
<array><string>com.sato.protocol</string></array>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Communication with the printer</string>
2. Put a checkmark on “External Accessory communication” checkbox as a
below.
Android
Make sure to include following capabilities in the AndroidManifest.xml file.
- BLUETOOTH, BLUETOOTH_ADMIN, BLUETOOTH_PRIVILEGED
- ACCESS_WI-FI_STATE, CHANGE_WI-FI_STATE
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />
<uses-permission android:name="android.permission. ACCESS_WI-FI_STATE " />
<uses-permission android:name="android.permission. CHANGE_WI-FI_STATE " />
</manifest>
Windows
Make sure to include following capabilities in the “Package.appxmanifest” file.
- Bluetooth, Internet (Client), Private Networks (Client & Server)

Ver. 1.01
- 7 -
Xamarin SDK
Note
When using Bluetooth and Wi-Fi, there are a few things to modify your project’s
settings and configuration information related to permissions for each platform.
Demo application provided helps you modifying the necessary settings of your
own Xamarin application.
3-3 Installation Instruction
• Xamarin SDK can be installed as a NuGet package into MS Visual Studio.
When you use NuGet to install a package, it copies the library files to your solution and
automatically updates your project (add references, change config files, etc). If you remove
a package,NuGet reverses whatever changes it maded. If you need more information
about NuGet, visit at https://www.nuget.org/
3-3-1 Installation steps from a local nupkg file
1) Open Visual Studio, and open your own Xamarin.Forms solution.
2) From the Solution Explorer, right click the top level solution.
3) Click “Manage NuGet Packages for Solution…”

Ver. 1.01
- 8 -
Xamarin SDK
4) On the top of the right side, click “Setting” button in red.
5) Click “Package Sources”, and then click “+” button.
6) Browse to the directory where “Xam.Plugin.SatoMpXamarinSDK.x.x.x.nupkg” file exists,
and then enter any name you want.
Note “x.x.x” is the version number for the SDK.
7) Click “Update”

Ver. 1.01
- 9 -
Xamarin SDK
8) Click “OK”.
9) “Xam.Plugin.SatoMpXamarinSDK” package can be found when you select the name you
entered in step 6 in the “Package source” list.
10) Click “Project” checkbox to install the entire package.
11) Click “Install” to start installing all the appropriate references to the libraries for each
platform project.

Ver. 1.01
- 10 -
Xamarin SDK
4. ISPVPrinterDeviceFactory
Reference
4-1 Overview
• "ISPVPrinterDeviceFactory" interface can be used to create an instance implementing
"IPrinterDevice" interface for communication with a specific device. All instances
for device (printer) control are created using the "createDevice" method.
4-2 Methods
Note
Use the “current” property in “SPVPrinterDeviceFactory” class to call the
methods defined in this interface.
eg) SPVPrinterDeviceFactory.Current.createDevice(10)
4-2-1 createDevice
Gets an instance for communication with a specific device.
[Syntax]
IPrinterDevice createDevice(DeviceType deviceType);
[Parameters]
Device deviceType: A value of the device type to create.
DeviceType Enumeration
Value
Description
LABEL_PRINTER
1
Label Prniter
[Returns]
A reference to the instance implementing “IPrinterDevice” interface specified or null.

Ver. 1.01
- 11 -
Xamarin SDK
5. IPrinterDevice Reference
5-1 Overview
• “IPrinterDevice” interface provides common member methods with regards to the
device, and the properties and methods can be used in all the classes implementing this
interface.
5-2 Properties
5-2-1 IsOpen
The device in the usable status or not.
5-2-2 InterfaceType
Communication Interfacetype (Bluetooth, Wi-Fi).
5-3 Methods
5-3-1 selectInterface
Sets the communication interface type and address of the device(printer) to connect.
Note
This method must be used before calling the “openService” method.
[Syntax]
int selectInterface(int interfaceType, string address);
[Parameters]
• int interface type: communication type to connect the device.
InterfaceType Enumeration
Value
Description
WI-FI
1
Wi-Fi.
BLUETOOTH
4
Bluetooth.
• string address:
In case of TCP (Wi-Fi) communication, it should be used in the form of "IP address [: port
number]". Port number is 9100 by default and can be omitted. In case of Bluetooth
communication, it should be entered as the value described in the table below according to
platform.
Platform
Address value
iOS
Bluetooth Serial Number
Android
Bluetooth MAC Address
Windows
Bluetooth MAC Address
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.

Ver. 1.01
- 12 -
Xamarin SDK
5-3-2 openService
Establishes a communication connection with the device.
[Syntax]
Task<int> openService(uint timeout = 3 );
[Parameters]
uint timeout: Timeout value for connecting a device.
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
5-3-3 closeService
Disconnects the communication with the device.
[Syntax]
Task<int> closeService (int closeTimeout = 0);
[Parameters]
int closeTimeout: Timeout value for disconnecting a device.
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
5-3-4 setTransaction
Enters or Leaves 'Transaction' mode, and then sends the data in the buffer.
Note
It is recommended to use the Transaction mode when using output devices such
as printers.
[Syntax]
Task<int> setTransaction(int mode);
[Parameters]
int mode: Configure the transaction mode
TransactionMode Enumeration
Value
Description
TRANSACTION_OUT
0
Cancel transaction mode after data transmission
TRANSACTION_IN
1
Enter transaction mode
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.

Ver. 1.01
- 13 -
Xamarin SDK
6. IPrinterLookup
Reference
6-1 Overview
• The "IPrinterLookup" interface provides useful methods for searching and retrieving the
information needed to connect devices (printers).
6-2 Methods
Note
Use the “current” property in “SPVPrinterLookupUtil” class to call the methods
defined in this interface.
eg) SPVPrinterLookupUtil.Current.refreshDevicesList()
eg) SPVPrinterLookupUtil.Current.getDeviceList()
6-2-1 refreshDevicesList
Starts discovering devices available to connect with HOST.
[Syntax]
Task<int> refreshDevicesList (int interfaceType)
[Parameters]
int interface type: communication type searching for devices.
InterfaceType Enumeration
Value
Description
WI-FI
1
Wi-Fi (wireless LAN)
BLUETOOTH
4
Bluetooth
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.

Ver. 1.01
- 14 -
Xamarin SDK
6-2-2 getDevicesList
Gets the data collctions containing the connection information discovered by
“refreshDeviceList” method.
[Parameters]
int interface type: communication type for getting device list
InterfaceType Enumeration
Value
Description
WI-FI
1
Wi-Fi (wireless LAN)
BLUETOOTH
4
Bluetooth
[Syntax]
ObservableCollection<PrinterConnectionInformation> getDevicesList (int interfaceType)
[Returns]
ObservableCollection<PrinterConnectionInformation>: data collctions containing the
connection information.
class PrinterConnectionInformation
{ public InterfaceType IntefaceType { get; set; }
public string Name { get; set; }
public string Address
public string MacAddress { get; set; }
public string IpAddress { get; set; }
public string PortNumber { get; set; }
}
Properties
• InterfaceType: The communication type supported.
• Name: The display name for the device.
• Address: The address for the device (IP Address, S/N, or MAC address)
• MACAddress: MAC address or S/N for Bluetooth device.
• IPAddress: IP address for TCP communication.
• PortNumber: Port number for TCP communication.

Ver. 1.01
- 15 -
Xamarin SDK
7. ILabelPrinterDevice Reference
7-1 Overview
• The ILabelPrinterDevice interface provides methods for controlling a Label printer.
7
7-2 Methods
7-2-1 setTextEncoding
Sets the codepage used for encoding characters.
[Syntax]
int setTextEncoding(int textEncoding);
[Parameters]
• int textEncoding: Code page to use when encoding a character string.
LabelCodePage Enumeration
Value
Description
CP437
437
USA, Standard Europe
CP850
850
Western European
CP852
852
Latin 2
CP860
860
Portuguese
CP863
863
Canadian-French
CP865
865
Nordic
WPC1252
1252
Latin 1
CP857
857
Turkish
CP737
737
Greek (PC 737)
WPC1250
1250
Central European
WPC1253
1253
Greek (ANSI 1253)
WPC1254
1254
Turkish
CP855
855
Cyrillic
CP862
862
Hebrew DOS code
CP866
866
Cyrillic #2
WPC1251
1251
Cyrillic
WPC1255
1255
Hebrew New code
CP928
928
Greek
CP775
775
Baltic
WPC1257
1257
Baltic
CP858
858
Euro
GB2312
936
Simplified Chinese
BIG5
950
Traditional Chinese
KS5601
949
Korean
SHIFTJIS
932
Japanese
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.

Ver. 1.01
- 16 -
Xamarin SDK
7-2-2 setCharacterset
Sets the codepage and international characterset used for encoding characters.
[Syntax]
Task<int> setCharacterset(int characterset, int internationalCharset);
[Parameters]
• int characterset: Code page to use when encoding a character string
LabelCodePage Enumeration
Value
Description
CP437
437
USA, Standard Europe
CP850
850
Western European
CP852
852
Latin 2
CP860
860
Portuguese
CP863
863
Canadian-French
CP865
865
Nordic
WPC1252
1252
Latin 1
CP857
857
Turkish
CP737
737
Greek (PC 737)
WPC1250
1250
Central European
WPC1253
1253
Greek (ANSI 1253)
WPC1254
1254
Turkish
CP855
855
Cyrillic
CP862
862
Hebrew DOS code
CP866
866
Cyrillic #2
WPC1251
1251
Cyrillic
WPC1255
1255
Hebrew New code
CP928
928
Greek
CP775
775
Baltic
WPC1257
1257
Baltic
CP858
858
Euro
GB2312
936
Simplified Chinese
BIG5
950
Traditional Chinese
KS5601
949
Korean
SHIFTJIS
932
Japanese
• int internationalCharset: International character set
ICS Enumeration
Value
Description
USA
0
USA Code
FRANCE
1
FRANCE Code
GERMANY
2
GERMANY Code
UK
3
UK Code
DENMARK_I
4
DENMARK1 Code
SWEDEN
5
SWEDEN Code
ITALY
6
ITALY Code
SPAIN_I
7
SPAIN1 Code
JAPAN
8
JAPAN Code
NORWAY
9
NORWAY Code
DENMARK_II
10
DENMARK 2 Code
SPAIN_II
11
SPAIN 2 Code
LATIN_AMERICA
12
LATIN AMERICA Code

Ver. 1.01
- 17 -
Xamarin SDK
KOREA
13
KOREA Code
SLOVENIA_CROATIA
14
SLOVENIA Code
CHINA
15
CHINA Code
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
7-2-3 setLength
Sets the label length, gap, media type, and offset.
[Syntax]
Task<int> setLength(int labelLength, int gapLength, char mediaType, int offsetLength)
[Parameters]
• int labelLength: Media length
• int gapLength: Gap length of the media
• char mediaType: Media type
LabelMediaType Enumeration
Value
Description
GAP
‘G’
Gap paper
CONTINUOUS
‘C’
Continuous paper
BLACK_MARK
‘B’
Black mark paper
• int offsetLength: Offset length
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
7-2-4 setSpeed
Sets the printing speed.
[Syntax]
Task<int> setSpeed(int speed)
[Parameters]
• int speed: printing speed
Printer Name
Speed (inch per ips)
Range
PV3
1 ~ 5 ips
0 ~ 4
PV4
1 ~ 5 ips
0 ~ 4
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.

Ver. 1.01
- 18 -
Xamarin SDK
7-2-5 setWidth
Sets the print width.
[Syntax]
Task<int> setWidth(int labelWidth)
[Parameters]
• int labelWidth: print width
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
7-2-6 setDensity
Sets the print density.
[Syntax]
Task<int> setDensity(int density)
[Parameters]
• int density: print density (Range of 1 to 20)
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
7-2-7 setMargin
Sets the margins in the printing area.
[Syntax]
Task<int> setMargin(int horizontalMargin, int verticalMargin)
[Parameters]
• int horizontalMargin: Left margin
• int verticalMargin: Top margin
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
7-2-8 setOffset
Sets offset length between black mark(or gap) and dotted lines.
[Syntax]
Task<int> setOffset(int offset)
[Parameters]
• int offset: offset value (Range of -100 to 100)
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.

Ver. 1.01
- 19 -
Xamarin SDK
7-2-9 setOrientation
Sets the printing orientation of the label.
[Syntax]
Task<int> setOrientation(char orientation)
[Parameters]
• char orientation: Printing orientation
LabelOrientation Enumeration
Value
Description
TOP_TO_BOTTOM
‘T’
Print from top to bottom
BOTTOM_TO_TOP
‘B’
Print from bottom to top
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
7-2-10 setCuttingPosition
Sets the cutting position or tear-off position after printing labels.
[Syntax]
Task<int> setCuttingPosition(int cuttingPosition)
[Parameters]
• int position: Cutting position value(Range of -100 to 100).
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
7-2-11 checkPrinterStatus
Gets the printer’s current status.
[Syntax]
Task<uint> checkPrinterStatus(void);
[Returns]
LabelPrinterStatus Enumeration
Value
Description
IDLE
0
Printing is possible
PAPER_EMPTY
1
No paper
COVER_OPEN
2
Cover is open
TPH_OVERHEAT
8
TPH overheating
GAP_ERROR
16
Gap Detection Error(Auto-sensing failure)
BUILDING_LABEL_TO_BE_PRINTED
64
On building label to be printed in the buffer
PRINTING_LABEL
128
On printing label in image buffer
ISSUED_LABEL_ISPAUSED
256
Issued label is paused in peeler unit
MOTOR_OVERHEAT
512
Motor overheat
BOARD_OVERHEAT
1024
Board overheat
WAIT_FOR_PAPER_TO_BE_TAKEN
2048
Wait for paper to be taken

Ver. 1.01
- 20 -
Xamarin SDK
7-2-12 getModelName
Gets the printer’s model name.
[Syntax]
Task<int> getModelName (Action<string> modelDelegate)
[Parameters]
Action<string> modelDelegate: A delegate with a parameter used for getting a model name.
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
7-2-13 getFirmwareVersion
Gets the printer’s firmware version.
[Syntax]
Task<int> getFirmwareVersion(Action<string> versionDelegate)
[Parameters]
Action<string> versionDelegate: A delegate with a parameter used for getting a firmware
version.
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
7-2-14 printBuffer
Starts printing the contents saved in the printer
[Syntax]
Task<int> printBuffer(int numberOfCopies);
[Parameters]
• int numberOfCopies: The number of copies (Range: 1 to 65535)
[Returns]
If the method succeeds, the return value is zero(0). Other cases, returns non-zero.
Other manuals for PV3
3
This manual suits for next models
1
Table of contents
Other SATO Barcode Reader manuals

SATO
SATO CL4NX Plus User manual

SATO
SATO CT408i DT User manual

SATO
SATO Argox D4 Series User manual

SATO
SATO MB400 User manual

SATO
SATO PV3 Assembly instructions

SATO
SATO ARGOX AS-9400BT User manual

SATO
SATO ARGOX AS-9400DC User manual

SATO
SATO MB200 User manual

SATO
SATO RWG500 User manual

SATO
SATO ARGOX GPIO User manual