- 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:addPageBorders
Adds custom page borders to the current Word document.
Description
Element definition
x
1
<pdx:settings>
2
<pdx:addPageBorders pdx:display="" pdx:color="" pdx:space="" pdx:style="" pdx:width="" pdx:offsetFrom="" pdx:zOrder="">
3
<pdx:top pdx:color="" pdx:space="" pdx:style="" pdx:width="" />
4
<pdx:right pdx:color="" pdx:space="" pdx:style="" pdx:width="" />
5
<pdx:bottom pdx:color="" pdx:space="" pdx:style="" pdx:width="" />
6
<pdx:left pdx:color="" pdx:space="" pdx:style="" pdx:width="" />
7
</pdx:addPageBorders>
8
</pdx:settings>
9
This element allows you to insert page borders into the Word document.
Attributes and sub-elements
key | Description |
---|---|
display |
|
color | Border hexadecimal color ('000000' (default), 'FF0000', ...) |
offsetFrom | Possible values are: 'page' or 'text' |
space | Border spacing in points (default is 24) |
style | Border. It can be none, single (default), double, ... See, for example, http://www.schemacentral.com/sc/ooxml/t-w_ST_Border.html for a complete list of border available styles |
width | Page border width in eigths of a point (default value is 4) |
zOrder | Sets the z-index of the border |
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">This is just a chunk of text that we will repeat couple of times to fill up some space. This is just a chunk of text that we will repeat couple of times to fill up some space.</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">Another chunk of text</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