Cody Matthew
Cody Matthew

Reputation: 11

Brother bPAC3 SDK Powershell

I have downloaded and installed the 3.4.012 32-bit and 64-bit version of Full b-PAC SDK for Developers.

I created the following PowerShell script to print a premade label.

[void][System.Reflection.Assembly]::LoadFile('C:\Program Files\Brother bPAC3 SDK\Samples\VBNET\NamePlt\bin\Interop.bpac.DLL')
$Printers = New-Object bpac.PrinterClass
$Label = New-Object bpac.DocumentClass
$Filename = 'C:\Users\cbecker\Desktop\Evidence Sticker.lbx'
If ($Label.Open($Filename)) {
    try {
        $Label.SetPrinter($Printers.GetInstalledPrinters()[0], 0)
        $Label.StartPrint('',0)
        $Label.PrintOut(1, 0)
        $Label.Close()
        $Label.EndPrint()
    } catch {
        Write-Output 'Failed'
        Write-Output $Label.ErrorCode
    }
} Else {
    Write-Output 'Failed to open label file'
}

the output is

true
true
false
true
true

it is supposedly failing at the $Label.PrintOut(1, 0) line.

Does anyone have any guidance on why it is failing?

I've checked the printer preference to match with the label.

Upvotes: 0

Views: 98

Answers (0)

Related Questions