PdfDocumentPrintToFile Method (Int32, String, Boolean)

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

For advanced real-world printing options please see overloads of this method and also GetPrintDocument.

the horizontal and vertical PDF resolutions, in dots per inch. if -1 print with default printer resolution. Default value is -1.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.7.1
public int PrintToFile(
	int dpi,
	string filePath = null,
	bool showPreview = false


Type: SystemInt32
filePath (Optional)
Type: SystemString
showPreview (Optional)
Type: SystemBoolean

Return Value

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