Send-OfficePrinter
Prints a document of any format OfficeIMO converts to PDF on an explicitly named printer queue or IPP printer. Requires PowerShell 7.4 or newer.
Syntax
Send-OfficePrinter
[-Copies <Int32>]
[-Dpi <Double>]
[-Duplex <PrinterDefault| SingleSided| LongEdge| ShortEdge>]
[-Grayscale]
[-Margin <OfficeLength>]
[-Orientation <Portrait| Landscape>]
[-OutputPath <String>]
[-Page <OfficePageSelector>]
[-PagesPerSheet <1| 2| 4| 6| 9>]
[-PageSubset <All| Odd| Even>]
[-PaperSize <OfficePageSize>]
[-PaperSourceId <String>]
[-Password <SecureString>]
[-Path] <String[]>
-PrinterName <String>
[-RasterizeGrayscale]
[-ScaleMode <Fit| ActualSize| Fill>]
[<CommonParameters>]#PathSend-OfficePrinter
[-Copies <Int32>]
[-Dpi <Double>]
[-Duplex <PrinterDefault| SingleSided| LongEdge| ShortEdge>]
[-Grayscale]
-LiteralPath <String[]>
[-Margin <OfficeLength>]
[-Orientation <Portrait| Landscape>]
[-OutputPath <String>]
[-Page <OfficePageSelector>]
[-PagesPerSheet <1| 2| 4| 6| 9>]
[-PageSubset <All| Odd| Even>]
[-PaperSize <OfficePageSize>]
[-PaperSourceId <String>]
[-Password <SecureString>]
-PrinterName <String>
[-RasterizeGrayscale]
[-ScaleMode <Fit| ActualSize| Fill>]
[<CommonParameters>]#LiteralPathDescription
PDF files are printed directly; other documents are converted to PDF in memory first, and conversion warnings are written as warnings. Send-OfficePdfPrinter remains an alias of this command. PrinterName accepts an installed queue name or an ipp:// or ipps:// printer URI.
Without PaperSize, sheets use the printer's default media. The returned receipt proves queue acceptance, not physical delivery. Follow it with Get-OfficePrintJob, and check the queue after an interrupted submission before retrying.
Examples
Print selected PDF pages as two pages per sheet.
Send-OfficePrinter -Path .\Report.pdf -PrinterName 'Office printer' -Page '1-3' -PagesPerSheet 2 -Duplex LongEdgePrint a Word document to an IPP printer and wait for it to finish.
Send-OfficePrinter -Path .\Letter.docx -PrinterName 'ipp://printer.local/ipp/print' | Get-OfficePrintJob -WaitPrint odd pages four to a sheet in grayscale.
Send-OfficePrinter -Path .\Report.pdf -PrinterName 'Office printer' -PageSubset Odd -PagesPerSheet 4 -GrayscaleParameters
- -Copies Int32
- Copies submitted to the queue.
- -Dpi Double
- Highest resolution used when sheets are rasterized for delivery.
- -Duplex String
- Duplex setting.
- Possible values:
PrinterDefault,SingleSided,LongEdge,ShortEdge - -Grayscale SwitchParameter
- Print in grayscale, regardless of the device's color support. IPP printers and CUPS queues reached over IPP that list monochrome printing receive the vector PDF and convert it to gray themselves; others receive gray raster sheets.
- -Margin OfficeLength
- Printable margin in points.
- -Orientation OfficePageOrientation
- Paper orientation. When omitted, each sheet takes the orientation that places its pages largest, so two-up and six-up sheets of portrait pages print in landscape.
- Possible values:
Portrait,Landscape - -OutputPath String
- New destination file for a Windows file printer.
- -Page OfficePageSelector
- Page selection such as 1-3,last.
- -PagesPerSheet Int32
- Source pages per sheet, in row-major order.
- Possible values:
1,2,4,6,9 - -PageSubset String
- Keep all selected pages, or only odd or even original page numbers.
- Possible values:
All,Odd,Even - -PaperSize OfficePageSize
- Paper size. Defaults to the printer's default media, or A4 when the printer reports none.
- -PaperSourceId String
- Paper source identifier reported by Get-OfficePrinterCapability.
- -Password SecureString
- Password for an encrypted PDF; printing permissions remain enforced.
- -Path String[]
- Local document to print: PDF or any format OfficeIMO converts to PDF.
- -PrinterName String
- Installed queue from Get-OfficePrinter, or an ipp:// or ipps:// printer URI.
- -RasterizeGrayscale SwitchParameter
- With Grayscale, always send gray raster sheets, so the printout matches the preview pixel for pixel. Slower than letting the printer convert vector PDF. Windows queues always receive raster sheets.
- -ScaleMode String
- Scaling of source pages.
- Possible values:
Fit,ActualSize,Fill - -LiteralPath String[]
- Literal document paths, including FileInfo.FullName.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.