我有Brother QL-700标签打印机,我已经安装了上个月底发布的最新B-PAC SDK V3.2.001 64位。我也在我的Windows 10 64位计算机上安装了“B-PAC客户端组件”。给定模板文件(addr.LBX)从P-touch Editor 5.2成功打印。
但是B-Pac sdk会从C#程序下面打印出来。执行给定的代码片段时,它会给出以下错误
'NamePlt.vshost.exe' (CLR v2.0.50727: NamePlt.vshost.exe): Loaded 'C:\Program Files\Brother bPAC3 SDK\Samples\VCS\NamePlt\bin\Debug\Interop.bpac.dll'. Module was built without symbols.Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
任何支持都非常感谢!
private const string TEMPLATE_DIRECTORY = @"C:\Program Files\Brother bPAC3 SDK\Templates\"; // Template file path
private const string TEMPLATE_FILE = "addr.LBX"; // Template file printing fine from the P-touch Editor
public Form1()
{
InitializeComponent();
}
private void btnPrint_Click(object sender, EventArgs e)
{
string templatePath = TEMPLATE_DIRECTORY;
templatePath += TEMPLATE_FILE;
bpac.DocumentClass doc = new DocumentClass();
if (doc.Open(templatePath) != false)
{
//doc.GetObject("objCompany").Text = txtCompany.Text;
//doc.GetObject("objName").Text = txtName.Text;
// doc.SetMediaById(doc.Printer.GetMediaId(), true);
doc.StartPrint("", PrintOptionConstants.bpoDefault);
doc.PrintOut(1, PrintOptionConstants.bpoDefault);
doc.EndPrint();
doc.Close();
MessageBox.Show("Error code : " + doc.ErrorCode);
}
else
{
MessageBox.Show("Open() Error: " + doc.ErrorCode);
}
}