Xamarin.iOS

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SaveOptions - Xamarin.iOS API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SaveOptions

    Represents the document saving options.

    Inheritance
    System.Object
    SaveOptions
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Portable.dll
    Syntax
    public class SaveOptions : Object
    Examples

    The following code snippet shows how to customize Word to HTML conversion using SaveOptions.

    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Loads an existing document
        WordDocument document = new WordDocument("Template.docx");
        HTMLExport export = new HTMLExport();
        //The images in the input document will be copied to this folder
        document.SaveOptions.HtmlExportImagesFolder = @"D:\Data\";
        //The headers and footers in the input will be exported
        document.SaveOptions.HtmlExportHeadersFooters = true;
        //Export the text form fields as editable
        document.SaveOptions.HtmlExportTextInputFormFieldAsText = false;
        //Set the style sheet type
        document.SaveOptions.HtmlExportCssStyleSheetType = CssStyleSheetType.External;
        //Set name for style sheet
        document.SaveOptions.HtmlExportCssStyleSheetFileName = "UserDefinedFileName.css";
        //Save the document as html file
        export.SaveAsXhtml(document, "WordtoHtml.html");
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Loads an existing document
        Dim document As New WordDocument("Template.docx")
        Dim export As New HTMLExport()
        'The images in the input document will be copied to this folder
        document.SaveOptions.HtmlExportImagesFolder = "D:\Data\"
        'The headers and footers in the input will be exported
        document.SaveOptions.HtmlExportHeadersFooters = True
        'Export the text form fields as editable
        document.SaveOptions.HtmlExportTextInputFormFieldAsText = False
        'Set the style sheet type
        document.SaveOptions.HtmlExportCssStyleSheetType = CssStyleSheetType.External
        'Set name for style sheet
        document.SaveOptions.HtmlExportCssStyleSheetFileName = "UserDefinedFileName.css"
        'Save the document as html file
        export.SaveAsXhtml(document, "WordtoHtml.html")
        document.Close()
    End Sub

    The following code snippet shows how to customize Word to EPub file conversion using SaveOptions.

    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Load an existing document
        WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
        //Export the fonts used in the document
        document.SaveOptions.EPubExportFont = true;
        //Export header and footer
        document.SaveOptions.HtmlExportHeadersFooters = true;
        //Save the document as EPub file
        document.Save("WordToEPub.epub", FormatType.EPub);
        //Close the document
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Load an existing document
        Dim document As New WordDocument("Template.docx", FormatType.Docx)
        'Export the fonts used in the document
        document.SaveOptions.EPubExportFont = True
        'Export header and footer
        document.SaveOptions.HtmlExportHeadersFooters = True
        'Save the document as EPub file
        document.Save("WordToEPub.epub", FormatType.EPub)
        'Close the document
        document.Close()
    End Sub

    The following code snippet shows how to preserve compatibility mode as in the input Word document using SaveOptions.

    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Load an existing document
        WordDocument document = new WordDocument("Template.doc", FormatType.Doc);
        //Preserve compatibility mode as in the input Word document
        document.SaveOptions.MaintainCompatibilityMode = true;
        //Save the document as Docx file
        document.Save("Result.docx", FormatType.Docx);
        //Close the document
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Load an existing document
        Dim document As New WordDocument("Template.doc", FormatType.Doc)
        'Export the fonts used in the document
        document.SaveOptions.EPubExportFont = True
        'Preserve compatibility mode as in the input Word document
        document.SaveOptions.MaintainCompatibilityMode = True
        'Save the document as Docx file
        document.Save("Result.docx", FormatType.Docx)
        'Close the document
        document.Close()
    End Sub

    Constructors

    SaveOptions()

    Declaration
    public SaveOptions()

    Properties

    HtmlExportHeadersFooters

    Gets or sets a value indicating whether to include headers and footers while exporting HTML file.

    Declaration
    public bool HtmlExportHeadersFooters { get; set; }
    Property Value
    Type Description
    System.Boolean

    True if to include headers and footers; otherwise false.

    Remarks

    The header and footer contents in the first page of the document will be exported as first and last content of the exported HTML file.

    HtmlExportOmitXmlDeclaration

    Gets or sets value indicating whether to omit XML declaration in the exported HTML file.

    Declaration
    public bool HtmlExportOmitXmlDeclaration { get; set; }
    Property Value
    Type Description
    System.Boolean

    True if Omit XML declaration in the exported HTML file; false otherwise. Default value is false.

    HtmlExportTextInputFormFieldAsText

    Gets or sets a value indicating whether to export text input form field as text.

    Declaration
    public bool HtmlExportTextInputFormFieldAsText { get; set; }
    Property Value
    Type Description
    System.Boolean

    True if HTML export text input form field as text; otherwise, false.

    Remarks

    By default, the text form fields are preserved as editable fields while exporting the HTML file. This property is only applicable while exporting the Word document as HTML file.

    MaintainCompatibilityMode

    Gets or sets a value indicating whether to preserve compatibility mode as in the input Word document.

    Declaration
    public bool MaintainCompatibilityMode { get; set; }
    Property Value
    Type Description
    System.Boolean

    True if to have the compatibility mode as preserved in the input document; false if to have the compatibility mode based on the save format type.

    OptimizeRtfFileSize

    Gets or sets a value indicating whether to reduce the resultant RTF file size by removing the tags with default values.

    Declaration
    public bool OptimizeRtfFileSize { get; set; }
    Property Value
    Type Description
    System.Boolean

    True The resultant rtf file size is reduced false.

    Remarks

    The default value is false

    Examples
    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Load an existing document
        WordDocument document = new WordDocument("Template.rtf", FormatType.Rtf);
        //Sets the OptmizedRtfFileSize property as true
        document.SaveOptions.OptimizeRtfFileSize = true;
        //Save the document as Docx file
        document.Save("Result.rtf", FormatType.Rtf);
        //Close the document
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Load an existing document
        Dim document As New WordDocument("Template.rtf", FormatType.Rtf)
        'Sets the OptmizedRtfFileSize property as true
        document.SaveOptions.OptimizeRtfFileSize = True
        'Save the document as Docx file
        document.Save("Result.rtf", FormatType.Rtf)
        'Close the document
        document.Close()
    End Sub

    UseContextualSpacing

    Gets or sets value indicating whether the paragraph contextual spacing should be consider in HTML export.

    Declaration
    public bool UseContextualSpacing { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    This property is not supported in UNIVERSAL,UWP,WP and Xamarin application.

    Methods

    add_ImageNodeVisited(ImageNodeVisitedEventHandler)

    Declaration
    public void add_ImageNodeVisited(ImageNodeVisitedEventHandler value)
    Parameters
    Type Name Description
    ImageNodeVisitedEventHandler value

    remove_ImageNodeVisited(ImageNodeVisitedEventHandler)

    Declaration
    public void remove_ImageNodeVisited(ImageNodeVisitedEventHandler value)
    Parameters
    Type Name Description
    ImageNodeVisitedEventHandler value

    Events

    ImageNodeVisited

    Declaration
    public event ImageNodeVisitedEventHandler ImageNodeVisited
    Event Type
    Type Description
    ImageNodeVisitedEventHandler
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved