0

I have the following code where I get an error while init the printer: com not registered DYMO.DLS. Sorry for the bad english. If any questions I may react.

//error here
DYMO.Label.Framework.IPrinters printer = (DYMO.Label.Framework.IPrinters) Framework.GetPrinters().First(x => x.Name == LabelWriterCmb.Text);    
// error here

var server = new LocalPrintServer();

PrintQueue queue450 = server.GetPrintQueue(LabelWriterCmb.Text, new string[0] { });
var isOutOfPaper450 = queue450.IsOutOfPaper;
var isOffLine450 = queue450.IsOffline;
var isPaperJam450 = queue450.IsPaperJammed;
var requiresUser450 = queue450.NeedUserIntervention;
var hasPaperProblem450 = queue450.HasPaperProblem;
var isBusy450 = queue450.IsBusy;

if (printer is ILabelWriterPrinter && !isOffLine)
{
    ILabelWriterPrintParams printParams = null;
    ILabelWriterPrinter labelWriterPrinter = printer as ILabelWriterPrinter;
    if (labelWriterPrinter.IsTwinTurbo)
    {
        printParams = new LabelWriterPrintParams();
        printParams.RollSelection = (RollSelection)Enum.Parse(typeof(RollSelection), TrayCmb.Text);
    }

    for (int aantalPrints1 = 1; aantalPrints1 <= aantal; aantalPrints1++)
    {
        _label.SetObjectText("Streepjescode", ObjectDataEdit.Text);
        _label.SetObjectText("Tekst1", string.Format("Login PC vestiging {0}", vestiging[locatie]));
        _label.SetObjectText("Product", Artikel);
        decimal verkoopPrijs = decimal.Parse(Verkoop);
        _label.SetObjectText("Tekst2", string.Format("Prijs € {0:N2}", verkoopPrijs));
        //_label.Print(printer, printParams);
        queue = server.GetPrintQueue(LabelWriterCmb.Text, new string[0] { });
        bool onLine = queue.IsPrinting;
    }
}

}

Hoping somebody knows the solution. Tryed several casting but nothing helps

0 Answers0