asposecells.api

Class HtmlLoadOptions

Represents options when importing a html file.

Constructor Summary
HtmlLoadOptions()
Creates an options of loading the file.
HtmlLoadOptions(loadFormat)
Creates an options of loading the file.
 
Property Getters/Setters Summary
methodgetAttachedFilesDirectory()
method
           The directory that the attached files will be saved to.
methodgetAutoFilter()
method
           Indicates whether auto filtering the data when loading the files.
methodgetAutoFitColsAndRows()
method
           Indicates whether auto-fit columns and rows. The default value is false.
methodgetAutoFitterOptions()
method
           Gets and sets the auto fitter options
methodgetCheckDataValid()
method
           Check whether data is valid in the template file.
methodgetCheckExcelRestriction()
method
           Whether check restriction of excel file when user modify cells related objects. For example, excel does not allow inputting string value longer than 32K. When you input a value longer than 32K such as by Cell.PutValue(string), if this property is true, you will get an Exception. If this property is false, we will accept your input string value as the cell's value so that later you can output the complete string value for other file formats such as CSV. However, if you have set such kind of value that is invalid for excel file format, you should not save the workbook as excel file format later. Otherwise there may be unexpected error for the generated excel file.
methodgetConvertDateTimeData()
method
           Gets or sets a value that indicates whether the string in text file is converted to date data.
methodgetConvertFormulasData()
method
           if true, convert string to formula when string value starts with character '=',the default value is false.
methodgetConvertNumericData()
method
           Gets or sets a value that indicates whether the string in text file is converted to numeric data.
methodgetDefaultStyleSettings()
Gets the default style settings for initializing styles of the workbook
methodgetDeleteRedundantSpaces()
method
           Indicates whether delete redundant spaces when the text wraps lines using <br> tag. The default value is false.
methodgetEncoding()
method
           Gets and sets the default encoding. Only applies for csv file.
methodgetFontConfigs()
method
           Gets and sets individual font configs. Only works for the Workbook which uses this LoadOptions to load.
methodhasFormula()
method
           Indicates whether the text is formula if it starts with "=".
methodgetIgnoreNotPrinted()
method
           Ignore the data which are not printed if directly printing the file
methodgetIgnoreUselessShapes()
method
           Indicates whether ignoring useless shapes.
methodgetInterruptMonitor()
method
           Gets and sets the interrupt monitor.
methodgetKeepPrecision()
method
           Indicates whether not parsing a string value if the length is 15.
methodgetKeepUnparsedData()
method
           Whether keep the unparsed data in memory for the Workbook when it is loaded from template file. Default is true.
methodgetLanguageCode()
method
           Gets or sets the user interface language of the Workbook version based on CountryCode that has saved the file. The value of the property is CountryCode integer constant.
methodgetLightCellsDataHandler()
method
           The data handler for processing cells data when reading template file.
methodgetLoadFilter()
method
           The filter to denote how to load data.
methodgetLoadFormat()
Gets the load format. The value of the property is LoadFormat integer constant.
methodgetLoadFormulas()
method
           Indicates whether importing formulas if the original html file contains formulas
methodgetLoadStyleStrategy()
method
           Indicates the strategy to apply style for parsed values when converting string value to number or datetime. The value of the property is TxtLoadStyleStrategy integer constant.
methodgetLocale()
method
setLocale(value)
           Gets and sets the Locale used for workbook at the time the file was loaded.
methodgetMemorySetting()
method
           Gets or sets the memory usage options. The value of the property is MemorySetting integer constant.
methodgetParsingFormulaOnOpen()
method
           Indicates whether parsing the formula when reading the file.
methodgetParsingPivotCachedRecords()
method
           Indicates whether parsing pivot cached records when loading the file. The default value is false.
methodgetPassword()
method
           Gets and set the password of the workbook.
methodgetPreservePaddingSpacesInFormula()
method
           Indicates whether preserve those spaces and line breaks that are padded between formula tokens while getting and setting formulas. Default value is false.
methodgetProgId()
Gets the program id of creating the file. Only for MHT files.
methodgetRegion()
method
setRegion(value)
           Gets or sets the system regional settings based on CountryCode at the time the file was loaded. The value of the property is CountryCode integer constant.
methodgetStandardFont()
method
           Sets the default standard font name
methodgetStandardFontSize()
method
           Sets the default standard font size.
methodgetSupportDivTag()
method
           Indicates whether support the layout of <div> tag when the html file contains it. The default value is false.
methodgetTableLoadOptions()
Get the HtmlTableLoadOptionCollection instance
methodgetWarningCallback()
method
           Gets or sets warning callback.
 
Method Summary
methodsetPaperSize(type)
Sets the default print paper size from default printer's setting.
 

    • Constructor Detail

      • HtmlLoadOptions

        HtmlLoadOptions()
        Creates an options of loading the file.
      • HtmlLoadOptions

        HtmlLoadOptions(loadFormat)
        Creates an options of loading the file.
        Parameters:
        loadFormat: int - A LoadFormat value. The loading format.
    • Property Getters/Setters Detail

      • getAttachedFilesDirectory/setAttachedFilesDirectory : String 

        String getAttachedFilesDirectory() / setAttachedFilesDirectory(value)
        
        The directory that the attached files will be saved to. NOTE: This member is now obsolete. Instead, please use HtmlLoadOptions.StreamProvider property. This property will be removed 12 months later since December 2014. Aspose apologizes for any inconvenience you may have experienced.
      • getLoadFormulas/setLoadFormulas : boolean 

        boolean getLoadFormulas() / setLoadFormulas(value)
        
        Indicates whether importing formulas if the original html file contains formulas
      • getSupportDivTag/setSupportDivTag : boolean 

        boolean getSupportDivTag() / setSupportDivTag(value)
        
        Indicates whether support the layout of <div> tag when the html file contains it. The default value is false.
      • getDeleteRedundantSpaces/setDeleteRedundantSpaces : boolean 

        boolean getDeleteRedundantSpaces() / setDeleteRedundantSpaces(value)
        
        Indicates whether delete redundant spaces when the text wraps lines using <br> tag. The default value is false.
      • getAutoFitColsAndRows/setAutoFitColsAndRows : boolean 

        boolean getAutoFitColsAndRows() / setAutoFitColsAndRows(value)
        
        Indicates whether auto-fit columns and rows. The default value is false.
      • getConvertFormulasData/setConvertFormulasData : boolean 

        boolean getConvertFormulasData() / setConvertFormulasData(value)
        
        if true, convert string to formula when string value starts with character '=',the default value is false. NOTE: This property is now obsolete. Instead, please use HtmlLoadOptions.HasFormula property. This property will be removed 12 months later since March 2023. Aspose apologizes for any inconvenience you may have experienced.
      • hasFormula/setHasFormula : boolean 

        boolean hasFormula() / setHasFormula(value)
        
        Indicates whether the text is formula if it starts with "=".
      • getProgId : String 

        String getProgId()
        
        Gets the program id of creating the file. Only for MHT files.
      • getEncoding/setEncoding : Encoding 

        Encoding getEncoding() / setEncoding(value)
        
        Gets and sets the default encoding. Only applies for csv file.
      • getLoadStyleStrategy/setLoadStyleStrategy : int 

        int getLoadStyleStrategy() / setLoadStyleStrategy(value)
        
        Indicates the strategy to apply style for parsed values when converting string value to number or datetime. The value of the property is TxtLoadStyleStrategy integer constant.
      • getConvertNumericData/setConvertNumericData : boolean 

        boolean getConvertNumericData() / setConvertNumericData(value)
        
        Gets or sets a value that indicates whether the string in text file is converted to numeric data.
      • getConvertDateTimeData/setConvertDateTimeData : boolean 

        boolean getConvertDateTimeData() / setConvertDateTimeData(value)
        
        Gets or sets a value that indicates whether the string in text file is converted to date data.
      • getKeepPrecision/setKeepPrecision : boolean 

        boolean getKeepPrecision() / setKeepPrecision(value)
        
        Indicates whether not parsing a string value if the length is 15.
      • getLoadFormat : int 

        int getLoadFormat()
        
        Gets the load format. The value of the property is LoadFormat integer constant.
      • getPassword/setPassword : String 

        String getPassword() / setPassword(value)
        
        Gets and set the password of the workbook.
      • getParsingFormulaOnOpen/setParsingFormulaOnOpen : boolean 

        boolean getParsingFormulaOnOpen() / setParsingFormulaOnOpen(value)
        
        Indicates whether parsing the formula when reading the file. Only applies for Excel Xlsx, Xltx, Xltm and Xlsm file because the formulas in the files are stored with a string formula.
      • getParsingPivotCachedRecords/setParsingPivotCachedRecords : boolean 

        boolean getParsingPivotCachedRecords() / setParsingPivotCachedRecords(value)
        
        Indicates whether parsing pivot cached records when loading the file. The default value is false. Only applies for Excel Xlsx, Xltx, Xltm , Xlsm and xlsb file
      • getLanguageCode/setLanguageCode : int 

        int getLanguageCode() / setLanguageCode(value)
        
        Gets or sets the user interface language of the Workbook version based on CountryCode that has saved the file. The value of the property is CountryCode integer constant.
      • getRegion/setRegion : int 

        int getRegion() / setRegion(value)
        
        Gets or sets the system regional settings based on CountryCode at the time the file was loaded. The value of the property is CountryCode integer constant.If you do not want to use the region saved in the file, please reset it after reading the file.
      • getLocale/setLocale : Locale 

        Locale getLocale() / setLocale(value)
        
        Gets and sets the Locale used for workbook at the time the file was loaded.
      • getStandardFont/setStandardFont : String 

        String getStandardFont() / setStandardFont(value)
        
        Sets the default standard font name NOTE: This member is now obsolete. Instead, please use DefaultStyleSettings. This property will be removed 12 months later since March 2022. Aspose apologizes for any inconvenience you may have experienced.
      • getStandardFontSize/setStandardFontSize : float 

        float getStandardFontSize() / setStandardFontSize(value)
        
        Sets the default standard font size. NOTE: This member is now obsolete. Instead, please use DefaultStyleSettings. This property will be removed 12 months later since March 2022. Aspose apologizes for any inconvenience you may have experienced.
      • getIgnoreNotPrinted/setIgnoreNotPrinted : boolean 

        boolean getIgnoreNotPrinted() / setIgnoreNotPrinted(value)
        
        Ignore the data which are not printed if directly printing the file Only for xlsx file.
      • getCheckDataValid/setCheckDataValid : boolean 

        boolean getCheckDataValid() / setCheckDataValid(value)
        
        Check whether data is valid in the template file.
      • getCheckExcelRestriction/setCheckExcelRestriction : boolean 

        boolean getCheckExcelRestriction() / setCheckExcelRestriction(value)
        
        Whether check restriction of excel file when user modify cells related objects. For example, excel does not allow inputting string value longer than 32K. When you input a value longer than 32K such as by Cell.PutValue(string), if this property is true, you will get an Exception. If this property is false, we will accept your input string value as the cell's value so that later you can output the complete string value for other file formats such as CSV. However, if you have set such kind of value that is invalid for excel file format, you should not save the workbook as excel file format later. Otherwise there may be unexpected error for the generated excel file.
      • getKeepUnparsedData/setKeepUnparsedData : boolean 

        boolean getKeepUnparsedData() / setKeepUnparsedData(value)
        
        Whether keep the unparsed data in memory for the Workbook when it is loaded from template file. Default is true. For scenarios that user only needs to read some contents from template file and does not need to save the workbook back, set this property as false may improve performance, especially when using it together with some kind of LoadFilter,
      • getLoadFilter/setLoadFilter : LoadFilter 

        LoadFilter getLoadFilter() / setLoadFilter(value)
        
        The filter to denote how to load data.
      • getLightCellsDataHandler/setLightCellsDataHandler : LightCellsDataHandler 

        LightCellsDataHandler getLightCellsDataHandler() / setLightCellsDataHandler(value)
        
        The data handler for processing cells data when reading template file.
      • getMemorySetting/setMemorySetting : int 

        int getMemorySetting() / setMemorySetting(value)
        
        Gets or sets the memory usage options. The value of the property is MemorySetting integer constant.
      • getWarningCallback/setWarningCallback : IWarningCallback 

        IWarningCallback getWarningCallback() / setWarningCallback(value)
        
        Gets or sets warning callback.
      • getAutoFitterOptions/setAutoFitterOptions : AutoFitterOptions 

        AutoFitterOptions getAutoFitterOptions() / setAutoFitterOptions(value)
        
        Gets and sets the auto fitter options Only for xlsx ,spreadsheetML file now.
      • getAutoFilter/setAutoFilter : boolean 

        boolean getAutoFilter() / setAutoFilter(value)
        
        Indicates whether auto filtering the data when loading the files. Sometimes although autofilter is set, the corresponding rows is not hidden in the file. Now only works for SpreadSheetML file.
      • getIgnoreUselessShapes/setIgnoreUselessShapes : boolean 

        boolean getIgnoreUselessShapes() / setIgnoreUselessShapes(value)
        
        Indicates whether ignoring useless shapes. Only works for xlsx,xlsb, and xlsm files. There are many overlapping identical shapes which are useless in some files, we can ingore them when loading files.
      • getPreservePaddingSpacesInFormula/setPreservePaddingSpacesInFormula : boolean 

        boolean getPreservePaddingSpacesInFormula() / setPreservePaddingSpacesInFormula(value)
        
        Indicates whether preserve those spaces and line breaks that are padded between formula tokens while getting and setting formulas. Default value is false. After loading workbook from template file with this option, FormulaSettings.PreservePaddingSpaces will be set to the same value with this property.
    • Method Detail

      • setPaperSize

         setPaperSize(type)
        Sets the default print paper size from default printer's setting. If there is no setting about paper size,MS Excel will use default printer's setting.
        Parameters:
        type: int - A PaperSizeType value. The default paper size.