首页 > 解决方案 > Dymo SDK 在运行时出了什么问题

问题描述

我对 Dymo 的 SDK 有疑问。回到基本,我做了一个终极简单的程序和标签。我仍然遇到同样的问题。如果需要,我还尝试了不同的 PC、不同的标签(甚至是带有 1 行文本的标签)等。

Imports DymoSDK.Implementations
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim dymoSDKLabel As DymoSDK.Implementations.DymoLabel
        Dim SelectedPrinter As String = "DYMO LabelWriter 450 Turbo"
        Dim copies As Integer = 1
        Dim barcodeGraphsQuality As Boolean = True
        dymoSDKLabel = New DymoLabel()
        dymoSDKLabel.LoadLabelFromFilePath("D:\sam\MotorAssembly_Verp_Individueel-70W Extra label.label")
        DymoPrinter.Instance.PrintLabel(dymoSDKLabel, SelectedPrinter, copies, barcodeGraphsQuality)
    End Sub
End Class

会发生什么:在调试过程中它运行完美,打印没有任何问题。在运行期间,它会给出以下错误(在同一台 PC 上!):错误:标签文件无效:未声明 Element DieCutLabel。

当然我检查了这个元素是否在标签文件中,它是..它是由Dymo软件制作的主要元素............。

所有 Dll 文件等都包含在安装包中..

有人知道吗?

标签: vb.netsdkdymo

解决方案


我遇到了同样的问题——结果证明我的<PaperName>XML 标签不是有效的“论文名称”。<Id>标签和<PaperName>标签也必须以某种方式匹配。

所有标签在打印之前都根据标签 XML 模式进行了验证,但是该模式似乎是一个没有文档的黑盒子,所以祝你设计好运。

我是如何解决这个问题的?我只是使用此处<PaperName>示例中的标签并使用标签手动设置标签大小。效果很好!<DrawCommands>

<?xml version="1.0" encoding="utf-8"?>
  <DieCutLabel Version="8.0" Units="twips">
    <PaperOrientation>Landscape</PaperOrientation>
    <Id>Address</Id>
    <PaperName>30252 Address</PaperName>\
    <DrawCommands>
        <!--Width and height are in twips; 1440=1". So this is a 1" square label (30332) and not the 30252 address-->
        <RoundRectangle X="0" Y="0" Width="1440" Height="1440" Rx="270" Ry="270" />
    </DrawCommands>

    <ObjectInfo>
      <!--Your label element-->
    </ObjectInfo>
  </DieCutLabel>

推荐阅读