apenab/react-dymo

Add function for print label

Closed this issue · 9 comments

Hello,

I like your work at react-dymo-hooks! It is very easy to read status and printers.

I do not see how I can print using one of the printers. Could you tell me how to do that?

Thank you!

Here an example.

import {dymoRequestBuilder} from "react-dymo-hooks";

const params = {
        data: `printerName=${encodeURIComponent(printerSelected)}&printParamsXml=&labelXml=${encodeURIComponent(
            xml
        )}&labelSetXml=`,
};

function handlePrintLabel() {
        dymoRequestBuilder({
            method: "POST",
            wsAction: "printLabel",
            axiosOtherParams: params,
        })
         .then(() => {})
         .catch(() => {});
}

I think that is a good point create a utility function for this issue.

Thanks!

Ok just saw this issue. Could be good to put it in the docs as well.

Ok just saw this issue. Could be good to put it in the docs as well.

I going to add this explanation in the Readme.md doc. Thanks for the suggestion!

Great job on the react-dymo- hooks! In the web sdk of dymo there is an option to print multiple labels in one job. This could be achieved by the LabelSetBuilder. How can I achieve the same, to build multiple labels in one job?

Great job on the react-dymo- hooks! In the web sdk of dymo there is an option to print multiple labels in one job. This could be achieved by the LabelSetBuilder. How can I achieve the same, to build multiple labels in one job?

Discussion about this topic here: #33

Hi,I saw that you have implemented this function.Do you have an example of the string to pass for multiple prints?Regards,SarkisOp 23 okt. 2022 om 16:51 heeft Antonio Peña Batista @.> het volgende geschreven: Closed #1 as completed via #35. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.>

@sarkis1997 #34 (comment)