DocumentPrint Method (PrinterSettings, String) |
Prints the document according to the specified printer settings,
using the standard (no User Interface) print controller and a document name.
Namespace:
Aspose.Words
Assembly:
Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntaxpublic void Print(
PrinterSettings printerSettings,
string documentName
)
Public Sub Print (
printerSettings As PrinterSettings,
documentName As String
)
public:
void Print(
PrinterSettings^ printerSettings,
String^ documentName
)
member Print :
printerSettings : PrinterSettings *
documentName : string -> unit
Parameters
- printerSettings
- Type: System.Drawing.PrintingPrinterSettings
The printer settings to use. - documentName
- Type: SystemString
The document name to display (for example, in a print status dialog
box or printer queue) while printing the document.
RemarksThe PrinterSettings
object allows you to specify the printer to print on, the range of pages of to print and other options.
ExamplesPrints a range of pages along with the name of the document.
Document doc = new Document(MyDir + "Rendering.docx");
PrinterSettings printerSettings = new PrinterSettings();
printerSettings.FromPage = 1;
printerSettings.ToPage = 3;
doc.Print(printerSettings, "Rendering.PrintRangeWithDocumentName.doc");
See Also