PdfDocumentPrintToFile Method (String, Boolean)

Prints this PDF by sending it to the computer's printer.

For advanced real-world printing options please see overloads GetPrintDocument.

the file path, when printing to a file, set or an empty string ("") for printing output is sent to a port instead of the filePath. The default value is .if print preview dialogs will be displayed to the user. Default value is .

Namespace:  IronPdf
Assembly:  IronPdf (in IronPdf.dll) Version: 2020.10.3
public int PrintToFile(
	string filePath,
	bool showPreview = false


Type: SystemString
showPreview (Optional)
Type: SystemBoolean

Return Value

Type: Int32
The number of printed pages.
See Also
Download DLL or Install with Nuget