1 of 1 people found this helpful
Hi Alexander, To do exactly what you are asking for you can convert the PDF or EMF to a PNG, JPG, or BMP image format. There are many tools to do this on the market. You can then use the PrinterUtil.ConvertGraphic() API in the SDK to convert it into valid ZPL.
There is also a few options to directly use the PDF file.
1. Not using the SDK, you can use the built in .NET APIs for PrintDocument to send the PDF to the printer driver directly. This is easy, but it gives you a lot less control in your app.
2. We have essentially an app you can put on the printer to take PDF's directly PDF Direct - Virtual Device | Zebra . You can then just send the PDF as a file to the printer. This does cost money to activate though.
thanks a lot for your reply.
I will try the suggested method with the PrinterUtil, as we are required to save the ZPL within the database.
Robin what file types are supported by PrinterUtil.ConvertGraphic ?
Here is the code I am using
Stream s = new MemoryStream();
var zImage = ZebraImageFactory.GetImage(filePath);
PrinterUtil.ConvertGraphic("", zImage , s); <= Exception is here
There is nothing in the documentation and I have tried png, gif and jpg but all have thrown an exception of UnSupported filetype.