ClipboardTools is a PowerShell module that enables direct printing of clipboard content to a printer. It supports both text and images.
- PowerShell 5.1 or newer
- Windows operating system
-
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 }
-
Copy all module files to this directory
-
Import the module:
Import-Module ClipboardTools
- 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
Sends the current clipboard content (text or image) to a printer with a print dialog.
Out-ClipboardToPrinter [-NoConfirmation]
-NoConfirmation
: Bypasses the print dialog and prints directly using default settings
Sends the current clipboard content (text or image) to a printer without showing a print dialog.
Out-ClipboardToPrinterSilent
Print-Clipboard
- Alias for Out-ClipboardToPrinterpclip
- Alias for Out-ClipboardToPrinterpclips
- Alias for Out-ClipboardToPrinterSilent
# Copy text to clipboard first, then:
Print-Clipboard
# or use the shorter alias:
pclip
# Copy an image to clipboard first, then:
Out-ClipboardToPrinter
# Print clipboard content without showing a print dialog:
pclips
# or use the full command:
Out-ClipboardToPrinterSilent
- 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
© Alessandro. All rights reserved.