Class XpsSaveOptions

XpsSaveOptions class

Save options for export to Xps format

public class XpsSaveOptions : UnifiedSaveOptions, IPipelineOptions


XpsSaveOptions()The default constructor.


BatchSize { get; set; }Defines batch size if batched conversion is applicable to source and destination formats pair.
CloseResponse { get; set; }Gets or sets boolean value which indicates will Response object be closed after document saved into response.
ExtractOcrSublayerOnly { get; set; }This atrribute turned on functionality for extracting image or text for PDF documents with OCR sublayer.
SaveFormat { get; }Format of data save.
SaveTransparentTexts { get; set; }Indicates whether to preserve transparent (OCR’ed) text.
WarningHandler { get; set; }Callback to handle any warnings generated. The WarningHandler returns ReturnAction enum item specifying either Continue or Abort. Continue is the default action and the Save operation continues, however the user may also return Abort in which case the Save operation should cease.


TryMergeAdjacentSameBackgroundImagesSometimes PDFs contain background images (of pages or table cells) constructed from several same tiling background images put one near other. In such case renderers of target formats (f.e MsWord for DOCS format) sometimes generates visible boundaries beetween parts of background images, cause their techniques of image edge smoothing (anti-aliasing) is different from Acrobat Reader. If it looks like exported document contains such visible boundaries between parts of same background images, please try use this setting to get rid of that unwanted effect. ATTENTION! This optimization of quality usually essentially slows down conversion, so, please, use this option only when it’s really necessary.


The following example shows how to convert PDF file to XPS file

	// The path to the documents directory.
	string dataDir = "YOUR_DATA_DIRECTORY";

	// The path to your PDF File
	var pdfFile = Path.Combine(dataDir, "PDF-to-XPS.pdf");

	// The path to your XPS File
	var xpsFile= Path.Combine(dataDir, "PDF-to-XPS.xps");
	using (Document pdfDocument = new Document(pdfFile))
		// Initialize XpsSaveOptions	
		XpsSaveOptions saveOptions = new XpsSaveOptions();
		// Save XPS file
		pdfDocument.Save(xpsFile, saveOptions);
    ' The path to the documents directory.
    Dim dataDir As String = "YOUR_DATA_DIRECTORY"

    ' The path to your PDF File
    Dim pdfFile = Path.Combine(dataDir, "PDF-to-XPS.pdf")

    ' The path to your XPS File
    Dim xpsFile = Path.Combine(dataDir, "PDF-to-XPS.xps")
    Using pdfDocument As Document = New Document(pdfFile)
        ' Initialize XpsSaveOptions
        Dim saveOptions As XpsSaveOptions = New XpsSaveOptions()
        ' Save XPS file
        pdfDocument.Save(xpsFile, saveOptions)
    End Using

See Also