...
Documentation
Documentation

# Package document

## Overview ▹

## Overview ▾

Package document provides creation, reading, and writing of ECMA 376 Open Office XML documents.

Example:

    doc := document.New()
    para := doc.AddParagraph()
    run := para.AddRun()
    run.SetText("foo")
    doc.SaveToFile("foo.docx")

## Index ▹

## Index ▾

### Examples

(Expand All)

  Document.FormFields
  New
  Open
  OpenTemplate

### Package files

anchoreddrawing.go anchoreddrawing_option.go bookmark.go cell.go cellborders.go cellmargins.go cellproperties.go chart.go color.go comments.go doc.go document.go endnotes.go extract.go fonts.go footer.go footnotes.go formfield.go formfieldtype_string.go header.go hyperlink.go inlinedrawing.go knownfields.go list_item_retriever.go mailmerge.go node.go nodes.go numbering.go numberingdefinition.go numberinglevel.go onoffvalue.go pageborders.go paragraph.go paragraphborders.go paragraphproperties.go paragraphspacing.go paragraphstyleproperties.go row.go rowproperties.go run.go runproperties.go section.go settings.go structuredocumenttag.go style.go styles.go table.go tableborders.go tableconditionalformatting.go tableproperties.go tablestyleproperties.go tablewidth.go tbllook.go toc.go watermark_picture.go watermark_text.go

## Constants

Field constants

    const (
        FieldCurrentPage   = "PAGE"
        FieldNumberOfPages = "NUMPAGES"
        FieldDate          = "DATE"
        FieldCreateDate    = "CREATEDATE"
        FieldEditTime      = "EDITTIME"
        FieldPrintDate     = "PRINTDATE"
        FieldSaveDate      = "SAVEDATE"
        FieldTIme          = "TIME"
        FieldTOC           = "TOC"
    )

## Variables

    var (
        // FootnoteTextStyleId is the style id used for footnote text.
        FootnoteTextStyleId = "FootnoteText"

        // EndnoteTextStyleId is the style id used for endnote text.
        EndnoteTextStyleId = "EndnoteText"
    )

## type AnchorDrawWrapOptions ¶

AnchorDrawWrapOptions is options to set wrapPolygon for wrap text through and tight.

    type AnchorDrawWrapOptions struct {
        // contains filtered or unexported fields
    }

### func NewAnchorDrawWrapOptions ¶

    func NewAnchorDrawWrapOptions() *AnchorDrawWrapOptions

NewAnchorDrawWrapOptions return anchor drawing options property.

### func (AnchorDrawWrapOptions) GetWrapPathLineTo ¶

    func (option AnchorDrawWrapOptions) GetWrapPathLineTo() []*dml.CT_Point2D

GetWrapPathLineTo return wrapPath lineTo value.

### func (AnchorDrawWrapOptions) GetWrapPathStart ¶

    func (option AnchorDrawWrapOptions) GetWrapPathStart() *dml.CT_Point2D

GetWrapPathStart return wrapPath start value.

### func (AnchorDrawWrapOptions) SetFollowImageShape ¶

    func (option AnchorDrawWrapOptions) SetFollowImageShape(val bool)

SetFollowImageShape sets wrapPath to follow image shape, if nil return wrapPath that follow image size.

### func (AnchorDrawWrapOptions) SetWrapPathLineTo ¶

    func (option AnchorDrawWrapOptions) SetWrapPathLineTo(coordinates []*dml.CT_Point2D)

SetWrapPathLineTo sets wrapPath lineTo value.

### func (AnchorDrawWrapOptions) SetWrapPathStart ¶

    func (option AnchorDrawWrapOptions) SetWrapPathStart(coordinate *dml.CT_Point2D)

SetWrapPathStart sets wrapPath start value.

## type AnchoredDrawing ¶

AnchoredDrawing is an absolutely positioned image within a document page.

    type AnchoredDrawing struct {
        // contains filtered or unexported fields
    }

### func (AnchoredDrawing) GetImage ¶

    func (a AnchoredDrawing) GetImage() (common.ImageRef, bool)

GetImage returns the ImageRef associated with an AnchoredDrawing.

### func (AnchoredDrawing) GetSize ¶

    func (a AnchoredDrawing) GetSize() (w, h int64)

GetSize return the size of anchor on the page.

### func (AnchoredDrawing) Set3DRotationImageEffect ¶

    func (a AnchoredDrawing) Set3DRotationImageEffect()

Set3DRotationImageEffect sets the 3D rotation image effect.

### func (AnchoredDrawing) SetAlignment ¶

    func (a AnchoredDrawing) SetAlignment(h wml.WdST_AlignH, v wml.WdST_AlignV)

SetAlignment positions an anchored image via alignment. Offset is incompatible with SetOffset, whichever is called last is applied.

### func (AnchoredDrawing) SetAllowOverlapAttr ¶

    func (a AnchoredDrawing) SetAllowOverlapAttr(val bool)

SetAllowOverlapAttr sets the allowOverlap attribute of anchor.

### func (AnchoredDrawing) SetBehindDoc ¶

    func (a AnchoredDrawing) SetBehindDoc(val bool)

SetBehindDoc sets the behindDoc attribute of anchor.

### func (AnchoredDrawing) SetBevelImageEffect ¶

    func (a AnchoredDrawing) SetBevelImageEffect()

SetBevelImageEffect sets the glow image effect.

### func (AnchoredDrawing) SetBorder ¶

    func (a AnchoredDrawing) SetBorder(borderType dml.ST_PresetLineDashVal, c color.Color, thickness measurement.Distance)

SetBorder sets the border of anchor.

### func (AnchoredDrawing) SetGlowImageEffect ¶

    func (a AnchoredDrawing) SetGlowImageEffect(radius measurement.Distance, c color.Color)

SetGlowImageEffect sets the glow image effect.

### func (AnchoredDrawing) SetHAlignment ¶

    func (a AnchoredDrawing) SetHAlignment(h wml.WdST_AlignH)

SetHAlignment sets the horizontal alignment for an anchored image.

### func (AnchoredDrawing) SetId ¶

    func (a AnchoredDrawing) SetId(id uint32)

SetId sets the id of the image.

### func (AnchoredDrawing) SetInnerShadowImageEffect ¶

    func (a AnchoredDrawing) SetInnerShadowImageEffect(radius, offset measurement.Distance, c color.Color, degrees float64)

SetInnerShadowImageEffect sets the inner shadow image effect.

### func (AnchoredDrawing) SetLayoutInCell ¶

    func (a AnchoredDrawing) SetLayoutInCell(val bool)

SetLayoutInCell sets the layoutInCell attribute of anchor.

### func (AnchoredDrawing) SetName ¶

    func (a AnchoredDrawing) SetName(name string)

SetName sets the name of the image, visible in the properties of the image within Word.

### func (AnchoredDrawing) SetOffset ¶

    func (a AnchoredDrawing) SetOffset(x, y measurement.Distance)

SetOffset sets the offset of the image relative to the origin, which by default this is the top-left corner of the page. Offset is incompatible with SetAlignment, whichever is called last is applied.

### func (AnchoredDrawing) SetOrigin ¶

    func (a AnchoredDrawing) SetOrigin(h wml.WdST_RelFromH, v wml.WdST_RelFromV)

SetOrigin sets the origin of the image. It defaults to ST_RelFromHPage and ST_RelFromVPage

### func (AnchoredDrawing) SetOuterShadowImageEffect ¶

    func (a AnchoredDrawing) SetOuterShadowImageEffect(radius, offset measurement.Distance, c color.Color, degrees float64)

SetOuterShadowImageEffect sets the outer shadow image effect.

### func (AnchoredDrawing) SetReflectionImageEffect ¶

    func (a AnchoredDrawing) SetReflectionImageEffect(radius measurement.Distance, opacity, size float64)

SetReflectionImageEffect sets the reflection image effect.

### func (AnchoredDrawing) SetSize ¶

    func (a AnchoredDrawing) SetSize(w, h measurement.Distance)

SetSize sets the size of the displayed image on the page.

### func (AnchoredDrawing) SetSoftEdgeImageEffect ¶

    func (a AnchoredDrawing) SetSoftEdgeImageEffect(radius measurement.Distance)

SetSoftEdgeImageEffect sets the soft edge image effect.

### func (AnchoredDrawing) SetTextWrapBehindText ¶

    func (a AnchoredDrawing) SetTextWrapBehindText()

SetTextWrapBehindText sets the text wrap to behind text.

### func (AnchoredDrawing) SetTextWrapInFrontOfText ¶

    func (a AnchoredDrawing) SetTextWrapInFrontOfText()

SetTextWrapInFrontOfText sets the text wrap to in front of text.

### func (AnchoredDrawing) SetTextWrapNone ¶

    func (a AnchoredDrawing) SetTextWrapNone()

SetTextWrapNone unsets text wrapping so the image can float on top of the text. When used in conjunction with X/Y Offset relative to the page it can be used to place a logo at the top of a page at an absolute position that doesn't interfere with text.

### func (AnchoredDrawing) SetTextWrapSquare ¶

    func (a AnchoredDrawing) SetTextWrapSquare(t wml.WdST_WrapText)

SetTextWrapSquare sets the text wrap to square with a given wrap type.

### func (AnchoredDrawing) SetTextWrapThrough ¶

    func (a AnchoredDrawing) SetTextWrapThrough(option *AnchorDrawWrapOptions)

SetTextWrapThrough sets the text wrap to through with a give wrap type.

### func (AnchoredDrawing) SetTextWrapTight ¶

    func (a AnchoredDrawing) SetTextWrapTight(option *AnchorDrawWrapOptions)

SetTextWrapTight sets the text wrap to tight with a give wrap type.

### func (AnchoredDrawing) SetTextWrapTopAndBottom ¶

    func (a AnchoredDrawing) SetTextWrapTopAndBottom()

SetTextWrapTopAndBottom sets the text wrap to top and bottom.

### func (AnchoredDrawing) SetVAlignment ¶

    func (a AnchoredDrawing) SetVAlignment(v wml.WdST_AlignV)

SetVAlignment sets the vertical alignment for an anchored image.

### func (AnchoredDrawing) SetXOffset ¶

    func (a AnchoredDrawing) SetXOffset(x measurement.Distance)

SetXOffset sets the X offset for an image relative to the origin.

### func (AnchoredDrawing) SetYOffset ¶

    func (a AnchoredDrawing) SetYOffset(y measurement.Distance)

SetYOffset sets the Y offset for an image relative to the origin.

### func (AnchoredDrawing) X ¶

    func (a AnchoredDrawing) X() *wml.WdAnchor

X returns the inner wrapped XML type.

## type Bookmark ¶

Bookmark is a bookmarked location within a document that can be referenced with a hyperlink.

    type Bookmark struct {
        // contains filtered or unexported fields
    }

### func (Bookmark) ID ¶

    func (b Bookmark) ID() int64

ID returns the bookmark's numeric identifier. The matching bookmarkEnd marker shares this ID.

### func (Bookmark) IsEmpty ¶

    func (b Bookmark) IsEmpty() bool

IsEmpty reports whether the bookmark range contains no runs. Common for TOC-style anchors where the end marker immediately follows the start.

### func (Bookmark) Name ¶

    func (b Bookmark) Name() string

Name returns the bookmark's document-unique name, used to reference it from hyperlinks.

### func (Bookmark) Paragraphs ¶

    func (b Bookmark) Paragraphs() []Paragraph

Paragraphs returns the paragraphs touched by the bookmark's range, in document order. The paragraph containing the bookmark start is included when the marker lives inside a paragraph; bookmarks that span tables include each cell paragraph touched by the range; and bookmarks that wrap whole tables (markers between block-level elements) may return only the paragraphs inside the range.

### func (Bookmark) Runs ¶

    func (b Bookmark) Runs() []Run

Runs returns the runs that fall within the bookmark's range, in document order. Mutating these runs (Run.AddText, Run.ClearContent, etc.) modifies the underlying document. Returns an empty slice for zero-width bookmarks.

Each call walks the document body afresh; callers iterating a large number of bookmarks should cache the result.

Limitation: the walker does not descend into CustomXml, SmartTag, Dir, or Bdo wrappers. If the bookmark's matching end marker happens to live inside one of these wrappers, the walker will not see it and the returned range may extend further than intended.

### func (Bookmark) SetName ¶

    func (b Bookmark) SetName(name string)

SetName sets the name of the bookmark. This is the name that is used to reference the bookmark from hyperlinks.

### func (Bookmark) Text ¶

    func (b Bookmark) Text() string

Text returns the concatenated text of all runs within the bookmark's range.

### func (Bookmark) X ¶

    func (b Bookmark) X() *wml.CT_Bookmark

X returns the inner wrapped XML type.

## type Cell ¶

Cell is a table cell within a document (not a spreadsheet)

    type Cell struct {
        // contains filtered or unexported fields
    }

### func (Cell) AddParagraph ¶

    func (c Cell) AddParagraph() Paragraph

AddParagraph adds a paragraph to the table cell.

### func (Cell) AddStructuredDocumentTag ¶

    func (c Cell) AddStructuredDocumentTag() StructuredDocumentTag

AddStructuredDocumentTag appends a new, empty block-level structured document tag to the table cell and returns it. The tag is assigned a document-unique ID.

### func (Cell) AddTable ¶

    func (c Cell) AddTable() Table

AddTable adds a table to the table cell.

### func (Cell) Paragraphs ¶

    func (c Cell) Paragraphs() []Paragraph

Paragraphs returns the paragraphs defined in the cell, including those wrapped in SDT or CustomXml blocks.

### func (Cell) Properties ¶

    func (c Cell) Properties() CellProperties

Properties returns the cell properties.

### func (Cell) X ¶

    func (c Cell) X() *wml.CT_Tc

X returns the inner wrapped XML type.

## type CellBorders ¶

CellBorders are the borders for an individual

    type CellBorders struct {
        // contains filtered or unexported fields
    }

### func (CellBorders) SetAll ¶

    func (b CellBorders) SetAll(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetAll sets all of the borders to a given value.

### func (CellBorders) SetBottom ¶

    func (b CellBorders) SetBottom(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetBottom sets the bottom border to a specified type, color and thickness.

### func (CellBorders) SetInsideHorizontal ¶

    func (b CellBorders) SetInsideHorizontal(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetInsideHorizontal sets the interior horizontal borders to a specified type, color and thickness.

### func (CellBorders) SetInsideVertical ¶

    func (b CellBorders) SetInsideVertical(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetInsideVertical sets the interior vertical borders to a specified type, color and thickness.

### func (CellBorders) SetLeft ¶

    func (b CellBorders) SetLeft(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetLeft sets the left border to a specified type, color and thickness.

### func (CellBorders) SetRight ¶

    func (b CellBorders) SetRight(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetRight sets the right border to a specified type, color and thickness.

### func (CellBorders) SetTop ¶

    func (b CellBorders) SetTop(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetTop sets the top border to a specified type, color and thickness.

### func (CellBorders) X ¶

    func (b CellBorders) X() *wml.CT_TcBorders

X returns the inner wrapped type

## type CellMargins ¶

CellMargins are the margins for an individual cell.

    type CellMargins struct {
        // contains filtered or unexported fields
    }

### func (CellMargins) SetBottom ¶

    func (c CellMargins) SetBottom(d measurement.Distance)

SetBottom sets the cell bottom margin

### func (CellMargins) SetBottomPct ¶

    func (c CellMargins) SetBottomPct(pct float64)

SetBottomPct sets the cell bottom margin

### func (CellMargins) SetLeft ¶

    func (c CellMargins) SetLeft(d measurement.Distance)

SetLeft sets the cell left margin

### func (CellMargins) SetLeftPct ¶

    func (c CellMargins) SetLeftPct(pct float64)

SetLeftPct sets the cell left margin

### func (CellMargins) SetRight ¶

    func (c CellMargins) SetRight(d measurement.Distance)

SetRight sets the cell right margin

### func (CellMargins) SetRightPct ¶

    func (c CellMargins) SetRightPct(pct float64)

SetRightPct sets the cell right margin

### func (CellMargins) SetStart ¶

    func (c CellMargins) SetStart(d measurement.Distance)

SetStart sets the cell start margin

### func (CellMargins) SetStartPct ¶

    func (c CellMargins) SetStartPct(pct float64)

SetStartPct sets the cell start margin

### func (CellMargins) SetTop ¶

    func (c CellMargins) SetTop(d measurement.Distance)

SetTop sets the cell top margin

### func (CellMargins) SetTopPct ¶

    func (c CellMargins) SetTopPct(pct float64)

SetTopPct sets the cell top margin

## type CellProperties ¶

CellProperties are a table cells properties within a document.

    type CellProperties struct {
        // contains filtered or unexported fields
    }

### func (CellProperties) Borders ¶

    func (c CellProperties) Borders() CellBorders

Borders allows controlling individual cell borders.

### func (CellProperties) Margins ¶

    func (c CellProperties) Margins() CellMargins

Margins allows controlling individual cell margins.

### func (CellProperties) SetColumnSpan ¶

    func (c CellProperties) SetColumnSpan(cols int)

SetColumnSpan sets the number of Grid Columns Spanned by the Cell. This is used to give the appearance of merged cells.

### func (CellProperties) SetShading ¶

    func (c CellProperties) SetShading(shd wml.ST_Shd, foreground, fill color.Color)

SetShading controls the cell shading. Passing wml.ST_ShdUnset removes it.

### func (CellProperties) SetVerticalAlignment ¶

    func (c CellProperties) SetVerticalAlignment(align wml.ST_VerticalJc)

SetVerticalAlignment sets the vertical alignment of content within a table cell.

### func (CellProperties) SetVerticalMerge ¶

    func (c CellProperties) SetVerticalMerge(mergeVal wml.ST_Merge)

SetVerticalMerge controls the vertical merging of cells.

### func (CellProperties) SetWidth ¶

    func (c CellProperties) SetWidth(d measurement.Distance)

SetWidth sets the cell width to a specified width.

### func (CellProperties) SetWidthAuto ¶

    func (c CellProperties) SetWidthAuto()

SetWidthAuto sets the the cell width to automatic.

### func (CellProperties) SetWidthPercent ¶

    func (c CellProperties) SetWidthPercent(pct float64)

SetWidthPercent sets the cell to a width percentage.

### func (CellProperties) X ¶

    func (c CellProperties) X() *wml.CT_TcPr

X returns the inner wrapped XML type.

## type Color ¶

Color controls the run or styles color.

    type Color struct {
        // contains filtered or unexported fields
    }

### func (Color) SetColor ¶

    func (c Color) SetColor(v color.Color)

SetColor sets a specific color or auto.

### func (Color) SetThemeColor ¶

    func (c Color) SetThemeColor(t wml.ST_ThemeColor)

SetThemeColor sets the color from the theme.

### func (Color) SetThemeShade ¶

    func (c Color) SetThemeShade(s uint8)

SetThemeShade sets the shade based off the theme color.

### func (Color) X ¶

    func (c Color) X() *wml.CT_Color

X returns the inner wrapped XML type.

## type ColumnSpec ¶

ColumnSpec defines one column of an unequal-width column layout.

    type ColumnSpec struct {
        Width measurement.Distance
        // SpaceAfter is the gap to the next column. On the last column it is still
        // written to the file but ignored by Word.
        SpaceAfter measurement.Distance
    }

## type Comment ¶

Comment is run's comment component.

    type Comment struct {
        // contains filtered or unexported fields
    }

### func (Comment) AddParagraph ¶

    func (c Comment) AddParagraph() Paragraph

AddParagraph adds a paragraph to the comment.

### func (Comment) AddReply ¶

    func (c Comment) AddReply(author, commentText string) (Comment, error)

AddReply adds a reply to the comment, producing a thread Word displays as connected. The thread's root comment must already be anchored in the body with a closed range (Paragraph.CloseComment), since the reply's markers are inserted next to it.

### func (Comment) Author ¶

    func (c Comment) Author() string

Author returns the comment author.

### func (Comment) Date ¶

    func (c Comment) Date() *time.Time

Date returns the comment date, or nil if unset.

### func (Comment) Done ¶

    func (c Comment) Done() bool

Done reports whether the comment is marked as resolved (w15:done).

### func (Comment) ID ¶

    func (c Comment) ID() int64

ID returns the comment identifier.

### func (Comment) Initials ¶

    func (c Comment) Initials() string

Initials returns the comment author's initials, or an empty string if unset.

### func (Comment) IsReply ¶

    func (c Comment) IsReply() bool

IsReply reports whether this comment is a reply to another comment.

### func (Comment) Paragraphs ¶

    func (c Comment) Paragraphs() []Paragraph

Paragraphs returns the paragraphs comprising the comment content.

### func (Comment) Parent ¶

    func (c Comment) Parent() (Comment, bool)

Parent returns the comment this comment replies to, if it is a reply.

### func (Comment) Replies ¶

    func (c Comment) Replies() []Comment

Replies returns the direct replies to this comment, in comments.xml order — the order Word displays a thread in, regardless of commentsExtended.xml entry order.

### func (Comment) SetDone ¶

    func (c Comment) SetDone(done bool)

SetDone marks the comment as resolved (w15:done) or not.

### func (Comment) Text ¶

    func (c Comment) Text() string

Text returns the plain text content of the comment, paragraphs joined with newlines.

### func (Comment) X ¶

    func (c Comment) X() *wml.CT_Comment

X returns the inner wrapped XML type.

## type DocText ¶

DocText is an array of extracted text items which has some methods for representing extracted text.

    type DocText struct {
        Items []TextItem
        // contains filtered or unexported fields
    }

### func (*DocText) Text ¶

    func (d *DocText) Text() string

Text returns text from the document as one string separated with line breaks.

### func (*DocText) TextWithOptions ¶

    func (d *DocText) TextWithOptions(options ExtractTextOptions) string

TextWithOptions extract text with options.

## type Document ¶

Document is a text document that can be written out in the OOXML .docx format. It can be opened from a file on disk and modified, or created from scratch.

    type Document struct {
        common.DocBase

        Settings  Settings  // document settings
        Numbering Numbering // numbering styles within the document
        Styles    Styles    // styles that are use and can be used within the document
        // contains filtered or unexported fields
    }

### func New ¶

    func New() *Document

New constructs an empty document that content can be added to.

Example

Code:

    doc := document.New()
    doc.AddParagraph().AddRun().AddText("Hello World!")
    doc.SaveToFile("document.docx")

### func Open ¶

    func Open(filename string) (*Document, error)

Open opens and reads a document from a file (.docx).

Example

Code:

    doc, err := document.Open("existing.docx")
    if err != nil {
        log.Fatalf("error opening document: %s", err)
    }
    for _, para := range doc.Paragraphs() {
        for _, run := range para.Runs() {
            fmt.Print(run.Text())
        }
        fmt.Println()
    }

### func OpenTemplate ¶

    func OpenTemplate(filename string) (*Document, error)

OpenTemplate opens a document, removing all content so it can be used as a template. Since Word removes unused styles from a document upon save, to create a template in Word add a paragraph with every style of interest. When opened with OpenTemplate the document's styles will be available but the content will be gone.

Example

Code:

    doc, err := document.OpenTemplate("existing.docx")
    if err != nil {
        log.Fatalf("error opening document template: %s", err)
    }
    para := doc.AddParagraph()
    para.SetStyle("Title")
    para.AddRun().AddText("My Document Title")

    para = doc.AddParagraph()
    para.SetStyle("Subtitle")
    para.AddRun().AddText("Document Subtitle")

    para = doc.AddParagraph()
    para.SetStyle("Heading1")
    para.AddRun().AddText("Major Section")
    doc.SaveToFile("ouput.docx")

### func Read ¶

    func Read(r io.ReaderAt, size int64) (*Document, error)

Read reads a document from an io.Reader.

### func (*Document) AddFooter ¶

    func (d *Document) AddFooter() Footer

AddFooter creates a Footer associated with the document, but doesn't add it to the document for display.

### func (*Document) AddHeader ¶

    func (d *Document) AddHeader() Header

AddHeader creates a header associated with the document, but doesn't add it to the document for display.

### func (Document) AddHyperlink ¶

    func (d Document) AddHyperlink(url string) common.Hyperlink

AddHyperlink adds a hyperlink to a document. Adding the hyperlink to a document and setting it on a cell is more efficient than setting hyperlinks directly on a cell.

### func (*Document) AddImage ¶

    func (d *Document) AddImage(i common.Image) (common.ImageRef, error)

AddImage adds an image to the document package, returning a reference that can be used to add the image to a run and place it in the document contents. See common.ImageFromFile for the formats decoded by the standard helpers; other formats can be embedded by constructing common.Image directly with a known Format and Size.

### func (*Document) AddParagraph ¶

    func (d *Document) AddParagraph() Paragraph

AddParagraph adds a new paragraph to the document body.

### func (*Document) AddStructuredDocumentTag ¶

    func (d *Document) AddStructuredDocumentTag() StructuredDocumentTag

AddStructuredDocumentTag appends a new, empty block-level structured document tag to the document body and returns it. The tag is assigned a document-unique ID so it cannot collide with existing tags.

### func (*Document) AddTable ¶

    func (d *Document) AddTable() Table

AddTable adds a new table to the document body.

### func (*Document) AddWatermarkPicture ¶

    func (d *Document) AddWatermarkPicture(imageRef common.ImageRef) WatermarkPicture

AddWatermarkPicture adds new watermark picture to document.

### func (*Document) AddWatermarkText ¶

    func (d *Document) AddWatermarkText(text string) WatermarkText

AddWatermarkText adds new watermark text to the document.

### func (*Document) Append ¶

    func (d *Document) Append(d1orig *Document) error

Append appends a document d0 to a document d1. All settings, headers and footers remain the same as in the document d0 if they exist there, otherwise they are taken from the d1.

### func (*Document) AppendNode ¶

    func (d *Document) AppendNode(node Node)

AppendNode append node to document element.

### func (*Document) BodySection ¶

    func (d *Document) BodySection() Section

BodySection returns the default body section used for all preceding paragraphs until the previous Section. If there is no previous sections, the body section applies to the entire document.

### func (*Document) BookmarkByName ¶

    func (d *Document) BookmarkByName(name string) (Bookmark, bool)

BookmarkByName returns the bookmark with the given name and reports whether it was found. Names are document-unique by convention; if a malformed document contains duplicates, the first match in document order is returned.

Implemented as a linear scan over Bookmarks(); callers performing many lookups against the same document should cache the slice.

### func (*Document) Bookmarks ¶

    func (d *Document) Bookmarks() []Bookmark

Bookmarks returns all the bookmarks defined in the document.

### func (*Document) Close ¶

    func (d *Document) Close() error

Close closes the document, removing any temporary files that might have been created when opening a document.

### func (*Document) Comment ¶

    func (d *Document) Comment(id int64) Comment

Comment returns comment associated with given id.

### func (*Document) Comments ¶

    func (d *Document) Comments() []Comment

Comments get list of comments in the document.

### func (*Document) Copy ¶

    func (d *Document) Copy() (*Document, error)

Copy makes a deep copy of the document by saving and reading it back. It can be useful to avoid sharing common data between two documents.

### func (*Document) DocRels ¶

    func (d *Document) DocRels() common.Relationships

DocRels returns document relationship.

### func (*Document) Endnote ¶

    func (d *Document) Endnote(id int64) Endnote

Endnote returns the endnote based on the ID; this can be used nicely with the run.IsEndnote() functionality.

### func (*Document) Endnotes ¶

    func (d *Document) Endnotes() []Endnote

Endnotes returns the endnotes defined in the document.

### func (*Document) ExtractText ¶

    func (d *Document) ExtractText() *DocText

ExtractText returns text from the document as a DocText object.

### func (*Document) FontTable ¶

    func (d *Document) FontTable() *wml.Fonts

FontTable returns document fontTable element.

### func (*Document) Footers ¶

    func (d *Document) Footers() []Footer

Footers returns the footers defined in the document.

### func (*Document) Footnote ¶

    func (d *Document) Footnote(id int64) Footnote

Footnote returns the footnote based on the ID; this can be used nicely with the run.IsFootnote() functionality.

### func (*Document) Footnotes ¶

    func (d *Document) Footnotes() []Footnote

Footnotes returns the footnotes defined in the document.

### func (*Document) FormFields ¶

    func (d *Document) FormFields() []FormField

FormFields extracts all the fields from a document. They can then be manipulated via the methods on the field and the document saved.

Example

Code:

    doc, err := document.Open("invitation.docx")
    if err != nil {
        log.Fatalf("error opening document form: %s", err)
    }
    for _, field := range doc.FormFields() {
        switch field.Name() {
        case "attendingEvent":
            if field.Type() == document.FormFieldTypeCheckBox {
                field.SetChecked(true)
            }
        case "name":
            if field.Type() == document.FormFieldTypeText {
                field.SetValue("John Smith")
            }
        }
    }
    doc.SaveToFile("invitation-respoonse.docx")

### func (*Document) GetChartSpaceByRelId ¶

    func (d *Document) GetChartSpaceByRelId(relId string) *crt.ChartSpace

GetChartSpaceByRelId returns a *crt.ChartSpace with the associated relation ID in the document.

### func (*Document) GetDocRelTargetByID ¶

    func (d *Document) GetDocRelTargetByID(idAttr string) string

GetDocRelTargetByID returns TargetAttr of document relationship given its IdAttr.

### func (*Document) GetFontBytesByRelId ¶

    func (d *Document) GetFontBytesByRelId(relID string) ([]byte, error)

### func (*Document) GetHeaderFooterImageObjByRelId ¶

    func (d *Document) GetHeaderFooterImageObjByRelId(relId string, isHeader, isFooter bool) (common.Image, error)

GetHeaderFooterImageObjByRelId returns a common.Image with the associated relation ID in the document, its header or footer.

### func (*Document) GetImageByRelID ¶

    func (d *Document) GetImageByRelID(relID string) (common.ImageRef, bool)

GetImageByRelID returns an ImageRef with the associated relation ID in the document.

### func (*Document) GetImageObjByRelId ¶

    func (d *Document) GetImageObjByRelId(relId string) (common.Image, error)

GetImageObjByRelId returns a common.Image with the associated relation ID in the document.

### func (*Document) GetNumberingLevelByIds ¶

    func (d *Document) GetNumberingLevelByIds(numId, levelId int64) NumberingLevel

GetNumberingLevelByIds returns a NumberingLevel by its NumId and LevelId attributes or an empty one if not found.

### func (*Document) GetStyleByID ¶

    func (d *Document) GetStyleByID(id string) Style

GetStyleByID returns Style by it is IdAttr.

### func (*Document) GetTargetByRelId ¶

    func (d *Document) GetTargetByRelId(idAttr string) string

GetTargetByRelId returns a target path with the associated relation ID in the document.

### func (*Document) HasComments ¶

    func (d *Document) HasComments() bool

HasComments checks if the document contains comments.

### func (*Document) HasEndnotes ¶

    func (d *Document) HasEndnotes() bool

HasEndnotes returns a bool based on the presence or abscence of endnotes within the document.

### func (*Document) HasFootnotes ¶

    func (d *Document) HasFootnotes() bool

HasFootnotes returns a bool based on the presence or abscence of footnotes within the document.

### func (*Document) Headers ¶

    func (d *Document) Headers() []Header

Headers returns the headers defined in the document.

### func (*Document) InsertParagraphAfter ¶

    func (d *Document) InsertParagraphAfter(relativeTo Paragraph) Paragraph

InsertParagraphAfter adds a new empty paragraph after the relativeTo paragraph.

### func (*Document) InsertParagraphBefore ¶

    func (d *Document) InsertParagraphBefore(relativeTo Paragraph) Paragraph

InsertParagraphBefore adds a new empty paragraph before the relativeTo paragraph.

### func (*Document) InsertTableAfter ¶

    func (d *Document) InsertTableAfter(relativeTo Paragraph) Table

### func (*Document) InsertTableBefore ¶

    func (d *Document) InsertTableBefore(relativeTo Paragraph) Table

### func (*Document) MailMerge ¶

    func (d *Document) MailMerge(mergeContent map[string]string)

MailMerge finds mail merge fields and replaces them with the text provided. It also removes the mail merge source info from the document settings.

### func (Document) MergeFields ¶

    func (d Document) MergeFields() []string

MergeFields returns the list of all mail merge fields found in the document.

### func (*Document) Nodes ¶

    func (d *Document) Nodes() Nodes

Nodes return the document's element as nodes.

### func (*Document) Paragraphs ¶

    func (d *Document) Paragraphs() []Paragraph

Paragraphs returns all the paragraphs in the document body including tables and content wrapped in SDT or CustomXml blocks.

### func (*Document) PutNodeAfter ¶

    func (d *Document) PutNodeAfter(relativeTo, node Node)

PutNodeAfter put node to position after relativeTo.

### func (*Document) PutNodeBefore ¶

    func (d *Document) PutNodeBefore(relativeTo, node Node)

PutNodeBefore put node to position before relativeTo.

### func (*Document) RemoveComment ¶

    func (d *Document) RemoveComment(id int64) bool

RemoveComment will remove comment with a given id from the document, along with its replies (Word deletes whole threads, never leaving a dangling w15:paraIdParent).

### func (*Document) RemoveParagraph ¶

    func (d *Document) RemoveParagraph(p Paragraph)

RemoveParagraph removes a paragraph from a document.

### func (*Document) RemoveTable ¶

    func (d *Document) RemoveTable(tbl Table)

RemoveTable removes a table from the document body, searching through SDT and CustomXml wrappers and nested table cells.

### func (*Document) Save ¶

    func (d *Document) Save(w io.Writer) error

Save writes the document to an io.Writer in the Zip package format.

### func (*Document) SaveToFile ¶

    func (d *Document) SaveToFile(path string) error

SaveToFile writes the document out to a file.

### func (Document) SetConformance ¶

    func (d Document) SetConformance(conformanceAttr sharedTypes.ST_ConformanceClass)

SetConformance sets conformance attribute of the document as one of these values from github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes: ST_ConformanceClassUnset, ST_ConformanceClassStrict or ST_ConformanceClassTransitional.

### func (Document) SetStrict ¶

    func (d Document) SetStrict(strict bool)

SetStrict is a shortcut for document.SetConformance, as one of these values from github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes: ST_ConformanceClassUnset, ST_ConformanceClassStrict or ST_ConformanceClassTransitional.

### func (*Document) StructuredDocumentTags ¶

    func (d *Document) StructuredDocumentTags() []StructuredDocumentTag

StructuredDocumentTags returns the block-level structured document tags in the document, which are commonly used in document templates. The search descends into tables, headers, footers, and nested structured document tags. Inline (run-level) tags are returned per-paragraph by Paragraph.StructuredDocumentTags.

### func (*Document) Tables ¶

    func (d *Document) Tables() []Table

Tables returns the tables defined in the document.

### func (*Document) Themes ¶

    func (d *Document) Themes() []*dml.Theme

Themes returns document's themes.

### func (*Document) Validate ¶

    func (d *Document) Validate() error

Validate validates the structure and in cases where it's possible, the ranges of elements within a document. A validation error doesn't mean that the document won't work in MS Word or LibreOffice, but it's worth checking into.

### func (*Document) X ¶

    func (d *Document) X() *wml.Document

X returns the inner wrapped XML type.

## type DrawingInfo ¶

DrawingInfo is used for keep information about a drawing wrapping a textbox where the text is located.

    type DrawingInfo struct {
        Drawing *wml.CT_Drawing
        Width   int64
        Height  int64
    }

## type Endnote ¶

Endnote is an individual endnote reference within the document.

    type Endnote struct {
        // contains filtered or unexported fields
    }

### func (Endnote) AddParagraph ¶

    func (e Endnote) AddParagraph() Paragraph

AddParagraph adds a paragraph to the endnote.

### func (Endnote) Paragraphs ¶

    func (e Endnote) Paragraphs() []Paragraph

Paragraphs returns the paragraphs defined in an endnote.

### func (Endnote) RemoveParagraph ¶

    func (e Endnote) RemoveParagraph(p Paragraph)

RemoveParagraph removes a paragraph from the endnote.

### func (Endnote) X ¶

    func (e Endnote) X() *wml.CT_FtnEdn

X returns the inner wrapped XML type.

## type ExtractTextOptions ¶

ExtractTextOptions extraction text options.

    type ExtractTextOptions struct {
        // WithNumbering extract numbering elements if set to `true`.
        WithNumbering bool

        // NumberingIndent default value of numbering indent.
        NumberingIndent string

        // RunsOnNewLine write each of runs text on new line if set to `true`.
        RunsOnNewLine bool
    }

## type Fonts ¶

Fonts allows manipulating a style or run's fonts.

    type Fonts struct {
        // contains filtered or unexported fields
    }

### func (Fonts) SetASCIITheme ¶

    func (f Fonts) SetASCIITheme(t wml.ST_Theme)

SetASCIITheme sets the font ASCII Theme.

### func (Fonts) SetCSTheme ¶

    func (f Fonts) SetCSTheme(t wml.ST_Theme)

SetCSTheme sets the font complex script theme.

### func (Fonts) SetEastAsiaTheme ¶

    func (f Fonts) SetEastAsiaTheme(t wml.ST_Theme)

SetEastAsiaTheme sets the font East Asia Theme.

### func (Fonts) SetHANSITheme ¶

    func (f Fonts) SetHANSITheme(t wml.ST_Theme)

SetHANSITheme sets the font H ANSI Theme.

### func (Fonts) X ¶

    func (f Fonts) X() *wml.CT_Fonts

X returns the inner wrapped XML type.

## type Footer ¶

Footer is a footer for a document section.

    type Footer struct {
        // contains filtered or unexported fields
    }

### func (Footer) AddImage ¶

    func (f Footer) AddImage(i common.Image) (common.ImageRef, error)

AddImage adds an image to the document package, returning a reference that can be used to add the image to a run and place it in the document contents.

### func (Footer) AddParagraph ¶

    func (f Footer) AddParagraph() Paragraph

AddParagraph adds a paragraph to the footer.

### func (Footer) AddTable ¶

    func (f Footer) AddTable() Table

AddTable adds a table to the footer.

### func (Footer) Clear ¶

    func (f Footer) Clear()

Clear clears all content within a footer

### func (Footer) Index ¶

    func (f Footer) Index() int

Index returns the index of the footer within the document. This is used to form its zip packaged filename as well as to match it with its relationship ID.

### func (Footer) Paragraphs ¶

    func (f Footer) Paragraphs() []Paragraph

Paragraphs returns the paragraphs defined in a footer.

### func (Footer) RemoveParagraph ¶

    func (f Footer) RemoveParagraph(p Paragraph)

RemoveParagraph removes a paragraph from a footer.

### func (Footer) Tables ¶

    func (f Footer) Tables() []Table

Tables returns the tables defined in the footer.

### func (Footer) X ¶

    func (f Footer) X() *wml.Ftr

X returns the inner wrapped XML type.

## type Footnote ¶

Footnote is an individual footnote reference within the document.

    type Footnote struct {
        // contains filtered or unexported fields
    }

### func (Footnote) AddParagraph ¶

    func (f Footnote) AddParagraph() Paragraph

AddParagraph adds a paragraph to the footnote.

### func (Footnote) Paragraphs ¶

    func (f Footnote) Paragraphs() []Paragraph

Paragraphs returns the paragraphs defined in a footnote.

### func (Footnote) RemoveParagraph ¶

    func (f Footnote) RemoveParagraph(p Paragraph)

RemoveParagraph removes a paragraph from the footnote.

### func (Footnote) X ¶

    func (f Footnote) X() *wml.CT_FtnEdn

X returns the inner wrapped XML type.

## type FormField ¶

FormField is a form within a document. It references the document, so changes to the form field wil be reflected in the document if it is saved.

    type FormField struct {
        // contains filtered or unexported fields
    }

### func (FormField) IsChecked ¶

    func (f FormField) IsChecked() bool

IsChecked returns true if a FormFieldTypeCheckBox is checked.

### func (FormField) Name ¶

    func (f FormField) Name() string

Name returns the name of the field.

### func (FormField) PossibleValues ¶

    func (f FormField) PossibleValues() []string

PossibleValues returns the possible values for a FormFieldTypeDropDown.

### func (FormField) SetCalcOnExit ¶

    func (f FormField) SetCalcOnExit(calcOnExit bool)

SetCalcOnExit marks if a FormField should be CalcOnExit or not.

### func (FormField) SetChecked ¶

    func (f FormField) SetChecked(b bool)

SetChecked marks a FormFieldTypeCheckBox as checked or unchecked.

### func (FormField) SetDefaultValue ¶

    func (f FormField) SetDefaultValue(v string)

SetDefaultValue sets the default value of a FormFieldTypeDropDown. For FormFieldTypeDropDown, the value must be one of the fields possible values.

### func (FormField) SetEnabled ¶

    func (f FormField) SetEnabled(enabled bool)

SetEnabled marks a FormField as enabled or disabled.

### func (FormField) SetName ¶

    func (f FormField) SetName(name string)

SetName marks sets a name attribute for a FormField.

### func (FormField) SetPossibleValues ¶

    func (f FormField) SetPossibleValues(values []string)

SetPossibleValues sets possible values for a FormFieldTypeDropDown.

### func (FormField) SetSize ¶

    func (f FormField) SetSize(size uint64)

SetSize sets size attribute for a FormFieldTypeCheckBox in pt.

### func (FormField) SetValue ¶

    func (f FormField) SetValue(v string)

SetValue sets the value of a FormFieldTypeText or FormFieldTypeDropDown. For FormFieldTypeDropDown, the value must be one of the fields possible values.

### func (FormField) Type ¶

    func (f FormField) Type() FormFieldType

Type returns the type of the field.

### func (FormField) Value ¶

    func (f FormField) Value() string

Value returns the string value of a FormFieldTypeText or FormFieldTypeDropDown.

## type FormFieldType ¶

FormFieldType is the type of the form field.

    type FormFieldType byte

Form Field Type constants

    const (
        FormFieldTypeUnknown FormFieldType = iota
        FormFieldTypeText
        FormFieldTypeCheckBox
        FormFieldTypeDropDown
    )

### func (FormFieldType) String ¶

    func (i FormFieldType) String() string

## type Header ¶

Header is a header for a document section.

    type Header struct {
        // contains filtered or unexported fields
    }

### func (Header) AddImage ¶

    func (h Header) AddImage(i common.Image) (common.ImageRef, error)

AddImage adds an image to the document package, returning a reference that can be used to add the image to a run and place it in the document contents.

### func (Header) AddImageRef ¶

    func (h Header) AddImageRef(r common.ImageRef) (common.ImageRef, error)

AddImageRef add ImageRef to header as relationship, returning ImageRef that can be used to be placed as header content.

### func (Header) AddParagraph ¶

    func (h Header) AddParagraph() Paragraph

AddParagraph adds a paragraph to the header.

### func (Header) AddTable ¶

    func (h Header) AddTable() Table

AddTable adds a table to the header.

### func (Header) Clear ¶

    func (h Header) Clear()

Clear clears all content within a header

### func (Header) Index ¶

    func (h Header) Index() int

Index returns the index of the header within the document. This is used to form its zip packaged filename as well as to match it with its relationship ID.

### func (Header) Paragraphs ¶

    func (h Header) Paragraphs() []Paragraph

Paragraphs returns the paragraphs defined in a header.

### func (Header) RemoveParagraph ¶

    func (h Header) RemoveParagraph(p Paragraph)

RemoveParagraph removes a paragraph from a footer.

### func (Header) Tables ¶

    func (h Header) Tables() []Table

Tables returns the tables defined in the header.

### func (Header) X ¶

    func (h Header) X() *wml.Hdr

X returns the inner wrapped XML type.

## type HyperLink ¶

HyperLink is a link within a document.

    type HyperLink struct {
        // contains filtered or unexported fields
    }

### func (HyperLink) AddRun ¶

    func (h HyperLink) AddRun() Run

AddRun adds a run of text to a hyperlink. This is the text that will be linked.

### func (HyperLink) SetTarget ¶

    func (h HyperLink) SetTarget(url string)

SetTarget sets the URL target of the hyperlink.

### func (HyperLink) SetTargetBookmark ¶

    func (h HyperLink) SetTargetBookmark(bm Bookmark)

SetTargetBookmark sets the bookmark target of the hyperlink.

### func (HyperLink) SetTargetByRef ¶

    func (h HyperLink) SetTargetByRef(link common.Hyperlink)

SetTargetByRef sets the URL target of the hyperlink and is more efficient if a link destination will be used many times.

### func (HyperLink) SetToolTip ¶

    func (h HyperLink) SetToolTip(text string)

SetToolTip sets the tooltip text for a hyperlink.

### func (HyperLink) X ¶

    func (h HyperLink) X() *wml.CT_Hyperlink

X returns the inner wrapped XML type.

## type InlineDrawing ¶

InlineDrawing is an inlined image within a run.

    type InlineDrawing struct {
        // contains filtered or unexported fields
    }

### func (InlineDrawing) GetImage ¶

    func (i InlineDrawing) GetImage() (common.ImageRef, bool)

GetImage returns the ImageRef associated with an InlineDrawing.

### func (InlineDrawing) SetSize ¶

    func (i InlineDrawing) SetSize(w, h measurement.Distance)

SetSize sets the size of the displayed image on the page.

### func (InlineDrawing) X ¶

    func (i InlineDrawing) X() *wml.WdInline

X returns the inner wrapped XML type.

## type InlineStructuredDocumentTag ¶

InlineStructuredDocumentTag is an inline (run-level) structured document tag, living within a paragraph. It shares the same property and content-type configuration surface as the block-level StructuredDocumentTag.

    type InlineStructuredDocumentTag struct {
        // contains filtered or unexported fields
    }

### func (InlineStructuredDocumentTag) AddRun ¶

    func (s InlineStructuredDocumentTag) AddRun() Run

AddRun appends a new, empty run to the tag's content.

### func (InlineStructuredDocumentTag) Alias ¶

    func (s InlineStructuredDocumentTag) Alias() string

Alias returns the alias (friendly name) of the tag or empty string if not set.

### func (InlineStructuredDocumentTag) Clear ¶

    func (s InlineStructuredDocumentTag) Clear()

Clear removes all content from the inline structured document tag.

### func (InlineStructuredDocumentTag) DataBinding ¶

    func (s InlineStructuredDocumentTag) DataBinding() (xpath, storeItemID string, ok bool)

DataBinding returns the XML mapping of the tag. ok is false when none is set.

### func (InlineStructuredDocumentTag) ID ¶

    func (s InlineStructuredDocumentTag) ID() int64

ID returns the numeric identifier of the tag, or zero if unset.

### func (InlineStructuredDocumentTag) IsShowingPlaceholder ¶

    func (s InlineStructuredDocumentTag) IsShowingPlaceholder() bool

IsShowingPlaceholder reports whether the tag's current contents are placeholder text.

### func (InlineStructuredDocumentTag) Lock ¶

    func (s InlineStructuredDocumentTag) Lock() SdtLock

Lock returns the lock setting of the tag.

### func (InlineStructuredDocumentTag) Placeholder ¶

    func (s InlineStructuredDocumentTag) Placeholder() string

Placeholder returns the name of the document part referenced as placeholder text.

### func (InlineStructuredDocumentTag) Runs ¶

    func (s InlineStructuredDocumentTag) Runs() []Run

Runs returns the runs within the tag's content, in document order, descending into hyperlinks and nested inline structured document tags.

### func (InlineStructuredDocumentTag) SetAlias ¶

    func (s InlineStructuredDocumentTag) SetAlias(alias string)

SetAlias sets the alias (friendly name) of the tag.

### func (InlineStructuredDocumentTag) SetComboBox ¶

    func (s InlineStructuredDocumentTag) SetComboBox(items ...SdtListItem)

SetComboBox configures the tag as a combo box with the given items.

### func (InlineStructuredDocumentTag) SetContentText ¶

    func (s InlineStructuredDocumentTag) SetContentText(text string)

SetContentText replaces the tag's content with a single run holding the given text.

### func (InlineStructuredDocumentTag) SetDataBinding ¶

    func (s InlineStructuredDocumentTag) SetDataBinding(xpath, storeItemID, prefixMappings string)

SetDataBinding sets the XML mapping of the tag. prefixMappings may be empty.

### func (InlineStructuredDocumentTag) SetDate ¶

    func (s InlineStructuredDocumentTag) SetDate(format string)

SetDate configures the tag as a date picker.

### func (InlineStructuredDocumentTag) SetDropDownList ¶

    func (s InlineStructuredDocumentTag) SetDropDownList(items ...SdtListItem)

SetDropDownList configures the tag as a drop-down list with the given items.

### func (InlineStructuredDocumentTag) SetID ¶

    func (s InlineStructuredDocumentTag) SetID(id int64)

SetID sets the numeric identifier of the tag.

### func (InlineStructuredDocumentTag) SetLock ¶

    func (s InlineStructuredDocumentTag) SetLock(lock SdtLock)

SetLock sets the lock setting of the tag.

### func (InlineStructuredDocumentTag) SetPicture ¶

    func (s InlineStructuredDocumentTag) SetPicture()

SetPicture configures the tag as a picture control.

### func (InlineStructuredDocumentTag) SetPlaceholder ¶

    func (s InlineStructuredDocumentTag) SetPlaceholder(docPartName string)

SetPlaceholder sets the document part referenced as placeholder text.

### func (InlineStructuredDocumentTag) SetRichText ¶

    func (s InlineStructuredDocumentTag) SetRichText()

SetRichText configures the tag as a rich-text control.

### func (InlineStructuredDocumentTag) SetShowingPlaceholder ¶

    func (s InlineStructuredDocumentTag) SetShowingPlaceholder(b bool)

SetShowingPlaceholder sets whether the tag's current contents are placeholder text.

### func (InlineStructuredDocumentTag) SetTag ¶

    func (s InlineStructuredDocumentTag) SetTag(tag string)

SetTag sets the tag (programmatic identifier) of the tag.

### func (InlineStructuredDocumentTag) SetTemporary ¶

    func (s InlineStructuredDocumentTag) SetTemporary(b bool)

SetTemporary sets whether the tag is removed when its contents are edited.

### func (InlineStructuredDocumentTag) SetText ¶

    func (s InlineStructuredDocumentTag) SetText(multiLine bool)

SetText configures the tag as a plain-text control.

### func (InlineStructuredDocumentTag) Tag ¶

    func (s InlineStructuredDocumentTag) Tag() string

Tag returns the tag (programmatic identifier) of the tag or empty string if not set.

### func (InlineStructuredDocumentTag) Temporary ¶

    func (s InlineStructuredDocumentTag) Temporary() bool

Temporary reports whether the tag is removed when its contents are edited.

### func (InlineStructuredDocumentTag) Text ¶

    func (s InlineStructuredDocumentTag) Text() string

Text returns the concatenated text of all runs within the tag's content.

### func (InlineStructuredDocumentTag) Type ¶

    func (s InlineStructuredDocumentTag) Type() SdtType

Type returns the content-type variant configured on the tag.

### func (InlineStructuredDocumentTag) X ¶

    func (s InlineStructuredDocumentTag) X() *wml.CT_SdtRun

X returns the inner wrapped XML type.

## type Node ¶

Node is document element node, contains Paragraph or Table element.

    type Node struct {
        Style            Style
        AnchoredDrawings []AnchoredDrawing
        InlineDrawings   []InlineDrawing
        Children         []Node
        // contains filtered or unexported fields
    }

### func (*Node) Clear ¶

    func (n *Node) Clear()

Clear content of node element.

### func (*Node) Remove ¶

    func (n *Node) Remove()

### func (*Node) ReplaceText ¶

    func (n *Node) ReplaceText(oldText, newText string)

ReplaceText replace the text inside node.

### func (*Node) ReplaceTextByRegexp ¶

    func (n *Node) ReplaceTextByRegexp(rgx *regexp.Regexp, newText string)

ReplaceTextByRegexp replace the text within node using regexp expression.

### func (*Node) Text ¶

    func (n *Node) Text() string

Text return node and its child text,

### func (*Node) X ¶

    func (n *Node) X() interface{}

X return element of Node as interface, can be either *Paragraph, *Table and Run.

## type Nodes ¶

Nodes contains slice of Node element.

    type Nodes struct {
        // contains filtered or unexported fields
    }

### func (*Nodes) FindNodeByCondition ¶

    func (n *Nodes) FindNodeByCondition(f func(node *Node) bool, wholeElements bool) []Node

FindNodeByCondition return node based on condition function, if wholeElements is true, its will extract children as next node elements.

### func (*Nodes) FindNodeByRegexp ¶

    func (n *Nodes) FindNodeByRegexp(r *regexp.Regexp) []Node

FindNodeByRegexp return node based on matched text and return a slice of node.

### func (*Nodes) FindNodeByStyleId ¶

    func (n *Nodes) FindNodeByStyleId(styleId string) []Node

FindNodeByStyleId return slice of node base on style id.

### func (*Nodes) FindNodeByStyleName ¶

    func (n *Nodes) FindNodeByStyleName(styleName string) []Node

FindNodeByStyleName return slice of node base on style name.

### func (*Nodes) FindNodeByText ¶

    func (n *Nodes) FindNodeByText(text string) []Node

FindNodeByText return node based on matched text and return a slice of node.

### func (*Nodes) ReplaceText ¶

    func (n *Nodes) ReplaceText(oldText, newText string)

ReplaceText replace text inside node.

### func (*Nodes) ReplaceTextByRegexp ¶

    func (n *Nodes) ReplaceTextByRegexp(expr *regexp.Regexp, newText string)

ReplaceTextByRegexp replace text inside node using regexp.

### func (*Nodes) X ¶

    func (n *Nodes) X() []Node

X return slice of node.

## type Numbering ¶

Numbering is the document wide numbering styles contained in numbering.xml.

    type Numbering struct {
        // contains filtered or unexported fields
    }

### func NewNumbering ¶

    func NewNumbering() Numbering

NewNumbering constructs a new numbering.

### func (Numbering) AddDefinition ¶

    func (n Numbering) AddDefinition() NumberingDefinition

AddDefinition adds a new numbering definition.

### func (Numbering) Clear ¶

    func (n Numbering) Clear()

Clear resets the numbering.

### func (Numbering) Definitions ¶

    func (n Numbering) Definitions() []NumberingDefinition

Definitions returns the defined numbering definitions.

### func (Numbering) InitializeDefault ¶

    func (n Numbering) InitializeDefault()

InitializeDefault constructs a default numbering.

### func (*Numbering) Restart ¶

    func (n *Numbering) Restart(nd *NumberingDefinition)

Restart restarts the numbering

### func (Numbering) X ¶

    func (n Numbering) X() *wml.Numbering

X returns the inner wrapped XML type.

## type NumberingDefinition ¶

NumberingDefinition defines a numbering definition for a list of pragraphs.

    type NumberingDefinition struct {
        // contains filtered or unexported fields
    }

### func (NumberingDefinition) AbstractNumberID ¶

    func (n NumberingDefinition) AbstractNumberID() int64

AbstractNumberID returns the ID that is unique within all numbering definitions that is used to assign the definition to a paragraph.

### func (NumberingDefinition) AddLevel ¶

    func (n NumberingDefinition) AddLevel() NumberingLevel

AddLevel adds a new numbering level to a NumberingDefinition.

### func (NumberingDefinition) Levels ¶

    func (n NumberingDefinition) Levels() []NumberingLevel

Levels returns all of the numbering levels defined in the definition.

### func (NumberingDefinition) MultiLevelType ¶

    func (n NumberingDefinition) MultiLevelType() wml.ST_MultiLevelType

MultiLevelType returns the multilevel type, or ST_MultiLevelTypeUnset if not set.

### func (NumberingDefinition) SetMultiLevelType ¶

    func (n NumberingDefinition) SetMultiLevelType(t wml.ST_MultiLevelType)

SetMultiLevelType sets the multilevel type.

### func (NumberingDefinition) X ¶

    func (n NumberingDefinition) X() *wml.CT_AbstractNum

X returns the inner wrapped XML type.

## type NumberingLevel ¶

NumberingLevel is the definition for numbering for a particular level within a NumberingDefinition.

    type NumberingLevel struct {
        // contains filtered or unexported fields
    }

### func (NumberingLevel) Properties ¶

    func (n NumberingLevel) Properties() ParagraphStyleProperties

Properties returns the numbering level paragraph properties.

### func (NumberingLevel) RunProperties ¶

    func (n NumberingLevel) RunProperties() RunProperties

RunProperties returns the RunProperties controlling numbering level font, etc.

### func (NumberingLevel) SetAlignment ¶

    func (n NumberingLevel) SetAlignment(j wml.ST_Jc)

SetAlignment sets the paragraph alignment

### func (NumberingLevel) SetFormat ¶

    func (n NumberingLevel) SetFormat(f wml.ST_NumberFormat)

SetFormat sets the numbering format.

### func (NumberingLevel) SetText ¶

    func (n NumberingLevel) SetText(t string)

SetText sets the text to be used in bullet mode.

### func (NumberingLevel) X ¶

    func (n NumberingLevel) X() *wml.CT_Lvl

X returns the inner wrapped XML type.

## type OnOffValue ¶

OnOffValue represents an on/off value that can also be unset

    type OnOffValue byte

OnOffValue constants

    const (
        OnOffValueUnset OnOffValue = iota
        OnOffValueOff
        OnOffValueOn
    )

## type PageBorders ¶

PageBorders allows manipulation of the borders on a section's pages. The underlying element is created on first write; reading alone does not modify the section.

    type PageBorders struct {
        // contains filtered or unexported fields
    }

### func (PageBorders) SetAll ¶

    func (b PageBorders) SetAll(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetAll sets all four page borders to the same style, color and thickness.

### func (PageBorders) SetBottom ¶

    func (b PageBorders) SetBottom(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetBottom sets the bottom page border.

### func (PageBorders) SetDisplay ¶

    func (b PageBorders) SetDisplay(d wml.ST_PageBorderDisplay)

SetDisplay controls which pages display the border (all pages, first page only, or all but the first page).

### func (PageBorders) SetLeft ¶

    func (b PageBorders) SetLeft(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetLeft sets the left page border.

### func (PageBorders) SetOffsetFrom ¶

    func (b PageBorders) SetOffsetFrom(o wml.ST_PageBorderOffset)

SetOffsetFrom controls whether the border offset is measured from the page edge or from the text. Existing edges still holding the previous setting's default space are moved to the new default; custom values are preserved.

### func (PageBorders) SetRight ¶

    func (b PageBorders) SetRight(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetRight sets the right page border.

### func (PageBorders) SetTop ¶

    func (b PageBorders) SetTop(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetTop sets the top page border.

### func (PageBorders) X ¶

    func (b PageBorders) X() *wml.CT_PageBorders

X returns the inner wml.CT_PageBorders, nil when the section has none.

## type Paragraph ¶

Paragraph is a paragraph within a document.

    type Paragraph struct {
        // contains filtered or unexported fields
    }

### func (Paragraph) AddBookmark ¶

    func (p Paragraph) AddBookmark(name string) Bookmark

AddBookmark adds a bookmark to a document that can then be used from a hyperlink. Name is a document unique name that identifies the bookmark so it can be referenced from hyperlinks.

### func (Paragraph) AddCheckBox ¶

    func (p Paragraph) AddCheckBox(name string) FormField

AddCheckBox adds checkbox form field to the paragraph and returns it.

### func (Paragraph) AddComment ¶

    func (p Paragraph) AddComment(author, commentText string) int64

AddComment add comment to the paragraph.

### func (Paragraph) AddDeletedText ¶

    func (p Paragraph) AddDeletedText(oldVal, revNum, author string, t time.Time, id int64)

AddDeletedText add a text deletion to the paragraph specifying its revision number, author and id.

### func (Paragraph) AddDropdownList ¶

    func (p Paragraph) AddDropdownList(name string) FormField

AddDropdownList adds dropdown list form field to the paragraph and returns it.

### func (Paragraph) AddEndnote ¶

    func (p Paragraph) AddEndnote(text string) Endnote

AddEndnote will create a new endnote and attach it to the Paragraph in the location at the end of the previous run (endnotes create their own run within the paragraph. The text given to the function is simply a convenience helper, paragraphs and runs can always be added to the text of the endnote later.

### func (Paragraph) AddFootnote ¶

    func (p Paragraph) AddFootnote(text string) Footnote

AddFootnote will create a new footnote and attach it to the Paragraph in the location at the end of the previous run (footnotes create their own run within the paragraph). The text given to the function is simply a convenience helper, paragraphs and runs can always be added to the text of the footnote later.

### func (Paragraph) AddHTML ¶

    func (p Paragraph) AddHTML(s string)

AddHTML adds a text that contains HTML tags to a paragraph.

The following tags are supported:

    - <b> or <strong> for bold text
    - <i> or <em> for italic text
    - <u> for underlined text
    - <strike> for strikethrough text
    - <mark> for highlighted text
    - <sub> for subscript text
    - <sup> for superscript text

### func (Paragraph) AddHyperLink ¶

    func (p Paragraph) AddHyperLink() HyperLink

AddHyperLink adds a new hyperlink to a parapgraph.

### func (Paragraph) AddInsertedText ¶

    func (p Paragraph) AddInsertedText(newVal, revNum, author string, t time.Time, id int64)

AddInsertedText add a text insertion to the paragraph specifying its revision number, author and id.

### func (Paragraph) AddRun ¶

    func (p Paragraph) AddRun() Run

AddRun adds a run to a paragraph.

### func (Paragraph) AddStructuredDocumentTag ¶

    func (p Paragraph) AddStructuredDocumentTag() InlineStructuredDocumentTag

AddStructuredDocumentTag appends a new, empty inline (run-level) structured document tag to the paragraph and returns it. The tag is assigned a document-unique ID so it cannot collide with existing tags.

### func (Paragraph) AddTextInput ¶

    func (p Paragraph) AddTextInput(name string) FormField

AddTextInput adds text input form field to the paragraph and returns it.

### func (Paragraph) Borders ¶

    func (p Paragraph) Borders() ParagraphBorders

Borders returns the ParagraphBorders for setting-up border on paragraph.

### func (Paragraph) CloseComment ¶

    func (p Paragraph) CloseComment(commentId int64)

CloseComment will close the comment.

### func (Paragraph) IgnoreSpaceBetweenParagraphOfSameStyle ¶

    func (p Paragraph) IgnoreSpaceBetweenParagraphOfSameStyle()

IgnoreSpaceBetweenParagraphOfSameStyle sets contextual spacing.

### func (Paragraph) InsertRunAfter ¶

    func (p Paragraph) InsertRunAfter(relativeTo Run) Run

InsertRunAfter inserts a run in the paragraph after the relative run.

### func (Paragraph) InsertRunBefore ¶

    func (p Paragraph) InsertRunBefore(relativeTo Run) Run

InsertRunBefore inserts a run in the paragraph before the relative run.

### func (Paragraph) Numbering ¶

    func (p Paragraph) Numbering() Numbering

Numbering return numbering that being use by paragraph.

### func (Paragraph) Properties ¶

    func (p Paragraph) Properties() ParagraphProperties

Properties returns the paragraph properties.

### func (Paragraph) RemoveEndnote ¶

    func (p Paragraph) RemoveEndnote(id int64)

RemoveEndnote removes a endnote from both the paragraph and the document the requested endnote must be anchored on the paragraph being referenced.

After each removal, the rest of the endnote ids would be reordered.

### func (Paragraph) RemoveFootnote ¶

    func (p Paragraph) RemoveFootnote(id int64)

RemoveFootnote removes a footnote from both the paragraph and the document the requested footnote must be anchored on the paragraph being referenced.

After each removal, the rest of the footnote ids would be reordered.

### func (Paragraph) RemoveRun ¶

    func (p Paragraph) RemoveRun(r Run)

RemoveRun removes a child run from a paragraph.

### func (Paragraph) Runs ¶

    func (p Paragraph) Runs() []Run

Runs returns all of the runs in a paragraph.

### func (Paragraph) SetAfterLineSpacing ¶

    func (p Paragraph) SetAfterLineSpacing(d measurement.Distance)

SetAfterLineSpacing sets spacing below paragraph in line units.

### func (Paragraph) SetAfterSpacing ¶

    func (p Paragraph) SetAfterSpacing(d measurement.Distance)

SetAfterSpacing sets spacing below paragraph.

### func (Paragraph) SetAlignment ¶

    func (p Paragraph) SetAlignment(alignment wml.ST_Jc)

SetAlignment set alignment of paragraph.

### func (Paragraph) SetBeforeLineSpacing ¶

    func (p Paragraph) SetBeforeLineSpacing(d measurement.Distance)

// SetBeforeLineSpacing sets spacing above paragraph in line units.

### func (Paragraph) SetBeforeSpacing ¶

    func (p Paragraph) SetBeforeSpacing(d measurement.Distance)

SetBeforeSpacing sets spacing above paragraph.

### func (Paragraph) SetFirstLineIndent ¶

    func (p Paragraph) SetFirstLineIndent(m measurement.Distance)

SetFirstLineIndent controls the indentation of the first line in a paragraph.

### func (Paragraph) SetHangingIndent ¶

    func (p Paragraph) SetHangingIndent(m measurement.Distance)

SetHangingIndent controls special indent of paragraph.

### func (Paragraph) SetLeftIndent ¶

    func (p Paragraph) SetLeftIndent(m measurement.Distance)

SetLeftIndent controls left indent of paragraph.

### func (Paragraph) SetLineSpacing ¶

    func (p Paragraph) SetLineSpacing(d measurement.Distance, rule wml.ST_LineSpacingRule)

SetLineSpacing sets the spacing between lines in a paragraph.

### func (Paragraph) SetNumberingDefinition ¶

    func (p Paragraph) SetNumberingDefinition(nd NumberingDefinition)

SetNumberingDefinition sets the numbering definition ID via a NumberingDefinition defined in numbering.xml

### func (Paragraph) SetNumberingDefinitionByID ¶

    func (p Paragraph) SetNumberingDefinitionByID(abstractNumberID int64)

SetNumberingDefinitionByID sets the numbering definition ID directly, which must match an ID defined in numbering.xml

### func (Paragraph) SetNumberingLevel ¶

    func (p Paragraph) SetNumberingLevel(listLevel int)

SetNumberingLevel sets the numbering level of a paragraph. If used, then the NumberingDefinition must also be set via SetNumberingDefinition or SetNumberingDefinitionByID.

### func (Paragraph) SetOutlineLvl ¶

    func (p Paragraph) SetOutlineLvl(lvl int64)

SetOutlineLvl sets outline level of paragraph.

### func (Paragraph) SetRightIndent ¶

    func (p Paragraph) SetRightIndent(m measurement.Distance)

SetRightIndent controls right indent of paragraph.

### func (Paragraph) SetStyle ¶

    func (p Paragraph) SetStyle(s string)

SetStyle sets the style of a paragraph and is identical to setting it on the paragraph's Properties()

### func (Paragraph) StructuredDocumentTags ¶

    func (p Paragraph) StructuredDocumentTags() []InlineStructuredDocumentTag

StructuredDocumentTags returns the inline (run-level) structured document tags within the paragraph, descending into hyperlinks, simple fields, and nested inline structured document tags so discovery matches Document.walkSdts.

### func (Paragraph) Style ¶

    func (p Paragraph) Style() string

Style returns the style for a paragraph, or an empty string if it is unset.

### func (Paragraph) X ¶

    func (p Paragraph) X() *wml.CT_P

X returns the inner wrapped XML type.

## type ParagraphBorders ¶

ParagraphBorders allows manipulation of borders on a paragraph.

    type ParagraphBorders struct {
        // contains filtered or unexported fields
    }

### func (ParagraphBorders) SetAll ¶

    func (pb ParagraphBorders) SetAll(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetAll sets all of the borders to a given value.

### func (ParagraphBorders) SetBetween ¶

    func (pb ParagraphBorders) SetBetween(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetBetween sets the between border to a specified type, color and thickness between paragraph.

### func (ParagraphBorders) SetBottom ¶

    func (pb ParagraphBorders) SetBottom(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetBottom sets the bottom border to a specified type, color and thickness.

### func (ParagraphBorders) SetLeft ¶

    func (pb ParagraphBorders) SetLeft(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetLeft sets the left border to a specified type, color and thickness.

### func (ParagraphBorders) SetRight ¶

    func (pb ParagraphBorders) SetRight(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetRight sets the right border to a specified type, color and thickness.

### func (ParagraphBorders) SetTop ¶

    func (pb ParagraphBorders) SetTop(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetTop sets the top border to a specified type, color and thickness.

### func (ParagraphBorders) X ¶

    func (pb ParagraphBorders) X() *wml.CT_PBdr

X returns the inner wml.CT_PBdr

## type ParagraphProperties ¶

ParagraphProperties are the properties for a paragraph.

    type ParagraphProperties struct {
        // contains filtered or unexported fields
    }

### func (ParagraphProperties) AddSection ¶

    func (p ParagraphProperties) AddSection(t wml.ST_SectionMark) Section

AddSection adds a new document section with an optional section break. If t is ST_SectionMarkUnset, then no break will be inserted.

### func (ParagraphProperties) AddTabStop ¶

    func (p ParagraphProperties) AddTabStop(position measurement.Distance, justificaton wml.ST_TabJc, leader wml.ST_TabTlc)

AddTabStop adds a tab stop to the paragraph. It controls the position of text when using Run.AddTab()

### func (ParagraphProperties) Bold ¶

    func (p ParagraphProperties) Bold() bool

Bold returns true if paragraph font is bold.

### func (ParagraphProperties) Caps ¶

    func (p ParagraphProperties) Caps() bool

Caps returns true if paragraph font is capitalized.

### func (ParagraphProperties) CharacterSpacingMeasure ¶

    func (p ParagraphProperties) CharacterSpacingMeasure() string

CharacterSpacingMeasure returns paragraph characters spacing with its measure which can be mm, cm, in, pt, pc or pi.

### func (ParagraphProperties) CharacterSpacingValue ¶

    func (p ParagraphProperties) CharacterSpacingValue() int64

CharacterSpacingValue returns the value of characters spacing in twips (1/20 of point).

### func (ParagraphProperties) ComplexSizeMeasure ¶

    func (p ParagraphProperties) ComplexSizeMeasure() string

ComplexSizeMeasure returns font with its measure which can be mm, cm, in, pt, pc or pi.

### func (ParagraphProperties) ComplexSizeValue ¶

    func (p ParagraphProperties) ComplexSizeValue() float64

ComplexSizeValue returns the value of paragraph font size for complex fonts in points.

### func (ParagraphProperties) DoubleStrike ¶

    func (p ParagraphProperties) DoubleStrike() bool

DoubleStrike returns true if paragraph is double striked.

### func (ParagraphProperties) EastAsiaFont ¶

    func (p ParagraphProperties) EastAsiaFont() string

EastAsiaFont returns the name of paragraph font family for East Asia.

### func (ParagraphProperties) Emboss ¶

    func (p ParagraphProperties) Emboss() bool

Emboss returns true if paragraph emboss is on.

### func (ParagraphProperties) Font ¶

    func (p ParagraphProperties) Font() string

Font returns the name of paragraph font family.

### func (ParagraphProperties) GetColor ¶

    func (p ParagraphProperties) GetColor() color.Color

GetColor returns the color.Color object representing the run color.

### func (ParagraphProperties) Italic ¶

    func (p ParagraphProperties) Italic() bool

Italic returns true if paragraph font is italic.

### func (ParagraphProperties) Outline ¶

    func (p ParagraphProperties) Outline() bool

Outline returns true if paragraph outline is on.

### func (ParagraphProperties) RStyle ¶

    func (p ParagraphProperties) RStyle() string

RStyle returns the name of character style. It is defined here http://officeopenxml.com/WPstyleCharStyles.php

### func (ParagraphProperties) RightToLeft ¶

    func (p ParagraphProperties) RightToLeft() bool

RightToLeft returns true if paragraph text goes from right to left.

### func (ParagraphProperties) Section ¶

    func (p ParagraphProperties) Section() (Section, bool)

Section return paragraph properties section value.

### func (ParagraphProperties) SetAlignment ¶

    func (p ParagraphProperties) SetAlignment(align wml.ST_Jc)

SetAlignment controls the paragraph alignment

### func (ParagraphProperties) SetEndIndent ¶

    func (p ParagraphProperties) SetEndIndent(m measurement.Distance)

SetEndIndent controls the end indentation.

### func (ParagraphProperties) SetFirstLineIndent ¶

    func (p ParagraphProperties) SetFirstLineIndent(m measurement.Distance)

SetFirstLineIndent controls the indentation of the first line in a paragraph.

### func (ParagraphProperties) SetHangingIndent ¶

    func (p ParagraphProperties) SetHangingIndent(m measurement.Distance)

SetHangingIndent controls the indentation of the non-first lines in a paragraph.

### func (ParagraphProperties) SetHeadingLevel ¶

    func (p ParagraphProperties) SetHeadingLevel(idx int)

SetHeadingLevel sets a heading level and style based on the level to a paragraph. The default styles for a new unioffice document support headings from level 1 to 8.

### func (ParagraphProperties) SetKeepOnOnePage ¶

    func (p ParagraphProperties) SetKeepOnOnePage(b bool)

SetKeepOnOnePage controls if all lines in a paragraph are kept on the same page.

### func (ParagraphProperties) SetKeepWithNext ¶

    func (p ParagraphProperties) SetKeepWithNext(b bool)

SetKeepWithNext controls if this paragraph should be kept with the next.

### func (ParagraphProperties) SetPageBreakBefore ¶

    func (p ParagraphProperties) SetPageBreakBefore(b bool)

SetPageBreakBefore controls if there is a page break before this paragraph.

### func (ParagraphProperties) SetSpacing ¶

    func (p ParagraphProperties) SetSpacing(before, after measurement.Distance)

SetSpacing sets the spacing that comes before and after the paragraph. Deprecated: See Spacing() instead which allows finer control.

### func (ParagraphProperties) SetStartIndent ¶

    func (p ParagraphProperties) SetStartIndent(m measurement.Distance)

SetStartIndent controls the start indentation.

### func (ParagraphProperties) SetStyle ¶

    func (p ParagraphProperties) SetStyle(s string)

SetStyle sets the style of a paragraph.

### func (ParagraphProperties) SetWindowControl ¶

    func (p ParagraphProperties) SetWindowControl(b bool)

SetWindowControl controls if the first or last line of the paragraph is allowed to display on a separate page.

### func (ParagraphProperties) Shadow ¶

    func (p ParagraphProperties) Shadow() bool

Shadow returns true if paragraph shadow is on.

### func (ParagraphProperties) SizeMeasure ¶

    func (p ParagraphProperties) SizeMeasure() string

SizeMeasure returns font with its measure which can be mm, cm, in, pt, pc or pi.

### func (ParagraphProperties) SizeValue ¶

    func (p ParagraphProperties) SizeValue() float64

SizeValue returns the value of paragraph font size in points.

### func (ParagraphProperties) Spacing ¶

    func (p ParagraphProperties) Spacing() ParagraphSpacing

Spacing returns the paragraph spacing settings.

### func (ParagraphProperties) Strike ¶

    func (p ParagraphProperties) Strike() bool

Strike returns true if paragraph is striked.

### func (ParagraphProperties) Style ¶

    func (p ParagraphProperties) Style() string

Style returns the style for a paragraph, or an empty string if it is unset.

### func (ParagraphProperties) Underline ¶

    func (p ParagraphProperties) Underline() wml.ST_Underline

Underline returns the type of paragraph underline.

### func (ParagraphProperties) UnderlineColor ¶

    func (p ParagraphProperties) UnderlineColor() string

UnderlineColor returns the hex color value of paragraph underline.

### func (ParagraphProperties) VerticalAlignment ¶

    func (p ParagraphProperties) VerticalAlignment() sharedTypes.ST_VerticalAlignRun

VerticalAlign returns the value of paragraph vertical align.

### func (ParagraphProperties) X ¶

    func (p ParagraphProperties) X() *wml.CT_PPr

X returns the inner wrapped XML type.

## type ParagraphSpacing ¶

ParagraphSpacing controls the spacing for a paragraph and its lines.

    type ParagraphSpacing struct {
        // contains filtered or unexported fields
    }

### func (ParagraphSpacing) SetAfter ¶

    func (p ParagraphSpacing) SetAfter(after measurement.Distance)

SetAfter sets the spacing that comes after the paragraph.

### func (ParagraphSpacing) SetAfterAuto ¶

    func (p ParagraphSpacing) SetAfterAuto(b bool)

SetAfterAuto controls if spacing after a paragraph is automatically determined.

### func (ParagraphSpacing) SetBefore ¶

    func (p ParagraphSpacing) SetBefore(before measurement.Distance)

SetBefore sets the spacing that comes before the paragraph.

### func (ParagraphSpacing) SetBeforeAuto ¶

    func (p ParagraphSpacing) SetBeforeAuto(b bool)

SetBeforeAuto controls if spacing before a paragraph is automatically determined.

### func (ParagraphSpacing) SetLineSpacing ¶

    func (p ParagraphSpacing) SetLineSpacing(d measurement.Distance, rule wml.ST_LineSpacingRule)

SetLineSpacing sets the spacing between lines in a paragraph.

## type ParagraphStyleProperties ¶

ParagraphStyleProperties is the styling information for a paragraph.

    type ParagraphStyleProperties struct {
        // contains filtered or unexported fields
    }

### func (ParagraphStyleProperties) AddTabStop ¶

    func (p ParagraphStyleProperties) AddTabStop(position measurement.Distance, justificaton wml.ST_TabJc, leader wml.ST_TabTlc)

AddTabStop adds a tab stop to the paragraph.

### func (ParagraphStyleProperties) NumId ¶

    func (p ParagraphStyleProperties) NumId() int64

NumId return numbering numId that being use by style properties.

### func (ParagraphStyleProperties) SetAlignment ¶

    func (p ParagraphStyleProperties) SetAlignment(align wml.ST_Jc)

SetAlignment controls the paragraph alignment

### func (ParagraphStyleProperties) SetContextualSpacing ¶

    func (p ParagraphStyleProperties) SetContextualSpacing(b bool)

SetContextualSpacing controls whether to Ignore Spacing Above and Below When Using Identical Styles

### func (ParagraphStyleProperties) SetFirstLineIndent ¶

    func (p ParagraphStyleProperties) SetFirstLineIndent(m measurement.Distance)

SetFirstLineIndent controls the first line indent of the paragraph.

### func (ParagraphStyleProperties) SetHangingIndent ¶

    func (p ParagraphStyleProperties) SetHangingIndent(m measurement.Distance)

SetHangingIndent controls the hanging indent of the paragraph.

### func (ParagraphStyleProperties) SetKeepNext ¶

    func (p ParagraphStyleProperties) SetKeepNext(b bool)

SetKeepNext controls if the paragraph is kept with the next paragraph.

### func (ParagraphStyleProperties) SetKeepOnOnePage ¶

    func (p ParagraphStyleProperties) SetKeepOnOnePage(b bool)

SetKeepOnOnePage controls if all lines in a paragraph are kept on the same page.

### func (ParagraphStyleProperties) SetLeftIndent ¶

    func (p ParagraphStyleProperties) SetLeftIndent(m measurement.Distance)

SetLeftIndent controls the left indent of the paragraph.

### func (ParagraphStyleProperties) SetLineSpacing ¶

    func (p ParagraphStyleProperties) SetLineSpacing(m measurement.Distance, rule wml.ST_LineSpacingRule)

SetLineSpacing controls the line spacing of the paragraph.

### func (ParagraphStyleProperties) SetOutlineLevel ¶

    func (p ParagraphStyleProperties) SetOutlineLevel(lvl int)

SetOutlineLevel sets the outline level of this style.

### func (ParagraphStyleProperties) SetSpacing ¶

    func (p ParagraphStyleProperties) SetSpacing(before, after measurement.Distance)

SetSpacing sets the spacing that comes before and after the paragraph.

### func (ParagraphStyleProperties) SetStartIndent ¶

    func (p ParagraphStyleProperties) SetStartIndent(m measurement.Distance)

SetStartIndent controls the start indent of the paragraph.

### func (ParagraphStyleProperties) X ¶

    func (p ParagraphStyleProperties) X() *wml.CT_PPrGeneral

X returns the inner wrapped XML type.

## type Row ¶

Row is a row within a table within a document.

    type Row struct {
        // contains filtered or unexported fields
    }

### func (Row) AddCell ¶

    func (r Row) AddCell() Cell

AddCell adds a cell to a row and returns it

### func (Row) Cells ¶

    func (r Row) Cells() []Cell

Cells returns the cells defined in the table.

### func (Row) Properties ¶

    func (r Row) Properties() RowProperties

Properties returns the row properties.

### func (Row) X ¶

    func (r Row) X() *wml.CT_Row

X returns the inner wrapped XML type.

## type RowProperties ¶

RowProperties are the properties for a row within a table

    type RowProperties struct {
        // contains filtered or unexported fields
    }

### func (RowProperties) SetCantSplit ¶

    func (r RowProperties) SetCantSplit(val bool)

SetCantSplit set row properties for Can't Split value.

### func (RowProperties) SetHeight ¶

    func (r RowProperties) SetHeight(ht measurement.Distance, rule wml.ST_HeightRule)

SetHeight allows controlling the height of a row within a table.

### func (RowProperties) SetTblHeader ¶

    func (r RowProperties) SetTblHeader(val bool)

SetTblHeader set row properties for repeat table row on every new page value.

## type Run ¶

Run is a run of text within a paragraph that shares the same formatting.

    type Run struct {
        // contains filtered or unexported fields
    }

### func (Run) AddAnnotationReference ¶

    func (r Run) AddAnnotationReference()

AddAnnotationReference adds annotation reference to a run.

### func (Run) AddBreak ¶

    func (r Run) AddBreak()

AddBreak adds a line break to a run.

### func (Run) AddCommentReference ¶

    func (r Run) AddCommentReference(id int64)

AddCommentReference adds comment reference to a run.

### func (Run) AddDrawingAnchored ¶

    func (r Run) AddDrawingAnchored(img common.ImageRef) (AnchoredDrawing, error)

AddDrawingAnchored adds an anchored (floating) drawing from an ImageRef.

### func (Run) AddDrawingInline ¶

    func (r Run) AddDrawingInline(img common.ImageRef) (InlineDrawing, error)

AddDrawingInline adds an inline drawing from an ImageRef.

### func (Run) AddEndnoteReference ¶

    func (r Run) AddEndnoteReference()

AddEndnoteReference adds a footnote reference to a run.

### func (Run) AddField ¶

    func (r Run) AddField(code string)

AddField adds a field (automatically computed text) to the document.

### func (Run) AddFieldWithFormatting ¶

    func (r Run) AddFieldWithFormatting(code string, fmt string, isDirty bool)

AddFieldWithFormatting adds a field (automatically computed text) to the document with field specifc formatting.

### func (Run) AddFootnoteReference ¶

    func (r Run) AddFootnoteReference()

AddFootnoteReference adds a footnote reference to a run.

### func (Run) AddHTML ¶

    func (r Run) AddHTML(s string)

AddHTML adds HTML text to a run.

### func (Run) AddPageBreak ¶

    func (r Run) AddPageBreak()

AddPageBreak adds a page break to a run.

### func (Run) AddTOC ¶

    func (r Run) AddTOC(options *TOCOptions)

AddTOC adds a table of contents to the document and customize it according to TOCOptions if necessary.

### func (Run) AddTab ¶

    func (r Run) AddTab()

AddTab adds tab to a run and can be used with the the Paragraph's tab stops.

### func (Run) AddText ¶

    func (r Run) AddText(s string)

AddText adds text to a run.

### func (Run) Clear ¶

    func (r Run) Clear()

Clear removes all the content from within a run.

### func (Run) ClearContent ¶

    func (r Run) ClearContent()

ClearContent clears any content in the run (text, tabs, breaks, etc.)

### func (Run) Control ¶

    func (r Run) Control() *axcontrol.Control

Control returns an *axcontrol.Control object contained in the run or the nil value in case of no controls.

### func (Run) Copy ¶

    func (r Run) Copy() Run

Copy returns a copy of the run.

### func (Run) DrawingAnchored ¶

    func (r Run) DrawingAnchored() []AnchoredDrawing

DrawingAnchored returns a slice of AnchoredDrawings.

### func (Run) DrawingInline ¶

    func (r Run) DrawingInline() []InlineDrawing

DrawingInline return a slice of InlineDrawings.

### func (Run) IsEndnote ¶

    func (r Run) IsEndnote() (bool, int64)

IsEndnote returns a bool based on whether the run has a footnote or not. Returns both a bool as to whether it has a footnote as well as the ID of the footnote.

### func (Run) IsFootnote ¶

    func (r Run) IsFootnote() (bool, int64)

IsFootnote returns a bool based on whether the run has a footnote or not. Returns both a bool as to whether it has a footnote as well as the ID of the footnote.

### func (Run) Properties ¶

    func (r Run) Properties() RunProperties

Properties returns the run properties.

### func (Run) SetProperties ¶

    func (r Run) SetProperties(rp RunProperties)

SetProperties sets the `RunProperties` to the `Run` element

### func (Run) Text ¶

    func (r Run) Text() string

Text returns the underlying text in the run.

### func (Run) X ¶

    func (r Run) X() *wml.CT_R

X returns the inner wrapped XML type.

## type RunProperties ¶

RunProperties controls run styling properties.

    type RunProperties struct {
        // contains filtered or unexported fields
    }

### func (RunProperties) Bold ¶

    func (r RunProperties) Bold() bool

Bold returns true if run font is bold.

### func (RunProperties) BoldValue ¶

    func (r RunProperties) BoldValue() OnOffValue

BoldValue returns the precise nature of the bold setting (unset, off or on).

### func (RunProperties) Caps ¶

    func (r RunProperties) Caps() bool

Caps returns true if run font is capitalized.

### func (RunProperties) CharacterSpacingMeasure ¶

    func (r RunProperties) CharacterSpacingMeasure() string

CharacterSpacingMeasure returns paragraph characters spacing with its measure which can be mm, cm, in, pt, pc or pi.

### func (RunProperties) CharacterSpacingValue ¶

    func (r RunProperties) CharacterSpacingValue() int64

CharacterSpacingValue returns the value of run's characters spacing in twips (1/20 of point).

### func (RunProperties) ClearColor ¶

    func (r RunProperties) ClearColor()

ClearColor clears the text color.

### func (RunProperties) Color ¶

    func (r RunProperties) Color() Color

Color returns the style's Color.

### func (RunProperties) ComplexSizeMeasure ¶

    func (r RunProperties) ComplexSizeMeasure() string

ComplexSizeMeasure returns font with its measure which can be mm, cm, in, pt, pc or pi.

### func (RunProperties) ComplexSizeValue ¶

    func (r RunProperties) ComplexSizeValue() float64

ComplexSizeValue returns the value of run font size for complex fonts in points.

### func (RunProperties) DoubleStrike ¶

    func (r RunProperties) DoubleStrike() bool

DoubleStrike returns true if run is double striked.

### func (RunProperties) EastAsiaFont ¶

    func (r RunProperties) EastAsiaFont() string

EastAsiaFont returns the name of run font family for East Asia.

### func (RunProperties) Emboss ¶

    func (r RunProperties) Emboss() bool

Emboss returns true if run emboss is on.

### func (RunProperties) Font ¶

    func (r RunProperties) Font() string

Font returns the name of run font family.

### func (RunProperties) Fonts ¶

    func (r RunProperties) Fonts() Fonts

Fonts returns the style's Fonts.

### func (RunProperties) GetColor ¶

    func (r RunProperties) GetColor() color.Color

GetColor returns the color.Color object representing the run color.

### func (RunProperties) GetEffect ¶

    func (r RunProperties) GetEffect() wml.ST_TextEffect

GetEffect returns the effect of the run.

### func (RunProperties) GetHighlight ¶

    func (r RunProperties) GetHighlight() wml.ST_HighlightColor

GetHighlight returns the HighlightColor.

### func (RunProperties) GetKerning ¶

    func (r RunProperties) GetKerning() measurement.Distance

GetKerning returns the kerning (character spacing) of a run

### func (RunProperties) GetRightToLeft ¶

    func (r RunProperties) GetRightToLeft() bool

GetRightToLeft returns true if the run text is displayed from right to left.

### func (RunProperties) GetShading ¶

    func (r RunProperties) GetShading() wml.ST_Shd

GetShading returns the run shading pattern, or wml.ST_ShdUnset if no shading is set.

### func (RunProperties) GetShadingColor ¶

    func (r RunProperties) GetShadingColor() color.Color

GetShadingColor returns the run shading pattern (foreground) color.

### func (RunProperties) GetShadingFill ¶

    func (r RunProperties) GetShadingFill() color.Color

GetShadingFill returns the run shading fill (background) color.

### func (RunProperties) Imprint ¶

    func (r RunProperties) Imprint() bool

Imprint returns true if run imprint is on.

### func (RunProperties) IsBold ¶

    func (r RunProperties) IsBold() bool

IsBold returns true if the run has been set to bold.

### func (RunProperties) IsItalic ¶

    func (r RunProperties) IsItalic() bool

IsItalic returns true if the run has been set to italics.

### func (RunProperties) Italic ¶

    func (r RunProperties) Italic() bool

Italic returns true if run font is italic.

### func (RunProperties) ItalicValue ¶

    func (r RunProperties) ItalicValue() OnOffValue

ItalicValue returns the precise nature of the italic setting (unset, off or on).

### func (RunProperties) Outline ¶

    func (r RunProperties) Outline() bool

Outline returns true if run outline is on.

### func (RunProperties) RStyle ¶

    func (r RunProperties) RStyle() string

RStyle returns the name of character style. It is defined here http://officeopenxml.com/WPstyleCharStyles.php

### func (RunProperties) RightToLeft ¶

    func (r RunProperties) RightToLeft() bool

RightToLeft returns true if run text goes from right to left.

### func (RunProperties) SetAllCaps ¶

    func (r RunProperties) SetAllCaps(b bool)

SetAllCaps sets the run to all caps.

### func (RunProperties) SetBold ¶

    func (r RunProperties) SetBold(b bool)

SetBold sets the run to bold.

### func (RunProperties) SetCharacterSpacing ¶

    func (r RunProperties) SetCharacterSpacing(size measurement.Distance)

SetCharacterSpacing sets the run's Character Spacing Adjustment.

### func (RunProperties) SetColor ¶

    func (r RunProperties) SetColor(c color.Color)

SetColor sets the text color.

### func (RunProperties) SetDoubleStrikeThrough ¶

    func (r RunProperties) SetDoubleStrikeThrough(b bool)

SetDoubleStrikeThrough sets the run to double strike-through.

### func (RunProperties) SetEffect ¶

    func (r RunProperties) SetEffect(e wml.ST_TextEffect)

SetEffect sets a text effect on the run.

### func (RunProperties) SetEmboss ¶

    func (r RunProperties) SetEmboss(b bool)

SetEmboss sets the run to embossed text.

### func (RunProperties) SetFontFamily ¶

    func (r RunProperties) SetFontFamily(family string)

SetFontFamily sets the Ascii & HAnsi fonly family for a run.

### func (RunProperties) SetHighlight ¶

    func (r RunProperties) SetHighlight(c wml.ST_HighlightColor)

SetHighlight highlights text in a specified color. Highlighting (w:highlight) is limited to the fixed set of ST_HighlightColor values; for an arbitrary RGB background color use SetShading instead. Passing wml.ST_HighlightColorUnset removes the highlight.

### func (RunProperties) SetImprint ¶

    func (r RunProperties) SetImprint(b bool)

SetImprint sets the run to imprinted text.

### func (RunProperties) SetItalic ¶

    func (r RunProperties) SetItalic(b bool)

SetItalic sets the run to italic.

### func (RunProperties) SetKerning ¶

    func (r RunProperties) SetKerning(size measurement.Distance)

SetKerning sets the run's font kerning.

### func (RunProperties) SetOutline ¶

    func (r RunProperties) SetOutline(b bool)

SetOutline sets the run to outlined text.

### func (RunProperties) SetRightToLeft ¶

    func (r RunProperties) SetRightToLeft(b bool)

SetRightToLeft sets the run text goes from right to left.

### func (RunProperties) SetShading ¶

    func (r RunProperties) SetShading(shd wml.ST_Shd, foreground, fill color.Color)

SetShading controls the run shading (w:shd), which unlike SetHighlight accepts an arbitrary RGB fill color for the text background. Word draws the highlight over the shading if both are set. Passing wml.ST_ShdUnset removes the run's own shading; shading inherited from styles still applies.

### func (RunProperties) SetShadow ¶

    func (r RunProperties) SetShadow(b bool)

SetShadow sets the run to shadowed text.

### func (RunProperties) SetSize ¶

    func (r RunProperties) SetSize(size measurement.Distance)

SetSize sets the font size for a run.

### func (RunProperties) SetSmallCaps ¶

    func (r RunProperties) SetSmallCaps(b bool)

SetSmallCaps sets the run to small caps.

### func (RunProperties) SetStrikeThrough ¶

    func (r RunProperties) SetStrikeThrough(b bool)

SetStrikeThrough sets the run to strike-through.

### func (RunProperties) SetStyle ¶

    func (r RunProperties) SetStyle(style string)

SetStyle sets the font size.

### func (RunProperties) SetUnderline ¶

    func (r RunProperties) SetUnderline(style wml.ST_Underline, c color.Color)

SetUnderline controls underline for a run style.

### func (RunProperties) SetVerticalAlignment ¶

    func (r RunProperties) SetVerticalAlignment(v sharedTypes.ST_VerticalAlignRun)

SetVerticalAlignment controls the vertical alignment of the run, this is used to control if text is superscript/subscript.

### func (RunProperties) Shadow ¶

    func (r RunProperties) Shadow() bool

Shadow returns true if run shadow is on.

### func (RunProperties) SizeMeasure ¶

    func (r RunProperties) SizeMeasure() string

SizeMeasure returns font with its measure which can be mm, cm, in, pt, pc or pi.

### func (RunProperties) SizeValue ¶

    func (r RunProperties) SizeValue() float64

SizeValue returns the value of run font size in points.

### func (RunProperties) Strike ¶

    func (r RunProperties) Strike() bool

Strike returns true if run is striked.

### func (RunProperties) Underline ¶

    func (r RunProperties) Underline() wml.ST_Underline

Underline returns the type of run underline.

### func (RunProperties) UnderlineColor ¶

    func (r RunProperties) UnderlineColor() string

UnderlineColor returns the hex color value of run underline.

### func (RunProperties) VerticalAlignment ¶

    func (r RunProperties) VerticalAlignment() sharedTypes.ST_VerticalAlignRun

VerticalAlign returns the value of run vertical align.

### func (RunProperties) X ¶

    func (r RunProperties) X() *wml.CT_RPr

X returns the inner wrapped XML type.

## type SdtListItem ¶

SdtListItem is a single entry in a combo-box or drop-down-list structured document tag. DisplayText is shown to the user; Value is the stored value.

    type SdtListItem struct {
        DisplayText string
        Value       string
    }

## type SdtLock ¶

SdtLock controls whether a structured document tag and/or its contents can be deleted or edited. It maps to the w:lock element.

    type SdtLock byte

    const (
        SdtLockUnset            SdtLock = iota // no locking
        SdtLockSdtLocked                       // the tag cannot be deleted
        SdtLockContentLocked                   // the contents cannot be edited
        SdtLockUnlocked                        // explicitly unlocked
        SdtLockSdtContentLocked                // the tag cannot be deleted and contents cannot be edited
    )

## type SdtType ¶

SdtType identifies the content-type variant configured on a structured document tag (the w:sdtPr choice element).

    type SdtType byte

    const (
        SdtTypeUnknown SdtType = iota
        SdtTypeRichText
        SdtTypeText
        SdtTypePicture
        SdtTypeComboBox
        SdtTypeDropDownList
        SdtTypeDate
        SdtTypeGroup
        SdtTypeEquation
        SdtTypeCitation
        SdtTypeBibliography
        SdtTypeDocPartObj
        SdtTypeDocPartList
    )

## type Section ¶

Section is the beginning of a new section.

    type Section struct {
        // contains filtered or unexported fields
    }

### func (Section) ClearColumns ¶

    func (s Section) ClearColumns()

ClearColumns restores the section to a single-column layout.

### func (Section) ClearLineNumbering ¶

    func (s Section) ClearLineNumbering()

ClearLineNumbering removes line numbering from the section.

### func (Section) ClearPageBorders ¶

    func (s Section) ClearPageBorders()

ClearPageBorders removes all page borders from the section.

### func (Section) ClearPageNumbering ¶

    func (s Section) ClearPageNumbering()

ClearPageNumbering removes the section's page numbering settings.

### func (Section) GetFooter ¶

    func (s Section) GetFooter(t wml.ST_HdrFtr) (Footer, bool)

GetFooter gets a section Footer for given type

### func (Section) GetHeader ¶

    func (s Section) GetHeader(t wml.ST_HdrFtr) (Header, bool)

GetHeader gets a section Header for given type t [ST_HdrFtrDefault, ST_HdrFtrEven, ST_HdrFtrFirst]

### func (Section) PageBorders ¶

    func (s Section) PageBorders() PageBorders

PageBorders returns the section's page borders. The underlying element is created on first write with borders offset from the page edge (Word's default); use SetOffsetFrom to measure from the text instead.

### func (Section) SetColumns ¶

    func (s Section) SetColumns(num int, spacing measurement.Distance, separator bool)

SetColumns lays the section out in num equal-width columns with spacing between them, optionally drawing a vertical separator line between columns.

### func (Section) SetCustomColumns ¶

    func (s Section) SetCustomColumns(columns []ColumnSpec, separator bool)

SetCustomColumns lays the section out in unequal-width columns. The widths and spaces should sum to the text width (page width minus margins). An empty columns slice is equivalent to ClearColumns.

### func (Section) SetFooter ¶

    func (s Section) SetFooter(f Footer, t wml.ST_HdrFtr)

SetFooter sets a section footer.

### func (Section) SetHeader ¶

    func (s Section) SetHeader(h Header, t wml.ST_HdrFtr)

SetHeader sets a section header.

### func (Section) SetLineNumbering ¶

    func (s Section) SetLineNumbering(countBy, start int, restart wml.ST_LineNumberRestart, distance measurement.Distance)

SetLineNumbering enables line numbering for the section. Every countBy-th line number is displayed (1 = every line), start is the displayed number of the first line (values below 1 are treated as 1), and distance is the gap between the numbers and the text (measurement.Zero uses Word's automatic distance).

### func (Section) SetPageMargins ¶

    func (s Section) SetPageMargins(top, right, bottom, left, header, footer, gutter measurement.Distance)

SetPageMargins sets the page margins for a section

### func (Section) SetPageNumberFormat ¶

    func (s Section) SetPageNumberFormat(f wml.ST_NumberFormat)

SetPageNumberFormat sets the number format used by PAGE fields in the section. Passing wml.ST_NumberFormatUnset is a no-op; use ClearPageNumbering to remove the settings.

### func (Section) SetPageNumberStart ¶

    func (s Section) SetPageNumberStart(start int)

SetPageNumberStart sets the page number of the section's first page (0 is allowed). A negative start removes the explicit start so page numbering continues from the previous section.

### func (Section) SetPageSizeAndOrientation ¶

    func (s Section) SetPageSizeAndOrientation(w, h measurement.Distance, orientation wml.ST_PageOrientation)

SetPageSizeAndOrientation sets the page size and orientation for a section.

### func (Section) SetTitlePage ¶

    func (s Section) SetTitlePage(enable bool)

SetTitlePage controls whether the section uses a different first-page header/footer (see SetHeader/SetFooter with wml.ST_HdrFtrFirst).

### func (Section) TitlePage ¶

    func (s Section) TitlePage() bool

TitlePage returns true if the section uses a different first-page header/footer.

### func (Section) X ¶

    func (s Section) X() *wml.CT_SectPr

X returns the internally wrapped *wml.CT_SectPr.

## type Settings ¶

Settings controls the document settings.

    type Settings struct {
        // contains filtered or unexported fields
    }

### func NewSettings ¶

    func NewSettings() Settings

NewSettings constructs a new empty Settings

### func (Settings) RemoveMailMerge ¶

    func (s Settings) RemoveMailMerge()

RemoveMailMerge removes any mail merge settings

### func (Settings) SetUpdateFieldsOnOpen ¶

    func (s Settings) SetUpdateFieldsOnOpen(b bool)

SetUpdateFieldsOnOpen controls if fields are recalculated upon opening the document. This is useful for things like a table of contents as the library only adds the field code and relies on Word/LibreOffice to actually compute the content.

### func (Settings) X ¶

    func (s Settings) X() *wml.Settings

X returns the inner wrapped XML type.

## type StructuredDocumentTag ¶

StructuredDocumentTag are a tagged bit of content in a document.

    type StructuredDocumentTag struct {
        // contains filtered or unexported fields
    }

### func (StructuredDocumentTag) AddParagraph ¶

    func (s StructuredDocumentTag) AddParagraph() Paragraph

AddParagraph appends a new, empty paragraph to the tag's content.

### func (StructuredDocumentTag) AddTable ¶

    func (s StructuredDocumentTag) AddTable() Table

AddTable appends a new, empty table to the tag's content. Word only permits tables in rich-text or group content controls (or tags with no content type set); configure the tag accordingly, e.g. via SetRichText.

### func (StructuredDocumentTag) Alias ¶

    func (s StructuredDocumentTag) Alias() string

Alias returns the alias (friendly name) of the structured document tag or empty string if not set.

### func (StructuredDocumentTag) Clear ¶

    func (s StructuredDocumentTag) Clear()

Clear removes all content from the structured document tag.

### func (StructuredDocumentTag) DataBinding ¶

    func (s StructuredDocumentTag) DataBinding() (xpath, storeItemID string, ok bool)

DataBinding returns the XML mapping of the tag. ok is false when no data binding is set.

### func (StructuredDocumentTag) ID ¶

    func (s StructuredDocumentTag) ID() int64

ID returns the numeric identifier of the structured document tag, or zero if unset.

### func (StructuredDocumentTag) IsShowingPlaceholder ¶

    func (s StructuredDocumentTag) IsShowingPlaceholder() bool

IsShowingPlaceholder reports whether the tag's current contents are placeholder text.

### func (StructuredDocumentTag) Lock ¶

    func (s StructuredDocumentTag) Lock() SdtLock

Lock returns the lock setting of the tag.

### func (StructuredDocumentTag) Paragraphs ¶

    func (s StructuredDocumentTag) Paragraphs() []Paragraph

Paragraphs returns the paragraphs within a structured document tag.

### func (StructuredDocumentTag) Placeholder ¶

    func (s StructuredDocumentTag) Placeholder() string

Placeholder returns the name of the document part referenced as placeholder text, or empty string if not set.

### func (StructuredDocumentTag) SetAlias ¶

    func (s StructuredDocumentTag) SetAlias(alias string)

SetAlias sets the alias (friendly name) of the structured document tag.

### func (StructuredDocumentTag) SetComboBox ¶

    func (s StructuredDocumentTag) SetComboBox(items ...SdtListItem)

SetComboBox configures the tag as a combo box with the given items.

### func (StructuredDocumentTag) SetContentText ¶

    func (s StructuredDocumentTag) SetContentText(text string)

SetContentText replaces the tag's content with a single paragraph holding the given text in one run.

### func (StructuredDocumentTag) SetDataBinding ¶

    func (s StructuredDocumentTag) SetDataBinding(xpath, storeItemID, prefixMappings string)

SetDataBinding sets the XML mapping of the tag. prefixMappings may be empty.

### func (StructuredDocumentTag) SetDate ¶

    func (s StructuredDocumentTag) SetDate(format string)

SetDate configures the tag as a date picker. format is an optional date display mask (e.g. "M/d/yyyy"); pass "" to leave it unset.

### func (StructuredDocumentTag) SetDropDownList ¶

    func (s StructuredDocumentTag) SetDropDownList(items ...SdtListItem)

SetDropDownList configures the tag as a drop-down list with the given items.

### func (StructuredDocumentTag) SetID ¶

    func (s StructuredDocumentTag) SetID(id int64)

SetID sets the numeric identifier of the structured document tag.

### func (StructuredDocumentTag) SetLock ¶

    func (s StructuredDocumentTag) SetLock(lock SdtLock)

SetLock sets the lock setting of the tag.

### func (StructuredDocumentTag) SetPicture ¶

    func (s StructuredDocumentTag) SetPicture()

SetPicture configures the tag as a picture control.

### func (StructuredDocumentTag) SetPlaceholder ¶

    func (s StructuredDocumentTag) SetPlaceholder(docPartName string)

SetPlaceholder sets the document part referenced as placeholder text.

### func (StructuredDocumentTag) SetRichText ¶

    func (s StructuredDocumentTag) SetRichText()

SetRichText configures the tag as a rich-text control.

### func (StructuredDocumentTag) SetShowingPlaceholder ¶

    func (s StructuredDocumentTag) SetShowingPlaceholder(b bool)

SetShowingPlaceholder sets whether the tag's current contents are placeholder text.

### func (StructuredDocumentTag) SetTag ¶

    func (s StructuredDocumentTag) SetTag(tag string)

SetTag sets the tag (programmatic identifier) of the structured document tag.

### func (StructuredDocumentTag) SetTemporary ¶

    func (s StructuredDocumentTag) SetTemporary(b bool)

SetTemporary sets whether the tag is removed when its contents are edited.

### func (StructuredDocumentTag) SetText ¶

    func (s StructuredDocumentTag) SetText(multiLine bool)

SetText configures the tag as a plain-text control. When multiLine is true, soft line breaks are permitted within the control.

### func (StructuredDocumentTag) Tables ¶

    func (s StructuredDocumentTag) Tables() []Table

Tables returns the tables directly within the structured document tag's content.

### func (StructuredDocumentTag) Tag ¶

    func (s StructuredDocumentTag) Tag() string

Tag returns the tag (programmatic identifier) of the structured document tag or empty string if not set.

### func (StructuredDocumentTag) Temporary ¶

    func (s StructuredDocumentTag) Temporary() bool

Temporary reports whether the tag is removed when its contents are edited.

### func (StructuredDocumentTag) Text ¶

    func (s StructuredDocumentTag) Text() string

Text returns the concatenated text of all runs within the tag's content, including content nested in tables and nested structured document tags.

### func (StructuredDocumentTag) Type ¶

    func (s StructuredDocumentTag) Type() SdtType

Type returns the content-type variant configured on the tag, or SdtTypeUnknown if none is set.

### func (StructuredDocumentTag) X ¶

    func (s StructuredDocumentTag) X() *wml.CT_SdtBlock

X returns the inner wrapped XML type.

## type Style ¶

Style is a style within the styles.xml file.

    type Style struct {
        // contains filtered or unexported fields
    }

### func (Style) Name ¶

    func (s Style) Name() string

Name returns the name of the style if set.

### func (Style) ParagraphProperties ¶

    func (s Style) ParagraphProperties() ParagraphStyleProperties

ParagraphProperties returns the paragraph style properties.

### func (Style) RunProperties ¶

    func (s Style) RunProperties() RunProperties

RunProperties returns the run style properties.

### func (Style) SetBasedOn ¶

    func (s Style) SetBasedOn(name string)

SetBasedOn sets the style that this style is based on.

### func (Style) SetLinkedStyle ¶

    func (s Style) SetLinkedStyle(name string)

SetLinkedStyle sets the style that this style is linked to.

### func (Style) SetName ¶

    func (s Style) SetName(name string)

SetName sets the name of the style.

### func (Style) SetNextStyle ¶

    func (s Style) SetNextStyle(name string)

SetNextStyle sets the style that the next paragraph will use.

### func (Style) SetPrimaryStyle ¶

    func (s Style) SetPrimaryStyle(b bool)

SetPrimaryStyle marks the style as a primary style.

### func (Style) SetSemiHidden ¶

    func (s Style) SetSemiHidden(b bool)

SetSemiHidden controls if the style is hidden in the UI.

### func (Style) SetUISortOrder ¶

    func (s Style) SetUISortOrder(order int)

SetUISortOrder controls the order the style is displayed in the UI.

### func (Style) SetUnhideWhenUsed ¶

    func (s Style) SetUnhideWhenUsed(b bool)

SetUnhideWhenUsed controls if a semi hidden style becomes visible when used.

### func (Style) StyleID ¶

    func (s Style) StyleID() string

StyleID returns the style ID.

### func (Style) TableConditionalFormatting ¶

    func (s Style) TableConditionalFormatting(typ wml.ST_TblStyleOverrideType) TableConditionalFormatting

TableConditionalFormatting returns a conditional formatting object of a given type. Calling this method repeatedly will return the same object.

### func (Style) TableProperties ¶

    func (s Style) TableProperties() TableStyleProperties

TableProperties returns the table style properties.

### func (Style) Type ¶

    func (s Style) Type() wml.ST_StyleType

Type returns the type of the style.

### func (Style) X ¶

    func (s Style) X() *wml.CT_Style

X returns the inner wrapped XML type.

## type Styles ¶

Styles is the document wide styles contained in styles.xml.

    type Styles struct {
        // contains filtered or unexported fields
    }

### func NewStyles ¶

    func NewStyles() Styles

NewStyles constructs a new empty Styles

### func (Styles) AddStyle ¶

    func (s Styles) AddStyle(styleID string, t wml.ST_StyleType, isDefault bool) Style

AddStyle adds a new empty style, if styleID is already exists, it will return the style.

### func (Styles) Clear ¶

    func (s Styles) Clear()

Clear clears the styes.

### func (Styles) InitializeDefault ¶

    func (s Styles) InitializeDefault()

InitializeDefault constructs the default styles.

### func (Styles) InsertStyle ¶

    func (s Styles) InsertStyle(ss Style)

InsertStyle insert style to styles.

### func (Styles) ParagraphStyles ¶

    func (s Styles) ParagraphStyles() []Style

ParagraphStyles returns only the paragraph styles.

### func (Styles) SearchStyleById ¶

    func (s Styles) SearchStyleById(id string) (Style, bool)

SearchStylesById returns style by its id.

### func (Styles) SearchStyleByName ¶

    func (s Styles) SearchStyleByName(name string) (Style, bool)

SearchStyleByName return style by its name.

### func (Styles) Styles ¶

    func (s Styles) Styles() []Style

Styles returns all styles.

### func (Styles) X ¶

    func (s Styles) X() *wml.Styles

X returns the inner wrapped XML type.

## type TOCOptions ¶

TOCOptions specify options for table of contents customization.

    type TOCOptions struct {
        // UseHyperlinks makes the table of contents entries hyperlinks.
        UseHyperlinks bool

        // OmitPageNumbers allows omitting page numbers from the table of contents.
        OmitPageNumbers bool

        // HeadingLevel uses paragraphs formatted with all of the specified range of built-in heading styles.
        // "3-3" is to show only third heading level, for instance.
        HeadingLevel string
    }

## type Table ¶

Table is a table within a document.

    type Table struct {
        // contains filtered or unexported fields
    }

### func (Table) AddRow ¶

    func (t Table) AddRow() Row

AddRow adds a row to a table.

### func (Table) EnsureGridColumns ¶

    func (t Table) EnsureGridColumns()

EnsureGridColumns ensures that the table has proper TblGrid elements populated. This fixes corruption issues when cells use SetColumnSpan (gridSpan in OOXML). Word requires properly defined TblGrid when any cell uses gridSpan, especially when combined with nested tables. Without this, documents show "Styles 1" errors.

### func (Table) InsertRowAfter ¶

    func (t Table) InsertRowAfter(r Row) Row

InsertRowAfter inserts a row after another row

### func (Table) InsertRowBefore ¶

    func (t Table) InsertRowBefore(r Row) Row

InsertRowBefore inserts a row before another row

### func (Table) Properties ¶

    func (t Table) Properties() TableProperties

Properties returns the table properties.

### func (Table) Rows ¶

    func (t Table) Rows() []Row

Rows returns the rows defined in the table.

### func (Table) Style ¶

    func (t Table) Style() string

Style return the table style.

### func (Table) X ¶

    func (t Table) X() *wml.CT_Tbl

X returns the inner wrapped XML type.

## type TableBorders ¶

TableBorders allows manipulation of borders on a table.

    type TableBorders struct {
        // contains filtered or unexported fields
    }

### func (TableBorders) SetAll ¶

    func (b TableBorders) SetAll(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetAll sets all of the borders to a given value.

### func (TableBorders) SetBottom ¶

    func (b TableBorders) SetBottom(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetBottom sets the bottom border to a specified type, color and thickness.

### func (TableBorders) SetInsideHorizontal ¶

    func (b TableBorders) SetInsideHorizontal(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetInsideHorizontal sets the interior horizontal borders to a specified type, color and thickness.

### func (TableBorders) SetInsideVertical ¶

    func (b TableBorders) SetInsideVertical(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetInsideVertical sets the interior vertical borders to a specified type, color and thickness.

### func (TableBorders) SetLeft ¶

    func (b TableBorders) SetLeft(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetLeft sets the left border to a specified type, color and thickness.

### func (TableBorders) SetRight ¶

    func (b TableBorders) SetRight(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetRight sets the right border to a specified type, color and thickness.

### func (TableBorders) SetTop ¶

    func (b TableBorders) SetTop(t wml.ST_Border, c color.Color, thickness measurement.Distance)

SetTop sets the top border to a specified type, color and thickness.

### func (TableBorders) X ¶

    func (b TableBorders) X() *wml.CT_TblBorders

X returns the inner wml.CT_TblBorders

## type TableConditionalFormatting ¶

TableConditionalFormatting controls the conditional formatting within a table style.

    type TableConditionalFormatting struct {
        // contains filtered or unexported fields
    }

### func (TableConditionalFormatting) CellProperties ¶

    func (t TableConditionalFormatting) CellProperties() CellProperties

CellProperties returns the cell properties.

### func (TableConditionalFormatting) ParagraphProperties ¶

    func (t TableConditionalFormatting) ParagraphProperties() ParagraphStyleProperties

ParagraphProperties returns the paragraph properties controlling text formatting within the table.

### func (TableConditionalFormatting) RunProperties ¶

    func (t TableConditionalFormatting) RunProperties() RunProperties

RunProperties returns the run properties controlling text formatting within the table.

### func (TableConditionalFormatting) X ¶

    func (t TableConditionalFormatting) X() *wml.CT_TblStylePr

X returns the inner wrapped XML type.

## type TableInfo ¶

TableInfo is used for keep information about a table, a row and a cell where the text is located.

    type TableInfo struct {
        Table    *wml.CT_Tbl
        Row      *wml.CT_Row
        Cell     *wml.CT_Tc
        RowIndex int
        ColIndex int
    }

## type TableLook ¶

TableLook is the conditional formatting associated with a table style that has been assigned to a table.

    type TableLook struct {
        // contains filtered or unexported fields
    }

### func (TableLook) SetFirstColumn ¶

    func (t TableLook) SetFirstColumn(on bool)

SetFirstColumn controls the conditional formatting for the first column in a table.

### func (TableLook) SetFirstRow ¶

    func (t TableLook) SetFirstRow(on bool)

SetFirstRow controls the conditional formatting for the first row in a table.

### func (TableLook) SetHorizontalBanding ¶

    func (t TableLook) SetHorizontalBanding(on bool)

SetHorizontalBanding controls the conditional formatting for horizontal banding.

### func (TableLook) SetLastColumn ¶

    func (t TableLook) SetLastColumn(on bool)

SetLastColumn controls the conditional formatting for the last column in a table.

### func (TableLook) SetLastRow ¶

    func (t TableLook) SetLastRow(on bool)

SetLastRow controls the conditional formatting for the last row in a table. This is called the 'Total' row within Word.

### func (TableLook) SetVerticalBanding ¶

    func (t TableLook) SetVerticalBanding(on bool)

SetVerticalBanding controls the conditional formatting for vertical banding.

### func (TableLook) X ¶

    func (t TableLook) X() *wml.CT_TblLook

X returns the inner wrapped XML type.

## type TableProperties ¶

TableProperties are the properties for a table within a document

    type TableProperties struct {
        // contains filtered or unexported fields
    }

### func (TableProperties) Borders ¶

    func (t TableProperties) Borders() TableBorders

Borders allows manipulation of the table borders.

### func (TableProperties) SetAlignment ¶

    func (t TableProperties) SetAlignment(align wml.ST_JcTable)

SetAlignment sets the alignment of a table within the page.

### func (TableProperties) SetCellSpacing ¶

    func (t TableProperties) SetCellSpacing(m measurement.Distance)

SetCellSpacing sets the cell spacing within a table.

### func (TableProperties) SetCellSpacingAuto ¶

    func (t TableProperties) SetCellSpacingAuto()

SetCellSpacingAuto sets the cell spacing within a table to automatic.

### func (TableProperties) SetCellSpacingPercent ¶

    func (t TableProperties) SetCellSpacingPercent(pct float64)

SetCellSpacingPercent sets the cell spacing within a table to a percent width.

### func (TableProperties) SetLayout ¶

    func (t TableProperties) SetLayout(l wml.ST_TblLayoutType)

SetLayout controls the table layout. wml.ST_TblLayoutTypeAutofit corresponds to "Automatically resize to fit contents" being checked, while wml.ST_TblLayoutTypeFixed corresponds to it being unchecked.

### func (TableProperties) SetStyle ¶

    func (t TableProperties) SetStyle(name string)

SetStyle sets the table style name.

### func (TableProperties) SetWidth ¶

    func (t TableProperties) SetWidth(d measurement.Distance)

SetWidth sets the table with to a specified width.

### func (TableProperties) SetWidthAuto ¶

    func (t TableProperties) SetWidthAuto()

SetWidthAuto sets the the table width to automatic.

### func (TableProperties) SetWidthPercent ¶

    func (t TableProperties) SetWidthPercent(pct float64)

SetWidthPercent sets the table to a width percentage.

### func (TableProperties) TableLook ¶

    func (t TableProperties) TableLook() TableLook

TableLook returns the table look, or conditional formatting applied to a table style.

### func (TableProperties) X ¶

    func (t TableProperties) X() *wml.CT_TblPr

X returns the inner wrapped XML type.

## type TableStyleProperties ¶

TableStyleProperties are table properties as defined in a style.

    type TableStyleProperties struct {
        // contains filtered or unexported fields
    }

### func (TableStyleProperties) Borders ¶

    func (t TableStyleProperties) Borders() TableBorders

Borders allows manipulation of the table borders.

### func (TableStyleProperties) SetCellSpacingAuto ¶

    func (t TableStyleProperties) SetCellSpacingAuto()

SetCellSpacingAuto sets the cell spacing within a table to automatic.

### func (TableStyleProperties) SetCellSpacingPercent ¶

    func (t TableStyleProperties) SetCellSpacingPercent(pct float64)

SetCellSpacingPercent sets the cell spacing within a table to a percent width.

### func (TableStyleProperties) SetColumnBandSize ¶

    func (t TableStyleProperties) SetColumnBandSize(cols int64)

SetColumnBandSize sets the number of Columns in the column band

### func (TableStyleProperties) SetRowBandSize ¶

    func (t TableStyleProperties) SetRowBandSize(rows int64)

SetRowBandSize sets the number of Rows in the row band

### func (TableStyleProperties) SetTableIndent ¶

    func (t TableStyleProperties) SetTableIndent(ind measurement.Distance)

SetTableIndent sets the Table Indent from the Leading Margin

### func (TableStyleProperties) X ¶

    func (t TableStyleProperties) X() *wml.CT_TblPrBase

X returns the inner wrapped XML type.

## type TableWidth ¶

TableWidth controls width values in table settings.

    type TableWidth struct {
        // contains filtered or unexported fields
    }

### func NewTableWidth ¶

    func NewTableWidth() TableWidth

NewTableWidth returns a newly intialized TableWidth

### func (TableWidth) SetValue ¶

    func (s TableWidth) SetValue(m measurement.Distance)

SetValue sets the width value.

### func (TableWidth) X ¶

    func (s TableWidth) X() *wml.CT_TblWidth

X returns the inner wrapped XML type.

## type TextItem ¶

TextItem is used for keeping text with references to a paragraph and run or a table, a row and a cell where it is located.

    type TextItem struct {
        Text        string
        DrawingInfo *DrawingInfo
        Paragraph   *wml.CT_P
        Hyperlink   *wml.CT_Hyperlink
        Run         *wml.CT_R
        TableInfo   *TableInfo
    }

### func ExtractFromFooter ¶

    func ExtractFromFooter(footer *wml.Ftr) []TextItem

ExtractFromFooter returns text from the document footer as an array of TextItems.

### func ExtractFromHeader ¶

    func ExtractFromHeader(header *wml.Hdr) []TextItem

ExtractFromHeader returns text from the document header as an array of TextItems.

## type WatermarkPicture ¶

WatermarkPicture is watermark picture within document.

    type WatermarkPicture struct {
        // contains filtered or unexported fields
    }

### func NewWatermarkPicture ¶

    func NewWatermarkPicture() WatermarkPicture

NewWatermarkPicture generates new WatermarkPicture.

### func (*WatermarkPicture) GetShapeStyle ¶

    func (w *WatermarkPicture) GetShapeStyle() vmldrawing.ShapeStyle

GetShapeStyle returns string style of the shape in watermark and format it to ShapeStyle.

### func (*WatermarkPicture) Pict ¶

    func (w *WatermarkPicture) Pict() *wml.CT_Picture

Pict returns the pict object.

### func (*WatermarkPicture) SetPicture ¶

    func (w *WatermarkPicture) SetPicture(imageRef common.ImageRef)

SetPicture sets the watermark picture.

### func (*WatermarkPicture) SetPictureSize ¶

    func (w *WatermarkPicture) SetPictureSize(width, height int64)

SetPictureSize set watermark picture size with given width and height.

### func (*WatermarkPicture) SetPictureWashout ¶

    func (w *WatermarkPicture) SetPictureWashout(isWashout bool)

SetPictureWashout set washout to watermark picture.

### func (*WatermarkPicture) SetShapeStyle ¶

    func (w *WatermarkPicture) SetShapeStyle(shapeStyle vmldrawing.ShapeStyle)

SetShapeStyle sets style to the element v:shape in watermark.

## type WatermarkText ¶

WatermarkText is watermark text within the document.

    type WatermarkText struct {
        // contains filtered or unexported fields
    }

### func NewWatermarkText ¶

    func NewWatermarkText() WatermarkText

NewWatermarkText generates a new WatermarkText.

### func (*WatermarkText) EnableDiagonalLayout ¶

    func (w *WatermarkText) EnableDiagonalLayout(value bool)

SetDiagonalLayout enables or disables diagonal layout. By default, diagonal layout is disabled and we have horizontal layout.

### func (*WatermarkText) GetStyle ¶

    func (w *WatermarkText) GetStyle() vmldrawing.TextpathStyle

GetStyle returns string style of the text in watermark and format it to TextpathStyle.

### func (*WatermarkText) GetText ¶

    func (w *WatermarkText) GetText() string

GetText returns text in the watermark.

### func (*WatermarkText) Pict ¶

    func (w *WatermarkText) Pict() *wml.CT_Picture

Pict returns the pict object.

### func (*WatermarkText) SetColor ¶

    func (w *WatermarkText) SetColor(value string)

SetColor sets color of watermark text.

### func (*WatermarkText) SetFontFamily ¶

    func (w *WatermarkText) SetFontFamily(value string)

SetFontFamily sets font family of watermark text.

### func (*WatermarkText) SetFontSize ¶

    func (w *WatermarkText) SetFontSize(value int64)

SetFontSize sets font size of watermark text.

### func (*WatermarkText) SetOpacity ¶

    func (w *WatermarkText) SetOpacity(value float64)

SetOpacity sets opacity of watermark text in range 0.0 - 1.0, where is 1.0 is the default value.

### func (*WatermarkText) SetStyle ¶

    func (w *WatermarkText) SetStyle(style vmldrawing.TextpathStyle)

SetStyle sets style to the text in watermark.

### func (*WatermarkText) SetText ¶

    func (w *WatermarkText) SetText(text string)

SetText sets the watermark text.

### func (*WatermarkText) SetTextStyleBold ¶

    func (w *WatermarkText) SetTextStyleBold(value bool)

SetTextStyleBold sets text style of watermark to bold.

### func (*WatermarkText) SetTextStyleItalic ¶

    func (w *WatermarkText) SetTextStyleItalic(value bool)

SetTextStyleItalic sets text style of watermark to italic.

## Subdirectories

Name | Synopsis
--- | ---
..
convert |