Class PrintOptions
Namespace: Aspose.Note.Saving
Assembly: Aspose.Note.dll (25.6.0)
Options used to print a document.
public class PrintOptions
{
public bool HeaderFooter { get; set; }
public bool OddAndEvenPagesHeaderFooter { get; set; }
public bool FirstPageNumber { get; set; }
public bool Duplex { get; set; }
public bool PrintToOneSide { get; set; }
public bool CenterHorizontallyOnPage { get; set; }
public bool CenterVerticallyOnPage { get; set; }
public int Copies { get; set; }
public bool CollateCopies { get; set; }
public bool PrintManualDuplex { get; set; }
public bool BackgroundGraphicTile { get; set; }
public bool HiddenMarkUp { get; set; }
public bool MarkAsFinal { get; set; }
public bool PrintErrorDocument { get; set; }
}
Inheritance
Inherited Members
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Shows how to sent document to a printer using standard Windows dialog with specified options.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
var document = new Aspose.Note.Document(dataDir + "Aspose.one");
var printerSettings = new PrinterSettings()
{
FromPage = 0,
ToPage = 10
};
printerSettings.DefaultPageSettings.Landscape = true;
printerSettings.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(50, 50, 150, 50);
document.Print(new PrintOptions()
{
PrinterSettings = printerSettings,
Resolution = 1200,
PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(),
DocumentName = "Test.one"
});
Constructors
PrintOptions()
public PrintOptions()
{
}
Properties
DocumentName
Gets or sets the document name to display (for example, in a print status dialog box or printer queue) while printing the document.
public string DocumentName
{
get;
private set;
}
Property Value
Examples
Shows how to sent document to a printer using standard Windows dialog with specified options.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
var document = new Aspose.Note.Document(dataDir + "Aspose.one");
var printerSettings = new PrinterSettings()
{
FromPage = 0,
ToPage = 10
};
printerSettings.DefaultPageSettings.Landscape = true;
printerSettings.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(50, 50, 150, 50);
document.Print(new PrintOptions()
{
PrinterSettings = printerSettings,
Resolution = 1200,
PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(),
DocumentName = "Test.one"
});
PageSplittingAlgorithm
Gets or sets algorithm used for page splitting.
public PageSplittingAlgorithm PageSplittingAlgorithm
{
get;
set;
}
In this reformatted version, I've followed the general C# formatting conventions as follows:
- Proper indentation: Each level of nesting is indented by 4 spaces.
- Spacing: There's a single space after commas, colons and before closing braces.
- General readability improvements: Line breaks have been added for better legibility.
- No other changes or assumptions as per your requirements.
Property Value
Examples
Shows how to sent document to a printer using standard Windows dialog with specified options.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
var document = new Aspose.Note.Document(dataDir + "Aspose.one");
var printerSettings = new PrinterSettings()
{
FromPage = 0,
ToPage = 10
};
printerSettings.DefaultPageSettings.Landscape = true;
printerSettings.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(50, 50, 150, 50);
document.Print(new PrintOptions()
{
PrinterSettings = printerSettings,
Resolution = 1200,
PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(),
DocumentName = "Test.one"
});
PrinterSettings
Gets or sets the printer settings.
public PrinterSettings PrinterSetting
{
get => this.PrinterSettings;
set => this.PrinterSettings = value;
}
Property Value
Examples
Shows how to sent document to a printer using standard Windows dialog with specified options.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
var document = new Aspose.Note.Document(dataDir + "Aspose.one");
var printerSettings = new PrinterSettings()
{
FromPage = 0,
ToPage = 10
};
printerSettings.DefaultPageSettings.Landscape = true;
printerSettings.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(50, 50, 150, 50);
document.Print(new PrintOptions()
{
PrinterSettings = printerSettings,
Resolution = 1200,
PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(),
DocumentName = "Test.one"
});
Resolution
Gets or sets the resolution for the generated images, in dots per inch.
public float Resolution
{
get;
private set;
}
Property Value
Examples
Shows how to sent document to a printer using standard Windows dialog with specified options.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
var document = new Aspose.Note.Document(dataDir + "Aspose.one");
var printerSettings = new PrinterSettings()
{
FromPage = 0,
ToPage = 10
};
printerSettings.DefaultPageSettings.Landscape = true;
printerSettings.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(50, 50, 150, 50);
document.Print(new PrintOptions()
{
PrinterSettings = printerSettings,
Resolution = 1200,
PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(),
DocumentName = "Test.one"
});
Remarks
The default value is 96.