C# console app - print job vanishes in Windows 8 regardless of print driver used; works in Windows 7

I have the following which sends a print file to a specific printer. It works perfectly in Windows 7, but not in Windows 8. The print job shows in the print queue until the print job is closed. Then the print job literally vanishes from the print
queue. This issue occurs with all print drivers, including generic text only. Conversely, I can still use the "winspool.drv" DLL directly under Windows 8 and it works. Please advise. Thank you.
Here is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Printing;
namespace PrinterLib
    public static class PrintToSpooler
        public static string SendFileToPrinter(string szPrinterName, string szFileName, string docName)
            try
                // Create the printer server and print queue objects
                //PrintQueue defaultPrintQueue = LocalPrintServer.GetDefaultPrintQueue();
                //PrintQueue mypq = new PrintServer().GetPrintQueue(szPrinterName);
                //using (var printq = defaultPrintQueue)
                using (var printq = new PrintServer().GetPrintQueue(szPrinterName))
                    using (PrintSystemJobInfo job = printq.AddJob(docName))
                        using (var memoryStream = new MemoryStream())
                            FileStream fs = new FileStream(szFileName, FileMode.Open, FileAccess.Read, FileShare.None);
                            fs.CopyTo(memoryStream);
                            fs.Close();
                            Byte[] myByteBuffer = memoryStream.ToArray();
                            // Write a Byte buffer to the JobStream and close the stream
                            job.JobStream.Write(myByteBuffer, 0, myByteBuffer.Length);
                            job.JobStream.Flush();
                    printq.Commit();
                return null;
            catch (Exception ex)
                return ex.Message;

Hello folks,
I have been facing the same problem until right now. All above suggested methods failed (as it did for Jeff0123) . But after long research on that issue I think I found the reason (but no proper solution yet).
MS Windows 8 and 2012 use a new printer driver generation based on XPS. Which means drivers like "generic text-only" won't work properly depending on the method the data is sent to the printer. In my case the
same way like Jeff0123 tried to access the printers.
See link http://support.microsoft.com/kb/2779300
One solution might be to use API calls. I have also found a site which shows an example project for thermal slip printing. The VB.NET source code there features a wrapper class for all API calls. The functions you find behave pretty similar to the ones of
the posted C# code example of Jeff0123. I did a small test so far and for my needs that works fine.
Although the page is in German you can find the mentioned class by searching for "Public
Class RawPrinter". Beside the comments the class methods are written in English. You find the class here: http://www.vbarchiv.net/tipps/tipp_2375-kassenbon-drucker-mit-vbnet-oder-c-per-esc-pos-befehle-ansprechen.html
Hope that might help for at least a few of you. So long!

Similar Messages

  • Console.app doesn't show up (window)

    Hi,
    a week or so after I've upgraded to 10.9.2 my console.app stopped opening any log file and it doesn't show even a (blank) window.
    I checked the activity monitor and it seems to be working.
    I've typed "tail -f /var/log/system.log" in a terminal window and opened the Console and it showed this lines:
            15  Foundation                          0x00007fff87c187ba -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
            16  AppKit                              0x00007fff8da50cf9 -[NSApplication _postDidFinishNotification] + 289
            17  AppKit                              0x00007fff8da50a2c -[NSApplication _sendFinishLaunchingNotification] + 195
            18  AppKit                              0x00007fff8da4931a _DPSNextEvent + 1238
            19  AppKit                              0x00007fff8da48a2b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
            20  AppKit                              0x00007fff8da3cb2c -[NSApplication run] + 553
            21  AppKit                              0x00007fff8da27913 NSApplicationMain + 940
            22  libdyld.dylib                       0x00007fff89b0a5fd start + 1
    After readind some posts I've deleted com.apple.console* from ~/Library/Preferences and /Library/Preferences but no luck.
    Any idea how to solve this issue?

    Not sure if this is a typo in your post but:
    ref="networkmanagementconsole.jnlp"
    should be href= .......
    John

  • Windows 7 64bit printer driver wont work

    I have a hp2600dn color laser printer that I have not been able to get to work with my windows 7 64 bit laptop.  I cannot get it to work over the network or using a USB cable with the drivers I can download from HP.  
    HELP!!!

    Hi,
    Go to Hewlett Packard  - Enter the product name / number. Be sure to check the additional information, like how to install the driver or troubleshooting guides. hope this helps you. get more information......... http://www.tomshardware.com/forum/57438-3-deskjet-1280-compatible-printer-driver-windows
    Set peace of mind as your highest goal,and organize your life around it.

  • Printer Driver wont work after upgrade to 10.6

    I just updated my OS to 10.6.8 (from 10.5x), and my printer driver won't work right. I have a Samsung ML-3051ND. I wasn't able to make double-sided copies, so i downloaded and installed the latest version (supposedly 10.6 friendly) from the Samsung website. Now, whenever I try to print I get an error message saying my printer driver isn't installed correctly, please try again. I did reinstall, following the directions from the Samsung website. Still the same error message. Any suggestions would be much appreciated.

    OK, I found an answer that works on the MacRumors forum.
    In system pref>printer & faxes> on the left side, you should have a list of printers. You need to right click in the white box andreset printing system. This deletes all the printers. Then add theprinter. It worked like a champ after that.

  • Windows 8 xps printer driver not working

    does anyone have a solution to this? i cant print to onenote 2010 nor can i print to onenote 2013. ive tried everything that i can think of: repairing the installion of microsoft office, doing another clean install of microsoft office, driver upgrade/ms troubleshoot scan, etc.
    what happens is that if i send it to one note, itll lag. even when i do insert file printout from the onenote program, it does the same thing. i also cant even print to my wireless printer.

    Hello again
    This might be user related.
    I just created a new user with admin privileges (admin might not be needed), and the system works fine for XPS and Send to OneNote 2010 "printing"
    Will dig some more into it...

  • HP printer driver not working with 10.8.2

    Can anyone give me advice on how to make my all in one laserjet HP printer M2727nf work in 10.8.2.  Downloaded new driver software on January 10, since the new OS software update today again the printer is no longer connecting. 
    I have given up on the scanning function, albeit that it would be nice if it eventually would work again as well.

    Mac OS X: About the Reset Printing System feature ...
    http://support.apple.com/kb/HT1341?viewlocale=en_US
    10.5/10.6/10.7 instructions...
    In System Preferences>Fax & Print, Right click or Control+click on the Printers list Sidebar, choose Reset Printing System.
    if you hold option and click the "-" tab it resets the printing system.
    http://www.macosxhints.com/article.php?story=20031215144430486
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions.
    Any devices that previously appeared in your Printer List and Fax List will need to be added again after resetting the printing system.
    Resetting the printing system in Mac OS X 10.5.x+++
    To use the Reset Printing System feature in Mac OS X 10.5.x, follow these steps:
    Choose System Preferences from the Apple menu.
    Choose Print & Fax from the View menu.
    Control-click on list of printers on the left side of the window, then choose "Reset printing system" from the contextual menu. If you don't see a list of printers, Control-click on the text "Click + to add a printer or fax" and select "Reset printing system..."
      As an alternative, if you currently have one or more printers listed, you can Option-click the "-" (Remove printer) button.
    http://support.apple.com/kb/ht1341
    Reboot.

  • Lightroom 1.4.1 Has anybody experienced corrupt print driver using Mac OS X Tiger

    Hi folks,
    I am starting to pull hair out! Whilst nearing the end of a print run for a wedding customer, my HP B9180 has begun to print what looks like dark lines on 'some' areas of my prints. I have done all that I can to resolve this but to no avail! i.e. Ink levels OK. Printer test sheet perfect. Print heads re aligned and cleaned anyway. Print done from Mac itself, such as iPhoto and 'Preview' - result= perfect print. Go back to Lightroom and the same happens, I am at a loss and just eight images away from finishing the job!! HELP!
    Any ideas gladly received. Is it worth trying a fresh install of Lightroom? Any one had a similar experience?
    Paul
    Oh yeah: B9180 printer (with latest firmware). MacBook Pro running OS X Tiger and Lightroom 1.4.1.
    A perfect combination for about a year . . .up until now!

    I don't recall reading any previous reports matching your description. Have you tried deleting the LIghtroom preference file to see if that helps. Occasionally, it can become corrupt.
    See linked article for location of preference file http://forums.adobe.com/thread/358041?tstart=0

  • Epson Printer Driver not working

    I live in Japan but have my iMac set up fully as English. However, I have a printer that is only made in Japan. Epson PX-G5100. I have downloaded the correct driver and installed the printer but I only get the most basic printer dialog box when I click on the options page. When this exact same printer is installed on my vista machine it works fine and I get the full dialog box. I use Lightroom to print with but even then I cannot get anything to work on the printer other then the very basic stuff. For Example, I cannot choose paper type, feed type or any color adjustments. This is very frustrating problem because I just bought this 24" iMac specifically to work with this printer.
    Hope someone can help me out with this one.
    Thanks in advance.
    Kerry

    Hi again Kerry,
    The Printer Dialogue window appears when you select File->Print from within any application. You'll see a window similar to the one below:
    You'll notice the second drop down menu which I have clicked in the above image. By selecting an option from this drop down menu you can carry out any adjustments you wish prior to printing.
    Kryten

  • Printer Driver wont work

    I run an Epson 9800 printer on iMac 10.5.8 which has worked fine until I ran a security and bluetooth update and now it just wont see the printer at all. Ive deleted the driver and downloaded it again but when i go to Add new printer its just not showing up at all, can anyone help?

    First try Reset Printing System:
    http://docs.info.apple.com/article.html?path=Mac/10.6/en/14001.html
    If it doesn't help, try repairing the hard drive ("Try Disk Utility"):
    http://support.apple.com/kb/ts1417

  • Need HP Print driver that works with OSX Lion 10.7.4

    I recently got a new modem and I need to update my SSID and password on my HP wireless printer.  The printer software that came with the printer and on the hp website for the printer only supports Mac OSX and doesn't work for OSX Lioin 10.7.4
    Is there a way to get software that could update my printer or should i remove and somehow reinstall the printer with different software?
    Kids need to print their homework....help!

    No reason to be sorry,
    You should use the Setup Assistant to reconfigure the wireless connection:
    Make sure the printer turned on and connected to your Mac by USB.
    Go to Applications\Hewlett-Packard\Device Utilities and follow the HP Setup Assistant. it will guide you to connect the printer to your new router.
    If you can't find the Hewlett-Packard folder you will need to install the HP software by selecting the HP Recommended Software, the software van be found in the following link:
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=al-107372- 1&cc=uk&dlc=en&lc=en&os=219&product=5061092&sw_lang=
    Regards,
    Shlomi

  • HP Cloud Print Driver for Windows Server 2003?

    Hello,
    I have a unique (complicated) situation that I am trying to find a solution for.
    Here is the deal,
    My company is trying to set up a temporary remote branch location inside a building where we are unable to wire a network. Our solution is to use a wireless hotspot. Connected to this hotspot, we will have an iPad and an HP Laserjet M525.
    The iPad will be connecting to our Citrix environment over VPN through Citrix Receiver to deliver a desktop interface to the iPad. This is needed to access a few applications that are used at the branch.
    The problem now is printing, AirPrint wont work because the iPad is on VPN (and its at a windows interface, not the iPad's).
    I had the idea of using the HP printers built in ePrint function to print, so I set that up. So now sending at email to [email protected] prints to the HP printer attached to the wireless hotspot.
    Emaling to print works, but ideally, I would like this printer to show up in the Windows Devices and Printers, so that the user can just click print, choose the HP printer, and it will print, (with a delay obviously as its sending an email).
    So I downloaded the HP ePrint Windows Driver, which has to be installed on the main Citrix servers so that the users session can grab the printer and use it, turns out the driver doesnt work on Windows Server 2003. 
    My first attempt at a workaround was Google Cloud Print, which was fairly simple to connect to HP ePrint, but apparently the Google Cloud Print Driver doesnt work on Windows Server 2003 either.
    Is there a version of the HP ePrint Driver out there that works on Windows Server 2003?
    tldr:
    I would like to print to a remote HP printer that is connected to a wifi hotspot from our internal network. I need whatever software I download to be compatible with Server 2003.
    I understand this is over complicated but thanks for any input.

    I believe I understand your issue.  You would like to use a print driver to print to your HP ePrint enabled printer from your apps that are hosted by Citrix server.  While I believe this makes perfect sense, HP does not have a print driver that officially supports MS TS or Citrix that also supports the ePrint Cloud path.  The reason for this is the ePrint windows driver is a "dynamic" print driver (similar to HP UPD dynamic mode) that handles multiple print paths (tcp/ip, wireless direct, cloud, etc) in a single driver instance by dynamically changing the port the print queue is bound to so the port is specific to the delivery path.  For example, if printing to a network printer it will use a MS Standard tcp/ip port.  If printing to the ePrint cloud a custom port is used, etc.  Well, if you have lots of Citrix users trying to print to a single print queue, but to different destinations, the users would be colliding with each other when they print by having the driver trying to change the print queue to different print ports at the same time.
    What you could do is install an ePrint print queue on the citrix server if you can control the access to that queue to just your local branch users.  Also, if you only have on ePrint enabled printer the situation is even better as only one port will be needed by that queue.  You can find the ePrint software at www.hp.com/go/eprintsoftware   You might want to download the version of the driver that supports XP as Windows 2003 is very similar print system.
    NOTE:  this is not a supported environment for this driver.  You would be using it without warrenty or support and no promises are being made here.
    Good luck if you choose this path and please post back the results.  Thanks!

  • Adobe PDF Printer not working as print driver; 9.5.5 (pro) with Windows 7, 64 bit

    I have installed, repaired, uninstalled and re-installed Acrobat Pro 9.5.5 on a newly formatted SSD with Windows 7, 64 bit on my desktop machine. The program was installed from Acrobat Pro 9.0.0 and updated within the program. I have the program also installed on my laptop, and the Adobe PDF Printer driver is working properly on my laptop.
    On my desktop with the newly formatted SSD, the Adobe PDF printer driver is not working. Note that I am using the printer driver, and not any pdf creation techniques within MS Office or other programs.
    When I go to the Adobe PDF printing preferences on my desktop, I only get a generic, two tab window open. When I print a file to this printer on my desktop machine, I do not get a window opening that asks where to create the pdf or what to name it, and I never see any files created. In MS Word, the Create PDF option under the Acrobat tab works and opens a dialog to ask the name and location to save, and then opens a PDF Maker progress window and properly creates the file. I can also save a file as an .eps or .ps file and use Distiller to create the pdf. However I cannot get the Adobe PDF printer driver in my Devices and Printers to work properly, although it works just fine on my laptop with the same program (Pro 9.5.5) and same Windows version (7, 64 bit).
    Repairing, uninstalling and re-installing does not solve the problem. Acrotray.exe *32 process is running. Any ideas on why this won't run properly on my desktop, but will run on a similarly configured laptop?
    On my laptop, I get a full, (7) tabl menu with all the normal options:

    I found this answer from Deepak Chauhan on another forum, and it solved this problem!
    Try this to add Adobe PDF printer manually on Windows 7, and Windows Vista.
    If windows 7 is Enterprise or better edition: (Admin rights required)
    Start>search for printmanagement.msc and open the print management module
    Expand the print server and expand the computer name to see availbale printers, drivers and printer ports.
    - from printers ensure there's no Adobe PDF printer, if there is delete it
    - go to ports and delete the PDF ports (the ones ending in *.pdf)
    - go to drivers and delete the PDF converter.
    Take note if any errors occur, but continue with the following steps regardless.
    If on windows 7 home edition, just goto start>Devices and Printers and ensure PDF pritner is not listed.
    Then open the registry (if any erors deleting these keys happen, see below)
    1: go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers
    delete any adobe PDF printer subkey present
    2: go to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors
    delee the PDF port monitor if present
    3: go to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers
    again delete and pdf printer subkey
    If any erros occur, you need to set the owner of the key to the currently logged in admin user, then ensure that user has full control.
    Do this by right-click the key and selecting permissions, clicking on advanced, then the owner tab.
    Once you've all that has been done, open a command line as administrator.
    Copy and pate the following commands in order
    1: net stop spooler
    2: rundll32.exe setupapi.dll,InstallHinfSection AdobePDFPortMonitor 128 C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Xtras\AdobePDF\AdobePDF.inf
    3: net start spooler
    4:rundll32.exe printui.dll,PrintUIEntry /if /b "Adobe PDF" /f "C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Xtras\AdobePDF\AdobePDF.inf" /r "Documents\*.pdf" /m "Adobe PDF Converter"
    That should set back the pdf printer.
    This seemed to provide the link that provided the Adobe PDF Settings tab to the Adobe PDF Printing Preferences that was missing!

  • T400 Windows 7 64bit Can't Find Printer Driver

    Hi all,
    Perhaps someone can  help with this puzzling problem. Just bought the T400 w/Win 7 64 bit from the Lenovo website. It is great except one thing.
    I have a Win2k T22 ThinkPad on the network with a parallel port HP laserjet 6L and a USB port HP DeskJet 970cxi. When I go to add a printer on the T400, Win7 searches the network and finds the printers. For the 6L it downloaded a driver and it works fine. For the 970cxi it tries to find a driver from MS website but can not find a driver.
    When I connect the970cxi printer directly to a USB port on the Win7 T400 it finds a driver and it works fine. But not over the network? Even after it found a driver when it was connected locally?
    On the network is a Debian Linux computer that can print to both printers. I turned on printer sharing on it. The T400 can find the printers on the Linux box and can print to both the 6L and 970cxi.
    I loaded VirtualBox on the T400 and then install Ubuntu Linux. The Ubunu Linux can find the printers and can print to both.
    Does anyone know what the heck is going on here? Why can't the T400 find a driver for the 970cxi printer but when it's connected directly it finds the printer driver and works?
    Is this a Win7 64 bit issue?
    No driver available?
    Communication problem w/printer?
    Buy a new printer and throw out a perfectly good printer?
    Thanks,
    Rich
    Solved!
    Go to Solution.

    I did as you suggested but now get a different error: 0x00000214
    I googled this and found others with the same problem. Tried the solution and it worked!
    Here's the link:
    Network Printer Problem Link
    In case the link gets broken I cut and pasted it here:
    1. Click Start, click Control Panel and double click Devices and Printers.
    2. Click Add a Printer.
    3. Select "Add a local printer".
    4. Select "Create a new port". Choose "Local Port" as the type of the port.
    5. In the box "Enter a port name", type the address as the following format.
    \\Network address of the host computer\[The Share Name of the printer
    Then click Next.
    6. Choose the correct driver in the driver list. If no available driver, click the button Windows Update, wait for the process finishes and then look for the driver again.
    7. Finish the installation.
    Thanks! Your suggection got me to an error I could identify. And a solution. I hope others find this helpful.
    Rich

  • How to get print driver in 9 to behave like print driver in 5?

    Hello,
    I'm working in an XP shop with some legacy applications.  One of these applications prints out batches of files to the PDF Writer printer from Acrobat 5.0.  The files all come out with a similar filename pattern.  For example, if the input was "Filename" and there were 3 parts to the batch, the output would be FILEN001.PDF, FILEN002.PDF, FILEN003.PDF, and so forth.
    We're moving to new hardware running Windows 7, and unfortunately we have to keep this legacy app around for a while.  The Acrobat 5 printer driver will not install on Windows 7.  I've downloaded the trial for Acrobat 9 Pro, but I can't seem to get the 9 printer driver to work the same way.
    Anybody know a solution?
    Thanks,
    Alex Seigler

    Try the forum for Acrobat SDK.

  • Is anyone having problems with the new Xerox printer driver update from Apple? My 8700S is no longer working with QuarkXPress.

    I allowed a System Update that included a Xerox Printer update. I am running a MacPro 10.6.8 with Quark 8.5.1 and a Xerox ColorQube 8700S.  EVERY was working perfectly before the "update" but afterwards anything sent to the printer from Quark would stall the printer.  I went to the Xerox website and downloaded their Printer Driver and tried again.  Now I could print from  Quark but I can NOT get to the printer window to change the type of paper, etc.  So, the problem still persists.
    Should I try going into Time Machine and trying to find the Xerox Print Driver in the Library folder?
    Should I upgrade the whole system software?  (I wouldn't mind doing that AFTER I get this magazine off to the commerical printer)
    Should I upgrade to Quark 9?
    Any help here would be apprciated.
    Thanks  - Rob

    As a general rule of thumb, I never install updates until I read its info and I am having problems with my current software.  I hide the updates until I need them.  Usually this happens when I update or upgrade my os.  I don't fix what ain't broken is my golden rule.
    It is possible that you need to update or upgrade Quark in order for your newer printer driver to work.  First I would try the following....
    Disconnect all peripherals from your computer.
    Boot from your install disc & run Repair Disk from the utility menu. To use the Install Mac OS X disc, insert the disc, and restart your computer while holding down the C key as it starts up.
    Select your language.
    Once on the desktop, select Utility in the menu bar.
    Select Disk Utility.
    Select the disk or volume in the list of disks and volumes, and then click First Aid.
    Click Repair Disk.
    Restart your computer when done.
    Repair permissions after you reach the desktop-http://support.apple.com/kb/HT2963 and restart your computer.
    If your printer does not work afterwards, update or upgrade Quark.  If that does not work, contact the printer manufacturer.

Maybe you are looking for

  • Help needed in GarbageCollection,not running as expectd CMSInitiatingOccupa

    We are using weblogic 9.22 and Java 5 with below server parameters SERVER_JAVA_OPTIONS="-Dweblogic.Debug=weblogic.JTAJDBC,weblogic.JTA2PC,weblogic.JTAXA,weblogicJTAResourceHealth -Dweblogic.Debug=weblogic.ejb20.cmp.rdbms.verbose,weblogic.ejb20.cml.rd

  • Trouble importing pre-existing videos on my computer into iTunes?

    I'm having trouble importing pre-existing videos on my computer into my iTunes library? For example, I've tried adding a home video and opening it with iTunes, etc, and no error comes up or anything, it just doesn't show up in my iTunes library, not

  • How does one edit a song? ...meaning,get rid of voices but leave the music?

    ...i know that this is this is the wrong forum and i should be in garageband forum (i think) ... .....but my daughter is in figureskating and i have a song picked out but i want to edit it so the singing voice is gone but the instuments/music is all

  • IPod nano in my car

    Hey guys- I'm considering buying an iPod nano if I can get a few things answered before I do so. I have a Kenwood car radio without a AUX input. I have found an adapter for my radio for $20 though that will give me an AUX input of "RCA stereo female

  • PM module query --Change Delivery Address in PR from Functional Location

    hi all, i have to export the value of CAUFVD_IMP-TPLNR to temporay memory from the enhancement "COZF0001" using the user exit "EXIT_SAPLCOZF_001" from the include program "ZXCOZU01" and then import this value in the enhancment "MMDA0001" for the user