- addBookmark
- addBreak
- addChart
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addPageNumber
- addShape
- addSimpleField
- addStructuredDocumentTag
- addTable
- addTableContents
- addText
- addTextBox
- addWordML
- embedHTML
pdx:setLanguage
Sets the default language of the Word document.
Description
Sets the default language for the whole Word document.
This is important for grammar and spell checking in the Word interface.
Attributes and sub-elements
value
The language-country ISO codes: en-US, es-ES.
Code samples
#Example 1
config.xml
content.xml
20
1
2
<pdx:document xmlns:pdx="http://www.phpdocx.com/main">
3
<pdx:content>
4
<pdx:addText>
5
<pdx:textRun>
6
<pdx:data pdx:dataId="" pdx:dataType="text">Este texto está en español y no debería estar marcado si se utiliza el corrector ortográfico.</pdx:data>
7
<pdx:textRunStyle>
8
</pdx:textRunStyle>
9
</pdx:textRun>
10
</pdx:addText>
11
<pdx:addText>
12
<pdx:textRun>
13
<pdx:data pdx:dataId="" pdx:dataType="text">Now in english.</pdx:data>
14
<pdx:textRunStyle>
15
</pdx:textRunStyle>
16
</pdx:textRun>
17
</pdx:addText>
18
</pdx:content>
19
</pdx:document>
20
settings.xml
10
1
import os as os
2
import sys as sys
3
sys.path.append(os.path.abspath("wrappers/python/XmlDocx"))
4
import XmlDocx as XmlDocx
5
document = XmlDocx.XmlDocx("config.xml")
6
document.setDocumentProperties("settings.xml")
7
document.addContent("content.xml")
8
document.setXmlDocxPath("xmldocx path")
9
document.render()
10