Print Excel label via c# service

Labels are prepared as Excel files.

When purchase is done, we use Excel file as template and fill it with data in our C# Windows Service.

Now we want to print this filled Excel file to Zebra printer (ZDesigner 140Xi4)

 

Since it is C# Windows Service, we cannot send file to printer (installed as printer in Windows) via Excel.

What is the correct approach for this task?

 

We tried different solutions, but all of them didn`t work well. First of all, if we compare print result via Excel and other methods - size of the label is different. It looks like Excel is adjusting label to paper size (we send to printer with No Scaling option).

At this moment we tried the following options:

1. Convert Excel file to PDF and send PDF to printer via ghostscript. Problem - PDF has size info and page size does not match paper size. When PDF is printer, size and location is wrong.

2. Convert Excel file to BMP and send BMP image to printer via Paint. Result is much better, but size of printed image does not match original size and size of label printed in Excel.

3. Convert Excel file to BMP. Convert BMP to monochrome. Send monochrome image to printer via ZLP. Printed page has the same size as BMP (but does not match label printer via Excel). But new problem appears - text quality is very low after conversion to monochrome. 

 

Main target here is to get the same result as if we print via Excel, because user who prepare Excel templates adjust size and texts and test it via Excel (first of all print preview, and final test via real printing from Excel).