1

I have researched how to reprint spool files in C# for a few days now and I ran into an immediate issue. I have found decent examples and explanations for HOW to print the jobs, but the print job keeps disappearing from the queue and the printer does not print.

Suggested solutions include source code from Microsoft: https://support.microsoft.com/en-us/help/322091

and this:

void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
{
     Metafile metafile = new Metafile("SampleMetafile.emf");
     e.Graphics.DrawImage(metafile, 10, 10);
}

from a previous Stackoverflow discussion: Can I reprint a spool file?

I tried both and the same problem occurs, the print job appears in the queue, disappears, and no printing nor printing errors occur.

I have found a decent Visual Basic example that works like a charm, but would prefer to avoid having to to launch a separate VB app from my C# app just to grab spool files and send them to another printer.

The VB example is from Code Project: https://www.codeproject.com/Articles/10586/EMF-Printer-Spool-File-Viewer

What I'm hoping for is that someone knows of a similar project example that is in C# or why the print jobs would disappear from the queue without printing even though the C# code I've tried appears to work.

The printer in use is an 'Epson TM-T88V Receipt' device.

Edit: the format of the spool file is EMF

Ando
  • 11
  • 3
  • Some printers seem to be able to detect that the input is not correct and ignore it which could explain why nothing prints. If you don't fancy decompiling the codeproject program back into C#, what about just including the dll (or exe) as a library? – sgmoore Aug 15 '17 at 17:09
  • That's probably my best option at the moment considering how long I've spent trying to figure out why it won't work in C#. Was hoping there might be something obvious I missed about the samples in C# that I could tweak and be set. – Ando Aug 15 '17 at 19:45

0 Answers0