10-15-2025 12:58 PM
Sure, just give some time and I will find an example for you.
10-16-2025 01:12 AM
- Install the necessary printer driver and create a ‘printer share’ in the Windows properties, for example with the name ‘USB-Printer-ZPL’.
- Create a file, for example ‘printercommands.txt’, with the necessary ZPL commands.
- Execute the following command via the console: cmd.exe /C copy /A “printercommands.txt” \\localhost\USB-Printer-ZPL
In LabVIEW, this will look as follows
10-16-2025 02:51 AM
@Hooovahh wrote:
@dkfire wrote:
I use this .net dll to write ZPL code to a printer directly.
https://github.com/rkone/sharpzebraDo you have an example of this? I see you posted an image here but I'm having a hard time finding the SpoolerPrinter constructor assembly.
The SpoolerPrinter is part of the dll from github.
10-16-2025 08:05 AM
@dkfire wrote:
The SpoolerPrinter is part of the dll from github.
Thanks. This might be where my .Net experience is limiting me. But the first thing I did was download the latest release from github which was the SharpZebraStandard.1.1.0.nupkg file. Inside it was a DLL that called in LabVIEW 2022 Q3 64-bit and I got this where the Spooler was missing.
Then I found the bug fix test you linked to in a closed issue and got this:
Using this I was able to send the commands to a USB printer without any issue.
Now if I try the attachment you just gave for 1.0.6.0 it can't load the assembly. I also downloaded the DLL from here for 1.0.6.0 and it also couldn't load it. The only thing that seems to work for me in both 32 and 64 bit 2022 Q3, is the one labeled SharpZebraTest 1.0.0.0 from that bug fix post. There was talks around the version of .Net it was compiled for so maybe that is it? I don't have the environment to compile it right now, but it seems this test post works for me in a somewhat modern version of LabVIEW in 64 bit which is all I needed.
For some background I did try to use the Notepad print method over command line and that would work as long as some compressed graphics weren't in the print command. Then I found the solution sending the copy command to a networked printer name. So I took my USB printer and shared it, then copied the file to localhost\PrinterName and that worked. But I'm seeing times when printers are swapped out and I wanted to eliminate the work involved with sharing the printer and renaming it so this DLL works better since I can query the names of the printers on the PC and use that. Maybe this should be a blog post if I get some time even though I still don't fully understand it all.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-16-2025 08:17 AM - edited 10-16-2025 08:38 AM
I only use it with LV 2019 (32-bit) and TestStand 2019, os I havent tested it on other versions.
I don't link and can't use the notepad or file move part in the production that i'm using it in.
I needed the direct write, and it has worked for both Zebra and SATO printers.
I see that the developer has changed a lot over the years.
To get the lates package that I use here: https://www.nuget.org/packages/SharpZebra.rkone/
This one only support .NET 4.6
Else see here: https://www.nuget.org/packages/SharpZebraStandard/
Have you tried https://www.nuget.org/packages/SharpZebraStandard.DesktopPrinting ?
10-16-2025 11:31 AM
Okay, got some more details on the load of the .net.
One reason for not loading the 1.0.6.0 version that I posted could be that windows has blocked it from loading.
Even if it is placed in a folder other than download, windows can still block the dll.
Tried on my home PC, and the dll was blocked. A .NET dependency walker could tell me that.
Tried to unblock in the file properties. Did not work for the Dependency walker, but did work for LabVIEW, if I restarted LabVIEW.
The dependency walker needed a config file to tell it, i is safe to load the dll.
<loadFromRemoteSources> Element | Microsoft Learn
More Implicit Uses of CAS Policy: loadFromRemoteSources | Microsoft Learn
I couldn't load the SharpZebraStandard.DesktopPrinting or SharpZebraStandard dll.
Dependency walker repotted a missing "SkiaSharp" .net component.
I'm on Win10, so could be a .net 8 missing feature.
10-16-2025 12:25 PM
Yes thanks for this advice I tend to forget about this occasionally needed Unlock. After doing that I can use your code and loads correctly.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord