C# Zebra打印机:System.Runtime.InteropServices.COMException(0x8004FFFF)

C# Zebra打印机:System.Runtime.InteropServices.COMException(0x8004FFFF),c#,zebra-printers,comobject,interopservices,C#,Zebra Printers,Comobject,Interopservices,我们使用以下代码打印到卡上 byte[] image; ZXPPRINTERLib.Job job = new ZXPPRINTERLib.Job(); job.JobControl.Destination = DestinationTypeEnum.Eject; using (ZMotifGraphics graphics = new ZMotifGraphics()) { graphics.InitGraphics(0, 0, ZMotifGraphics.ImageOrient

我们使用以下代码打印到卡上

byte[] image;

ZXPPRINTERLib.Job job = new ZXPPRINTERLib.Job();
job.JobControl.Destination = DestinationTypeEnum.Eject;

using (ZMotifGraphics graphics = new ZMotifGraphics())
{
    graphics.InitGraphics(0, 0, ZMotifGraphics.ImageOrientationEnum.Landscape, ZMotifGraphics.RibbonTypeEnum.MonoK);
    graphics.ColorProfile = string.Empty;
    graphics.DrawTextString(...);

    int imageSize;
    image = graphics.CreateBitmap(out imageSize);
}

int actionId;
job.BuildGraphicsLayers(SideEnum.Front, PrintTypeEnum.MonoK, GraphicTypeEnum.BMP, image);
job.PrintGraphicsLayers(1, out actionId);
它在我们的开发机器上工作,但是当我们移动到另一个测试环境时,我们会得到以下错误:

System.Runtime.InteropServices.COMException (0x8004FFFF): PrintGraphicsLayers Failed (65535) - Image processing error.
    at ZXPPRINTERLib.IJob.PrintGraphicsLayers(Int32 copies, Int32& actionID)

问题似乎是由注册
ZXPPrinter.dll
的方式引起的

正如Hans在这篇文章中指出的,在注册32位和64位版本的
dll
时,会在
ZXP3Raster.dll
下创建一个文件夹,并在
C:\ProgramData\ZXP Series卡片打印机SDK\
下创建一组文本文件

注册dll的两个版本将导致第一个版本被覆盖


此外,我的C#project的build
平台目标
被设置为build as
Any CPU
。该项目最终以64位应用程序的形式运行,同时引用了32位的
ZXPPrinter.dll

,该公司的支持论坛上有一篇关于它的文章。谈到zxp3raster.dll是错误的位,是典型的部署问题。寻找帮助的最佳地点。