importStyles
- addBackgroundImage
- addFooter
- addHeader
- addLineNumbering
- addPageBorders
- addProperties
- addSection
- createDocx
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importHeadersAndFooters
- importStyles
- modifyPageLayout
- removeFooters
- removeHeaders
- setBackgroundColor
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- addBibliography
- addBookmark
- addBreak
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addPageNumber
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addTable
- addTableContents
- addText
- addTextBox
- addWordML
- embedHTML
- clearBlocks
- deleteTemplateBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- tickCheckbox
importStyles
BASIC / ADVANCED / PREMIUM
Imports Word styles from an external Word document.
Description
public void importStyles(String path, String type) throws Exception
public void importStyles(String path, String type, ArrayList myStyles) throws Exception
public void importStyles(String path, String type, ArrayList myStyles, String styleIdentifier) throws Exception
This method allows to import Word styles from an external Word document.
You may replace the whole stylesheet or just import a certain list of predefined styles.
Parameters
path
The path to the Word document from which you want to import the styles.
type
The available options are:
- "replace" if you wish to overwrite the whole stylesheet.
- "merge" if you only want to import the styles listed in myStyles.
myStyles
An ArrayList with all the names of the styles that you wish to import. .
styleIdentifier
The possible values are:
- "styleName" (default value) if you wish to identify the styles included in $myStyles array by their name.
- "styleID" if you want to use their id.