ExportOptions.GetOptionVisibility(ExportOptionKind) Method
Gets the current visibility of the specified export option in the Print Preview.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.Printing.v22.2.Core.dll
NuGet Packages: DevExpress.Printing.Core, DevExpress.Win.Dashboard.Design
Declaration
Parameters
Name | Type | Description |
---|---|---|
optionKind | ExportOptionKind | An ExportOptionKind enumeration value which specifies the export option whose visibility state is to be determined. |
Returns
Type | Description |
---|---|
Boolean | true if the specified export option is visible; otherwise, false. |
Remarks
To change the visibility of the specified export option, the ExportOptions.SetOptionVisibility or ExportOptions.SetOptionsVisibility methods should be used.
Example
This example illustrates how to hide some of the export options from a print preview by using the ExportOptions.SetOptionVisibility and ExportOptions.SetOptionsVisibility methods.
The following code hides some of the PDF-specific export options.
All available export options are listed in the ExportOptionKind enumeration.
using System.Drawing;
using DevExpress.XtraPrinting;
// ...
private void Form1_Load(object sender, EventArgs e) {
PrintingSystem ps = new PrintingSystem();
documentViewer1.PrintingSystem = ps;
// Draw a simple text brick.
ps.Begin();
ps.Graph.DrawString("Some Text", new RectangleF(0, 20, 200, 20));
ps.End();
// Obtain its Export options.
ExportOptions options = ps.ExportOptions;
// Hide the "Never Embedded Fonts" option, if required.
if(options.GetOptionVisibility(ExportOptionKind.PdfNeverEmbeddedFonts) != false) {
options.SetOptionVisibility(ExportOptionKind.PdfNeverEmbeddedFonts, false);
}
// Hide all Document Options for PDF export.
options.SetOptionsVisibility(new ExportOptionKind[] { ExportOptionKind.PdfDocumentApplication,
ExportOptionKind.PdfDocumentAuthor, ExportOptionKind.PdfDocumentKeywords,
ExportOptionKind.PdfDocumentSubject, ExportOptionKind.PdfDocumentTitle}, false);
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetOptionVisibility(ExportOptionKind) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.