dymosoftware / DCD-SDK-Sample

DYMO Connect SDK Samples
Other
60 stars 26 forks source link

Migrating from DLS to Connect in Delphi #56

Open Atoggota opened 2 years ago

Atoggota commented 2 years ago

Hi,

I have a windows application written in Delphi that runs perfectly with DLS. What changes do I have to make, to make my app work with Dymo Connect? I can't find any code samples :(

Here's roughly my code snippet:

var
    DL:                   IDymoAddIn;
    LB:                   IDymoLabels;

begin
    DL := CreateOleObject('Dymo.DymoAddIn') as IDymoAddIn;
    LB := CreateOleObject('Dymo.DymoLabels') as IDymoLabels;

    LB.SetField('LABEL', 'Some text');
    LB.SetField('VALUE', 'Some value');

    DL.Open('Test.label');
    DL.SelectPrinter(Printer.Printers[GetPrinterIndex('Dymo ')]);
    DL.Print(1, false);
end;

The DLL I am using with DLS is DLS8BackwardCompatibilityCOMLib.dll

Any ideas where to start?

Atoggota commented 1 year ago

In case someone runs into the same issue, we switched to DYMO web services and use operations like https://127.0.0.1:41951/DYMO/DLS/Printing/GetPrinters and https://127.0.0.1:41951/DYMO/DLS/Printing/PrintLabel

Works absolutely fine with DLS and Connect.

emauro commented 1 year ago

@Atoggota what are the parameters for the PrintLabel call? What should be passed to the URL? Thanks!!

Atoggota commented 1 year ago

@Atoggota what are the parameters for the PrintLabel call? What should be passed to the URL? Thanks!!

You can find all information on the web service API here: https://developers.dymo.com/2016/08/08/dymo-label-web-service-faq/

Parameters:

printerName – printer name paramXml – printing parameters labelXml – DOM or XML representation of the label labelSetXml – data set for label objects

emauro commented 1 year ago

@Atoggota thanks, but the documentation does not state if the parameters are passed in the URL or in a payload. I want to use the URL directly not the Javascript framework.

Atoggota commented 1 year ago

I pass them in the payload. I doubt that you can pass them in the URL as the parameters can be very long (e.g. XML representation of the label).

tcundith commented 6 months ago

I'm having the same problem as @Atoggota. The code I use for DLS is exactly same and I'm having trouble learning how to migrate to Connect. Is there a high level COM object in Connect like Dymo.DymoLabels, etc? Thanks for any help.