我已经制作了一个用于打印Dymo标签的小应用程序,它按预期工作,但是当我在Surface平板电脑上运行时,它会禁用scalling af我已按下打印按钮。如果重新打开,则剥落是正确的,直到再次按下打印按钮。 谁能告诉我为什么?
打印按钮仅运行我的LabelPrinter类,其中包含以下代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dymo;
using System.Windows.Forms;
namespace LabelPrinter
{
class LabelPrinter
{
private DymoAddInClass dymoAddIn;
private DymoLabelsClass dymoLabels;
private string labelPath, classRoom;
private int labelCount;
public LabelPrinter(string labelPath, string classRoom, int labelCount)
{
dymoAddIn = new DymoAddInClass();
dymoLabels = new DymoLabelsClass();
this.labelPath = labelPath;
this.classRoom = classRoom;
this.labelCount = labelCount;
}
public void printLabels()
{
dymoAddIn.SelectPrinter(dymoAddIn.GetDymoPrinters().Split('|')[0]);
if (dymoAddIn.Open(labelPath))
{
int firstNo = StaticMethods.getNextCodeEntryWithString(classRoom), lastNo = firstNo + labelCount;
dymoAddIn.StartPrintJob();
for (int i = firstNo; i < lastNo; i++)
{
foreach (string objName in dymoLabels.GetObjectNames(true).Split('|'))
{
dymoLabels.SetField(objName, classRoom + "_" + i);
}
dymoAddIn.Print(1, false);
}
dymoAddIn.EndPrintJob();
}
}
}
}