XpsSaveOptions Class
Represents options for saving to XML Paper Specification file format.
public sealed class XpsSaveOptions : SaveOptions
Public NotInheritable Class XpsSaveOptions
Inherits SaveOptions
- Inheritance:
- System.ObjectXpsSaveOptions
Constructors
XpsSaveOptions()
Initializes a new instance of the XpsSaveOptions class.
Properties
ContentType
Gets the content-type for XPS file format: application/vnd.ms-xpsdocument.
public override string ContentType { get; }
Public Overrides ReadOnly Property ContentType As String
Property Value
- System.String
The content-type for XPS file format.
Overrides
Limitations
Gets limitations for saving to XPS file format.
public override FileFormatLimitations Limitations { get; }
Public Overrides ReadOnly Property Limitations As FileFormatLimitations
Property Value
Overrides
Remarks
These are the limits:
- MaxRows: System.Int32.MaxValue
- MaxColumns: System.Int32.MaxValue
- MaxColors: System.Int32.MaxValue
- MaxCellStyles: System.Int32.MaxValue
MetafileScaleFactor
Gets or sets the scaling factor for rendering metafile (WMF and EMF) images. Greater scaling factor improves quality but also increases file size. Default value is 1.
public double MetafileScaleFactor { get; set; }
Public Property MetafileScaleFactor As Double
Property Value
- System.Double
The metafile scale factor for rendering metafile (WMF and EMF) images.
Remarks
Windows Metafile Format (WMF) and Enhanced Metafile Format (EMF) are vector image formats which contain a series of graphics drawing commands usually executed in Windows GDI layer.
Metafile drawing commands could also be executed in PDF (or XPS) file which is also vector format, but for that Metafile drawing commands would have to be converted to PDF drawing commands.
GemBox.Document currently doesn't perform this conversion of drawing commands, instead it uses Windows GDI to execute Metafile drawing commands into bitmap which is then encoded to PNG format and embedded into PDF file.
MetafileScaleFactor specifies the size of the bitmap surface, based from the original Metafile surface size, into which Metafile should be drawn / rasterized.
PDF viewer will still scale the bitmap to the original Metafile size, but if the page is zoomed or viewed on a larger surface, quality of the image will be better since it contains more pixels / dots which will become visible while PDF viewer scales down the image.
MetafileScaleFactor increases the quality of the Metafile image in PDF file, but it also increases the size of the PDF file because greater MetafileScaleFactor means greater bitmap surface and more space to store bitmap pixel / color data. PNG encoding / compression helps in reducing the space requirement and for complex Metafiles (with a lot of drawing instructions), MetafileScaleFactor of 5 or even greater, might not incur any space overhead relative to the original (complex) Metafile.
Default value for MetafileScaleFactor is 1.
RenderingMode
Gets or sets the rendering mode used when saving the content to an XML Paper Specification (XPS) file.
public RenderingMode RenderingMode { get; set; }
Public Property RenderingMode As RenderingMode
Property Value
The rendering mode used when saving the content to an XML Paper Specification (XPS) file.
Exceptions
- System.NotSupportedException
The rendering mode is not supported because of the reasons explained in the exception's System.Exception.Message.
SelectionType
Gets or sets a value indicating whether to save the whole ExcelFile or just ActiveWorksheet.
public SelectionType SelectionType { get; set; }
Public Property SelectionType As SelectionType
Property Value
Inherited Properties
CsvDefault | Gets the default options for saving to Character Separated Values file format. (Inherited from SaveOptions) |
HtmlDefault | Gets the default options for saving to HyperText Markup Language File format. (Inherited from SaveOptions) |
ImageDefault | Gets the default options for saving to image formats. (Inherited from SaveOptions) |
OdsDefault | Gets the default options for saving to OpenDocument Spreadsheet file format. (Inherited from SaveOptions) |
PdfDefault | Gets the default options for saving to Portable Document Format file. (Inherited from SaveOptions) |
TxtDefault | Gets the default options for saving to Tab delimited file format. (Inherited from SaveOptions) |
XlsDefault | Gets the default options for saving to, XLS file format (Microsoft Excel Spreadsheet format; Excel 2003 and prior versions) . (Inherited from SaveOptions) |
XlsbDefault | Gets the default options for saving to XLSB file format (Microsoft Excel Binary File Format). (Inherited from SaveOptions) |
XlsxDefault | Gets the default options for saving to XLSX file format (Microsoft Excel Open XML Spreadsheet; Excel 2007 and later). (Inherited from SaveOptions) |
XpsDefault | Gets the default options for saving to XML Paper Specification file format. (Inherited from SaveOptions) |