title: Printing PDF lables to a Zebra printer (420d)
body: <p>In my webshop, I'm able to download a delivery slip as a pdf file. I have built a .NET service that uses <code>FileSystemWatcher</code> that monitors my &quot;Print&quot; folder. The service will process all <code>.pdf</code> and <code>.zpl</code> files inside the folder.</p>
  <p>All <code>.zpl</code> files will be opened and written to a Zebra 420d printer directly using the Windows drivers using the <code>RawPrinterHelper</code> class. It works as expected!</p>
  <p>My issue is the <code>.pdf</code> files. When I print the files manually from a browser in Windows 10 to the Zebra 420d printer, it works perfectly fine. But when I try to print them from my service, the size of the label will be very small. It looks like the content has shrunk.</p>
  <pre><code>public static bool PrintPdf(string filepath, string printerName)
  {
      try
      {
          var doc = new PdfDocument();
          doc.LoadFromFile(filepath);
          doc.PrinterName = printerName;
          doc.PrintDocument.Print();
          doc.Dispose();
  
          return true;
      }
      catch (Exception ex)
      {
          // More code ...
      }
  }
  </code></pre>
  <p>I have googled all night and tried various ways to convert a PDF to PNG/SVG to ZPL, but non worked.</p>
  <p>How can I print labels in PDF-format to a Zebra 420d printer using c#?</p>
  <p>Edit: I tried also to convert the PDF to a BMP and then to GRF (Zebras native language). Still not working. All I get is a blank page.</p>