flavienliger / DymoWebservice

Trick for used Dymo outside localhost
8 stars 7 forks source link

Uncaught No DYMO printers are installed. Install DYMO printers. #1

Closed atvvarna closed 8 years ago

atvvarna commented 8 years ago

Hello, I've got the error when trying the sample. It's strange that in http://labelwriter.com/software/dls/sdk/samples/js/PreviewAndPrintLabel/PreviewAndPrintLabel.html I can see my printer but still unable to print. Any help will be appreciated.

Regards, Alex

flavienliger commented 8 years ago

Hi,

I've got the error when trying the sample.

What error you get ?

http://localhost/dymo.php?/DYMO/DLS/Printing/StatusConnected http://yourip/dymo.php?/DYMO/DLS/Printing/StatusConnected

These two links you return true ?

atvvarna commented 8 years ago

Hi, yes both are true. Also dymo.php?/DYMO/DLS/Printing/Check return Congratulations

flavienliger commented 8 years ago

But if you test this :

dymo.label.framework.init('http://yourip/dymo.php?', function(){
    var printers = dymo.label.framework.getPrinters();

    if (printers.length == 0)
        throw "No DYMO printers are installed. Install DYMO printers.";
});

you get throw error "No DYMO ..." ?

atvvarna commented 8 years ago

Yes, I just tried in Firefox but same error.

flavienliger commented 8 years ago

Uhm, strange.

Do you use right adress in init ? Can you look in your Chrome/Firefox "Console error" and "Network status" ?

atvvarna commented 8 years ago

Yes everything is fine there also if I execute: dymo.php?/DYMO/DLS/Printing/GetPrinters

"DYMO LabelWriter 450 Twin Turbo<\/Name>DYMO LabelWriter 450 Twin Turbo<\/ModelName>True<\/IsConnected>True<\/IsLocal>True<\/IsTwinTurbo><\/LabelWriterPrinter><\/Printers>"

atvvarna commented 8 years ago

Also from https://localhost:41951/DYMO/DLS/Printing/GetPrinters everything is fine too:

"DYMO LabelWriter 450 Twin Turbo<\/Name>DYMO LabelWriter 450 Twin Turbo<\/ModelName>True<\/IsConnected>True<\/IsLocal>True<\/IsTwinTurbo><\/LabelWriterPrinter><\/Printers>"

flavienliger commented 8 years ago

Do you uses my script https://github.com/flavienliger/DymoWebservice/blob/master/client/DYMO.Label.Framework.2.0.2_edited.js ?

Because in your Network status, only http://yourip/dymo.php?... should appear.

atvvarna commented 8 years ago

Yes, I just change line 3104 to true as "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end"

Now I just copy paste all code again and don't see any error but nothing printed.

atvvarna commented 8 years ago

haha found the problem now, first it was the silly from me tat set it to true then it was the label that it's not supported by Dymo 450 twin trubo. Thank you man you are the best! Do you know where I can get the labelXml for different labels? for example 11354 and 11352?

flavienliger commented 8 years ago

Ahhh, well done :).

Yes, use DymoPrinter software, and save your preset label. After edit file and you get xml code.

atvvarna commented 8 years ago

Got it :+1: Do you know any way to print many labels at once?

atvvarna commented 8 years ago

About the multiple labels in one print job I've figure it out, pretty easy: var labelSet = new dymo.label.framework.LabelSetBuilder();

//set records var record = labelSet.addRecord(); record.setText("TEXT", YOUR_VARIABLE); var record = labelSet.addRecord(); record.setText("TEXT", YOUR_VARIABLE);

//print it label.print(printerName, '', labelSet);

More info here: http://developers.dymo.com/2010/06/17/dymo-label-framework-javascript-library-print-multiple-labels/