As you say, both are valid. I've really only ever done the first, but it's always fit my use case.
So you didn’t have any scaling issue? or wonky behavior? Just curious you do more than 1 label at a time with that method?
And of course thanks Daryl.
I guess I'm not quite sure what you mean by that. The action sends the labels one at a time, but I do use the action to mass process many labels in a short time.
I’m referencing behavior we have seen when printing labels directly in Acumatica. when you go to print preview the labels seem to jump off the page (too big) but you change scaling properties and it all aligns. Having to do that every time we print.
I know what you mean by doing one at a time but en mass (like a process screen calling the button on a form)
I do appreciate the input.
Maybe the difference is that I’m not previewing the labels. It’s wired directly into an action that simply sends it to the printer. It’s not the same as printing a “label” report which would be previewed, etc.
I had a need to print custom labels several years ago via Device Hub and wrote a blog post about it. Printing to a Label Printer via Device Hub – Brian's Blog (acumatica.dev) Also, you might look into Asgard Labels on the marketplace if you want a fancy solution that uses an alternative to Device Hub.
I chose the route of creating a custom label configuration screen and a set of tools to build various labels for our specific needs. I can generate for EPL and ZPL languages spending on whether we are printing to our old Eltron printers or newer Zebra printers. The blog post explains how to get the generated EPL or ZPL control file into Acumatica and sent to the Device Hub printer of your choice.
In 23r1, there was a minor change that I really need to document on my blog post or write a new post for the updated code. Instead of PXGraph.CreateInstance<SMPrintJobMaint>() as noted in the blog post, you want to use the StartAsyncOperation version shown below starting with 23r1.
SMPrintJobMaint graph = PXGraph.CreateInstance<SMPrintJobMaint>();
graph.LongOperationManager.StartAsyncOperation(ct =>
graph.CreatePrintJob(printSettings, (string)null, parameters, description, ct));
Hey Brian, I read your blog, brilliant and what is guiding me mostly.
And Daryl I have a label right now, pretty simple but when I print from the reports menu, it prints no issue. But when I do the old run the report, send dictionary to filter report and send it to device hub the entire label is pushed down an inch and prints weird. Wonky behavior like that is what I am finding when I don’t take control of the printer, which is what I think is necessary here.
I think we are going with Asgard in this case, but I still need a simple for solution for one off label print jobs. I think the ZPL code is the way to go. Thanks everyone for input.