Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing printed on Windows 10/Electron #174

Closed
sinjimmyi opened this issue Jun 12, 2017 · 1 comment
Closed

Nothing printed on Windows 10/Electron #174

sinjimmyi opened this issue Jun 12, 2017 · 1 comment
Labels

Comments

@sinjimmyi
Copy link

sinjimmyi commented Jun 12, 2017

I'm running on electron 1.4.13 on Windows 10, after a lots of work, I have successful build this module.,and I could get getPrinters and getDefaultPrinter worked,however,when I try to print something use printDirect,I could print nothing, when I choose to print to a pdf,the size of pdf is 0kb.

printer.printDirect({data:'test text' // or simple String: "some text"
	, printer:'Microsoft Print to PDF' // printer name, if missing then will print to default printer
	, type: 'RAW' // type: RAW, TEXT, PDF, JPEG, .. depends on platform
	, success:function(jobID){
		console.log("sent to printer with ID: "+jobID);
	}
	, error:function(err){console.log(err);}
});

The console showssent to printer with ID: *,but no content is printed. Following is my printer list, I have tried three of them. Brother MFC-1919NW Printer print nothing, and the Microsoft Print to PDF get me a pdf file with size of 0KB

    defaultPriority: 0,
    averagePPM: 0 },
  { name: 'Microsoft Print to PDF',
    portName: 'PORTPROMPT:',
    driverName: 'Microsoft Print To PDF',
    printProcessor: 'winprint',
    datatype: 'RAW',
    status: [],
    statusNumber: 0,
    attributes: [ 'DO-COMPLETE-FIRST', 'LOCAL' ],
    priority: 1,
    defaultPriority: 0,
    averagePPM: 0,
    jobs: [ [Object] ] },
  { name: 'Fax',
    portName: 'SHRFAX:',
    driverName: 'Microsoft Shared Fax Driver',
    printProcessor: 'winprint',
    datatype: 'RAW',
    status: [],
    statusNumber: 0,
    attributes: [ 'FAX', 'LOCAL' ],
    priority: 1,
    defaultPriority: 0,
    averagePPM: 0 },
  { name: 'Brother MFC-1919NW Printer',
    portName: 'WSD-151f5525-657d-4066-a086-82bd7058da05.0034',
    driverName: 'Brother Laser Type1 Class Driver',
    printProcessor: 'winprint',
    datatype: 'RAW',
    status: [],
    statusNumber: 0,
    attributes: [ 'DO-COMPLETE-FIRST', 'LOCAL' ],
    priority: 1,
    defaultPriority: 0,
    averagePPM: 0 } ]
@tojocky
Copy link
Owner

tojocky commented Jun 13, 2017

RAW means you send direct commands to printers, not a text to be printer. for text to be printer use the type "TEXT"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants