Overview
ThePrintOptions interface defines all configuration options available for individual print operations. These options can be passed to $print() or printComponent() methods to customize the printing behavior.
Properties
Window name for the print window. Determines the target window for the print operation.
Window specifications for the print window. Can be either:
- An array of window feature strings (e.g.,
['width=800', 'height=600']) - An object with
widthandheightproperties in pixels
Array of custom CSS styles to apply to the printed content. Each string should be valid CSS.Example:
Delay in milliseconds before triggering the print dialog. Allows time for content and styles to load.
Whether to automatically close the print window after printing completes or is cancelled.
Custom title for the print window. This will appear in the browser tab and printed page header.
Whether to preserve the original page styles when printing. If
false, only custom styles will be applied.Callback function executed before the print dialog opens. Can be synchronous or asynchronous.Example:
Callback function executed after the print dialog closes. Can be synchronous or asynchronous.Example:
Callback function executed when a print error occurs. Receives the error object as a parameter.Example:
Whether to use the bridge plugin for direct printing. When
true, requires the bridge plugin to be installed and configured.Name of the specific printer to use with bridge printing. Only applicable when
useBridge is true.Number of copies to print. Only applicable when using bridge printing (
useBridge: true).Content type for bridge printing. Only applicable when using bridge printing (
useBridge: true).'html': Print HTML content directly'pdf': Convert content to PDF before printing
Usage Examples
Basic Print with Custom Styles
Print with Callbacks
Bridge Printing (Direct to Printer)
Custom Window Specifications
See Also
- GlobalPrintOptions - Global configuration options
- usePrint Composable - Using print options with the composable
- $print Method - Using print options with the global method