Skip to content

pungggi/ClipboardTools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

ClipboardTools

ClipboardTools is a PowerShell module that enables direct printing of clipboard content to a printer. It supports both text and images.

Requirements

  • PowerShell 5.1 or newer
  • Windows operating system

Installation

Manual Installation

  1. Download the module files to your PowerShell modules directory:

    # Create the directory if it doesn't exist
    $modulePath = "$env:USERPROFILE\Documents\PowerShell\Modules\ClipboardTools"
    if (!(Test-Path $modulePath)) {
        New-Item -ItemType Directory -Path $modulePath -Force
    }
  2. Copy all module files to this directory

  3. Import the module:

    Import-Module ClipboardTools

Features

  • Print text from clipboard with automatic word wrapping
  • Print images from clipboard with automatic scaling
  • Option to print silently without displaying a print dialog
  • Convenient aliases for quick access

Commands

Out-ClipboardToPrinter

Sends the current clipboard content (text or image) to a printer with a print dialog.

Out-ClipboardToPrinter [-NoConfirmation]

Parameters

  • -NoConfirmation: Bypasses the print dialog and prints directly using default settings

Out-ClipboardToPrinterSilent

Sends the current clipboard content (text or image) to a printer without showing a print dialog.

Out-ClipboardToPrinterSilent

Aliases

  • Print-Clipboard - Alias for Out-ClipboardToPrinter
  • pclip - Alias for Out-ClipboardToPrinter
  • pclips - Alias for Out-ClipboardToPrinterSilent

Examples

Print text from clipboard

# Copy text to clipboard first, then:
Print-Clipboard
# or use the shorter alias:
pclip

Print image from clipboard

# Copy an image to clipboard first, then:
Out-ClipboardToPrinter

Print directly without dialog

# Print clipboard content without showing a print dialog:
pclips
# or use the full command:
Out-ClipboardToPrinterSilent

Notes

  • The module automatically detects whether the clipboard contains text or an image
  • Images are automatically scaled to fit the page while maintaining aspect ratio
  • Long text is automatically wrapped to fit the page width
  • Text that spans multiple pages will be printed correctly across pages

License

© Alessandro. All rights reserved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published