Can I reprint a spool file?

前端 未结 2 1606
南方客
南方客 2021-01-13 04:32

Is there a way to reprint a spool file?

I can\'t find any example or article to say if there is a way or not.

edit: when i say reprint it, i mean to the same

2条回答
  •  执笔经年
    2021-01-13 05:07

    For EMF I would consider using the PrintDocument class and the Metafile class. PrintDocument's OnPrintPage event handler exposes a Graphics object that will allow you to render EMF files like such:

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

    As for plain text you could just draw it to the Graphics object on the print document, but you would need to take into account text wrapping & lines, it may not be worth the effort. I would also suspect that with almost all devices if you send plain text down port 9100 to the printer that it would print reasonably well too.

提交回复
热议问题