Printing to DYMO Label Printer

Forum to discuss the new web client version of Servoy.

Printing to DYMO Label Printer

Postby rafig » Wed Oct 03, 2018 7:14 pm

Hi all,
I am creating a new solution that needs to be able to print address labels easily & directly.
Luckily my client has bought DYMO label printers & DYMO offer a JS Framework to allow printing to their Label Printers from a web browser
http://developers.dymo.com/2010/06/02/dymo-label-framework-javascript-library-samples-print-a-label/
with test page at
http://www.labelwriter.com/software/dls/sdk/samples/js/PrintLabel/PrintLabel.html
This worked for me to my DYMO from Safari.
I now need to somehow embed that in my NG client solution & get it to print.
I tried creating an HTML Area (set to editable) on a form & putting the 'PrintLabel.html' code in a form variable that I set as data provider for HTML Area & it displays correctly & allows me to enter some text, but when I click on the 'Print' button, it just enters the word 'Print' in the button & doesn't do anything.
If I change the HTML area to 'not editable', the HTML doesn't display correctly & nothing works.
The HTML is very simple
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Print a Label</title>
<script src = "http://labelwriter.com/software/dls/sdk/js/DYMO.Label.Framework.latest.js" type="text/javascript" charset="UTF-8"> </script>
<!--<script src="../../../dymo.label.framework.js" type="text/javascript" charset="UTF-8"> </script>-->
<script src = "PrintLabel.js" type="text/javascript" charset="UTF-8"> </script>
</head>

<body>
<h1>DYMO Label Framework JavaScript Library Samples: Print Label</h1>

    <div id="textDiv">
        <label for="textTextArea">Label text:</label><br/>
        <textarea name="textTextArea" id="textTextArea"  rows="5" cols="40"></textarea>
    </div>

        <div id="printDiv">
            <button id="printButton">Print</button>
        </div>
</body>
</html>

but how can I get that to work somehow on a Servoy form, with me passing a records field(s) to it to print that address??

Unfortunately I think there is a real problem with the fact that NG client cannot do any printing, as of course it is the best way to migrate to an up to date client solution, but people still need to print...
If I can't get this to work, I will have to switch this client to another product, as they don't want to use Smart Client [Java] & like the UX/UI that NG offers. (i.e. modern, responsive, Bootstrap/Angular type)

Please help me to make NG work & allow me to stick with Servoy 8 :wink:

Thanks

Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 506
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Printing to DYMO Label Printer

Postby rafig » Wed Oct 03, 2018 7:48 pm

Well, in reply to my own post, I thought I'd try a bunch of the other NG components & just before giving up I tried the 'Embedded YouTube' one, put in the demo/sample URL (2nd one in post above) & it worked!!!

So, Servoy, please can you create a more generic version of that component that can be placed on a form & passed a data provider that would replace (in this example the text area) something in the HTML & thereby allow some kind of printing??
(I am NOT an expert on Component creation, so would be wary about tweaking the Youtube component to do this myself)

Thanks

Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 506
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Printing to DYMO Label Printer

Postby swingman » Tue Oct 09, 2018 6:25 pm

There should really be more documentation and examples on how to create components.
And maybe some starter components for solving different kinds of problems.

I know we can go on GitHub and look at Servoy's source code, which I have done, but it takes a long time to get an understanding of how it works.
And I have still not 100% achieved what I set out to do.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1236
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Printing to DYMO Label Printer

Postby rafig » Wed Oct 10, 2018 12:24 pm

swingman wrote:There should really be more documentation and examples on how to create components.
And maybe some starter components for solving different kinds of problems.

I know we can go on GitHub and look at Servoy's source code, which I have done, but it takes a long time to get an understanding of how it works.
And I have still not 100% achieved what I set out to do.

I completely agree.
@Servoy, some examples & more documentation, maybe a detailed webinar on it?
Thanks
Servoy Certified Developer
Image
rafig
 
Posts: 506
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 0 guests