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

Is there any simple example or instruction how to use ipp-printer on windows #35

Open
tigran1984 opened this issue Oct 23, 2019 · 4 comments

Comments

@tigran1984
Copy link

No description provided.

@SRodinou
Copy link

What's your issue here ?
I've managed to make it work so I may help

@itamardavidyan
Copy link

@SRodinou How you make it work on windows? can you share your code?

@figox
Copy link

figox commented Oct 30, 2020

Someone have make it work on Windows? The printer is showing, the job it's being created but the event on nodejs is not firing therefore no .ps file is created.

@itamardavidyan
Copy link

itamardavidyan commented Nov 1, 2020

I wrote Powershell script for printer installation:

$PrinterName = "FillYoutPrinterName"

Write-Output "Step 1"
Try {
    # 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 | Out-Null
        Enable-WindowsOptionalFeature -Online -FeatureName "Printing-Foundation-InternetPrinting-Client" -NoRestart | Out-Null
        Write-Output "Printing-Foundation-InternetPrinting-Client feature enabled."
    } else {
        Write-Output "Printing-Foundation-InternetPrinting-Client feature already enabled."
    }
} Catch {
    Write-Output "<!--- An error occurred @ Step 1 ---!>"
    Write-Output $_.ScriptStackTrace
}

Write-Output ""
Write-Output "Step 2"
Try {
    # Step 2 - Check if printer exists
    $Printer = Get-Printer -Name $PrinterName -erroraction 'silentlycontinue'
    If ($Printer) {
        Write-Output "Printer already installed."
    } Else {
        Write-Output "Install printer..."
        
        # Step 2.1 - Find printer driver name
        $PrinterDriver = Get-PrinterDriver -Name "HP *" # You can change this to any other printer driver
        if ((-Not $PrinterDriver) -or ($PrinterDriver.length -eq 0)) {
            Write-Output "Can't find printer driver."
            exit 1
        }
        $PrinterDriverName = $PrinterDriver[0].Name;
        Write-Output "Driver name = $PrinterDriverName"
        
        # Step 2.2 - Install printer
        Write-Output "Install printer..."
        Add-Printer -Name $PrinterName -DriverName $PrinterDriverName -PortName "http://$($env:COMPUTERNAME):3007/printers/$PrinterName"
        
        Write-Output "Printer ($PrinterName) installed successfully."
    }
} Catch {
    Write-Output "<!--- An error occurred @ Step 2 ---!>"
    Write-Output $_.ScriptStackTrace
}

!! Don't forget to install GhostScript

Hope it's help for you :) @figox @tech-srinath

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

No branches or pull requests

4 participants