Web Connection
Looking for a best practice for printing labels from within WWWC
Gravatar is a globally recognized avatar based on your email address. Looking for a best practice for printing labels from within WWWC
  Michael B
  All
  Aug 29, 2019 @ 10:37am

Any suggestions or examples would be great!

Gravatar is a globally recognized avatar based on your email address. re: Looking for a best practice for printing labels from within WWWC
  Harvey Mushman
  Michael B
  Sep 1, 2019 @ 04:35am

Assuming the label(s) are in response to a user request, the simple way that should always work is to generate a PDF download. The label can be generated in VFP and processed as a report. Some labels require QR or other forms of bar codes and in this case, I suggest calling on Google to generate for free the symbol you need as a picture and add it to the label as needed.

I use XFRX to generate the PDF and found it to be very reliable for over 10 years. WC has good documentation that describes how to generate PDF downloads (XFRX is one of the options) within your code.

Gravatar is a globally recognized avatar based on your email address. re: Looking for a best practice for printing labels from within WWWC
  Michael Hogan (Ideate Hosting)
  Michael B
  Sep 7, 2019 @ 08:25pm

Label printers can be quite demanding re: formatting and paper handling.

Assuming you have Windows on the client...

I had a similar situation for a remote desktop app. My solution was to create a dbf file with the label content and use a special extension to tell the windows client that it's a label file. The user can click on the web link to download and open the file.

On the client side, create a small vfp (or other) application and associate your 'special extension' with your local application so that when the windows client opens the dowloaded file, it opens the file with your local application. Your local app can then upen the dbf and you can control the lable printer directly on the client.

Gravatar is a globally recognized avatar based on your email address. re: Looking for a best practice for printing labels from within WWWC
  Michael B
  Michael Hogan (Ideate Hosting)
  Sep 10, 2019 @ 05:25pm

Michael - that's a clever idea (associating a vfp exe with the label printer). I just might give that a try if plan a fails.

Plan A

I found this great little app on Git FoxBarCodeQR and added it to my WWWC project in about 5 minutes. My WWWC app generates a UI less- url that is then QRCoded and displayed in an html page along with the rest of the label text. The end user will scan the QR code with their phone or tablet and it will push an event to the WWWC app. Exactly what I wanted... This was the easy part.

As Michael points out, getting it to print 'with a click' from the webpage and look good consistently across many devices or printers is going to be the fun (if not impossible) part. I am hoping to print from the web browser and have the user simply change print driver to the local 'Brother QL-800 label printer' that I bought for $80 as a test... Using Windows default driver with auto scaling appears to work in preview, but my printer does not like it (yet).

If I get it to work, I'll report back. I was hoping to say that this whole project took about an hour from beginning to end, but suffice to say, its been more than a few hours now.

© 1996-2024