Git Product home page Git Product logo

Comments (10)

itamardavidyan avatar itamardavidyan commented on September 14, 2024 1

This command: var printer = new Printer('My Printer') deson't define the port of the virtual printer
Try to debug and see which port number the constructor define to the virtual printer

from ipp-printer.

itamardavidyan avatar itamardavidyan commented on September 14, 2024

@jaidirectdsn You solved this?

from ipp-printer.

kartikbathla avatar kartikbathla commented on September 14, 2024

How did you guys actually solve this?

from ipp-printer.

itamardavidyan avatar itamardavidyan commented on September 14, 2024

I created virtual printer:

this.printer = new Printer({ name: 'PrinterName', port: 3007 })

And then I used powershell script to install the printer:

# Step 1 - Enable InternetPrinting feature
$Feature = Get-WindowsOptionalFeature -Online -FeatureName "Printing-Foundation-InternetPrinting-Client"
if ($Feature.State -ne "Enabled") {
        Enable-WindowsOptionalFeature -Online -FeatureName "Printing-Foundation-Features" -NoRestart
        Enable-WindowsOptionalFeature -Online -FeatureName "Printing-Foundation-InternetPrinting-Client" -NoRestart
}

# Step 2 - Install printer
$Result = Test-NetConnection 127.0.0.1 -Port 2404
If ($Result.TcpTestSucceeded) {
     Add-Printer -Name "PixLetter" -DriverName $PrinterDriverName -PortName "http://$($env:COMPUTERNAME):2404"
} Else {
      throw "Printer port doesn't exposed"
}

from ipp-printer.

samantrader avatar samantrader commented on September 14, 2024

I created virtual printer:

this.printer = new Printer({ name: 'PrinterName', port: 3007 })

And then I used powershell script to install the printer:

# Step 1 - Enable InternetPrinting feature
$Feature = Get-WindowsOptionalFeature -Online -FeatureName "Printing-Foundation-InternetPrinting-Client"
if ($Feature.State -ne "Enabled") {
        Enable-WindowsOptionalFeature -Online -FeatureName "Printing-Foundation-Features" -NoRestart
        Enable-WindowsOptionalFeature -Online -FeatureName "Printing-Foundation-InternetPrinting-Client" -NoRestart
}

# Step 2 - Install printer
$Result = Test-NetConnection 127.0.0.1 -Port 2404
If ($Result.TcpTestSucceeded) {
     Add-Printer -Name "PixLetter" -DriverName $PrinterDriverName -PortName "http://$($env:COMPUTERNAME):2404"
} Else {
      throw "Printer port doesn't exposed"
}

Hi @itamardavidyan can you explain what is relation of powershell script with use of ipp-printer
and send a full instruction for create a virtual printer with ipp-printer

from ipp-printer.

itamardavidyan avatar itamardavidyan commented on September 14, 2024

@samantrader

The Powershell script seperated for 2 steps:

  1. Enable InternetPrinting feature - I don't remember why I should enable those windows features but without enable them I can't send files to the virtual printer.
  2. Install printer - The next command:
    Add-Printer -Name "PixLetter" -DriverName $PrinterDriverName -PortName "http://$($env:COMPUTERNAME):2404"
    Is a command line for adding the printer automatically to the printers list of the windows user - it's useful if you don't want that the user will add it manually

About creating virtual printer using ipp-printer you can use the code from the README.md file

from ipp-printer.

samantrader avatar samantrader commented on September 14, 2024

Hi
If this powershell configuration is necessary for use ipp-printer ?

from ipp-printer.

itamardavidyan avatar itamardavidyan commented on September 14, 2024

It's not necessary because you can do each of the steps manually

from ipp-printer.

samantrader avatar samantrader commented on September 14, 2024

I used exactly this code but printer donot show in list of windows printer why ?

`var fs = require('fs')
var Printer = require('ipp-printer')

var printer = new Printer('My Printer')

printer.on('job', function (job) {
console.log('[job %d] Printing document: %s', job.id, job.name)

var filename = 'job-' + job.id + '.ps' // .ps = PostScript
var file = fs.createWriteStream(filename)

job.on('end', function () {
console.log('[job %d] Document saved as %s', job.id, filename)
})

job.pipe(file)
})`

from ipp-printer.

samantrader avatar samantrader commented on September 14, 2024

Hi
When I run this command
$Result = Test-NetConnection 127.0.0.1 -Port 2404
powershell return error : WARNING: TCP connect to 127.0.0.1:2404 failed

how can I fix this error ?

from ipp-printer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.