Documentation
On this page

Function · Desktop Services

printFile

Sends a local file to the operating system's print workflow.

@sharpts/gui · SharpTS 572a2e31be0e

Signature

TypeScript
printFile(path: string): Promise<void>

Parameters

NameTypeDescription
pathstringLocal file path to print.

Returns

Promise<void> — A promise completed after the native print request is submitted.

Remarks

This operation is currently supported only on Windows and uses the file type's registered print verb.

Throws

  • When the platform is unsupported, the path is empty or missing, or no application can handle the print request.

Examples

TypeScript
import { printFile } from "@sharpts/gui";

await printFile("output/report.pdf");

Source

src/SharpTS.Gui.Sdk/GuiPackage/runtime.ts:1726 at SharpTS revision 572a2e31be0e2a09be0138bc44501b34d6245b51.