Versions in this module Expand all Collapse all v1 v1.0.1 Sep 10, 2024 Changes in this version + const A4_EMU_MAX_WIDTH + const HYPERLINK_STYLE + const MEDIA_FOLDER + const REL_HYPERLINK + const REL_IMAGE + const REL_TARGETMODE + const XMLNS_DRAWINGML_MAIN + const XMLNS_DRAWINGML_PICTURE + const XMLNS_MC + const XMLNS_O + const XMLNS_PICTURE + const XMLNS_R + const XMLNS_REL + const XMLNS_V + const XMLNS_W + const XMLNS_WP + const XMLNS_WPC + const XMLNS_WPG + const XMLNS_WPS + var DefaultTemplateFilesList = []string + var ErrRefIDNotFound = errors.New("ref id not found") + var ErrRefTargetNotFound = errors.New("ref target not found") + var TemplateXMLFS embed.FS + func BytesToString(b []byte) string + func GetInt(s string) (int, error) + func GetInt64(s string) (int64, error) + func MergeAllRuns(_, _ *Run) bool + func MergeSamePropRuns(r1, r2 *Run) bool + func StringToBytes(s string) (b []byte) + type AAlphaModFix struct + Amount int + XMLName xml.Name + type ABlip struct + AlphaModFix *AAlphaModFix + Cstate string + Embed string + XMLName xml.Name + func (a *ABlip) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type ABlipFill struct + Blip *ABlip + DPI int + RotWithShape int + SrcRect *ASrcRect + Tile *ATile + XMLName xml.Name + func (r *ABlipFill) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type AExt struct + CX int64 + CY int64 + type AFillRect struct + XMLName xml.Name + type AGraphic struct + GraphicData *AGraphicData + XMLA string + XMLName xml.Name + func (a *AGraphic) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type AGraphicData struct + Canvas *WordprocessingCanvas + Group *WordprocessingGroup + Pic *Picture + Shape *WordprocessingShape + URI string + XMLName xml.Name + func (a *AGraphicData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type AGraphicFrameLocks struct + NoChangeAspect int + XMLName xml.Name + type AGroupShapeLocks struct + XMLName xml.Name + type AHeadEnd struct + Len string + Type string + W string + XMLName xml.Name + func (r *AHeadEnd) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type ALine struct + Align string + Cap string + Compound string + HeadEnd *AHeadEnd + Miter *AMiter + NoFill *struct{} + PrstDash *APrstDash + Round *struct{} + SolidFill *ASolidFill + TailEnd *ATailEnd + W int64 + XMLName xml.Name + func (l *ALine) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type AMiter struct + Limit string + XMLName xml.Name + type AOff struct + X int64 + Y int64 + type APicLocks struct + NoChangeAspect int + XMLName xml.Name + type APrstDash struct + Val string + XMLName xml.Name + type APrstGeom struct + AvLst *struct{} + Prst string + XMLName xml.Name + func (a *APrstGeom) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type ASPLocks struct + NoChangeArrowheads int + XMLName xml.Name + func (l *ASPLocks) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type ASolidFill struct + SrgbClr *ASrgbClr + XMLName xml.Name + func (s *ASolidFill) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type ASrcRect struct + XMLName xml.Name + type ASrgbClr struct + Val string + XMLName xml.Name + type AStretch struct + FillRect *AFillRect + XMLName xml.Name + func (s *AStretch) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type ATailEnd struct + Len string + Type string + W string + XMLName xml.Name + func (r *ATailEnd) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type ATile struct + Algn string + Flip string + SX int64 + SY int64 + TX int64 + TY int64 + XMLName xml.Name + func (t *ATile) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type AXfrm struct + ChExt *AExt + ChOff *AOff + Ext AExt + FlipH int + FlipV int + Off AOff + Rot int64 + XMLName xml.Name + func (a *AXfrm) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type AdjustRightInd struct + Val int + XMLName xml.Name + type BarterRabbet struct + Type string + XMLName xml.Name + func (f *BarterRabbet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type Body struct + Items []interface{} + func (b *Body) DropDrawingOf(name string) + func (b *Body) KeepElements(name ...string) + func (b *Body) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type Bold struct + XMLName xml.Name + type Color struct + Val string + XMLName xml.Name + type Document struct + Body Body + XMLName xml.Name + XMLR string + XMLW string + XMLWP string + XMLWPC string + XMLWPG string + XMLWPS string + func (doc *Document) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type Docx struct + Document Document + func LoadBodyItems(items []interface{}, media []Media) *Docx + func New() *Docx + func Parse(reader io.ReaderAt, size int64) (doc *Docx, err error) + func (f *Docx) AddParagraph() *Paragraph + func (f *Docx) AddTable(row int, col int) *Table + func (f *Docx) AddTableTwips(rowHeights []int64, colWidths []int64) *Table + func (f *Docx) AppendFile(af *Docx) + func (f *Docx) IncreaseID(name string) (n uintptr) + func (f *Docx) Media(name string) *Media + func (f *Docx) RangeRelationships(iter func(*Relationship) error) error + func (f *Docx) Read(_ []byte) (int, error) + func (f *Docx) ReferID(target string) (string, error) + func (f *Docx) ReferTarget(id string) (string, error) + func (f *Docx) SplitByParagraph(separator ParagraphSplitRule) (docs []*Docx) + func (f *Docx) UseTemplate(template string, tmpfslst []string, tmplfs fs.FS) *Docx + func (f *Docx) WithA3Page() *Docx + func (f *Docx) WithA4Page() *Docx + func (f *Docx) WithDefaultTheme() *Docx + func (f *Docx) WithLandscapePage() *Docx + func (f *Docx) WriteTo(writer io.Writer) (_ int64, err error) + type Drawing struct + Anchor *WPAnchor + Inline *WPInline + XMLName xml.Name + func (r *Drawing) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type Highlight struct + Val string + XMLName xml.Name + type Hyperlink struct + ID string + Run Run + XMLName xml.Name + func (r *Hyperlink) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type Ind struct + FirstLine int + FirstLineChars int + Hanging int + HangingChars int + Left int + LeftChars int + XMLName xml.Name + func (i *Ind) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type Italic struct + XMLName xml.Name + type Justification struct + Val string + XMLName xml.Name + type Kern struct + Val int64 + XMLName xml.Name + type Kinsoku struct + Val int + XMLName xml.Name + type Media struct + Data []byte + Name string + func (m *Media) String() string + type NonVisualProperties struct + ID int + Name string + func (r *NonVisualProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type OverflowPunct struct + Val int + XMLName xml.Name + type PICBlipFill struct + Blip ABlip + Stretch AStretch + XMLName xml.Name + func (p *PICBlipFill) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type PICNonVisualPicProperties struct + CNvPicPr PicCNvPicPr + NonVisualDrawingProperties NonVisualProperties + XMLName xml.Name + func (p *PICNonVisualPicProperties) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type PICSpPr struct + PrstGeom *APrstGeom + XMLName xml.Name + Xfrm AXfrm + func (p *PICSpPr) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type Paragraph struct + Children []interface{} + Properties *ParagraphProperties + XMLName xml.Name + func (p *Paragraph) AddAnchorDrawing(pic []byte) (*Run, error) + func (p *Paragraph) AddAnchorDrawingFrom(file string) (*Run, error) + func (p *Paragraph) AddAnchorShape(w, h int64, name, bwMode, prst string, ln *ALine) *Run + func (p *Paragraph) AddInlineDrawing(pic []byte) (*Run, error) + func (p *Paragraph) AddInlineDrawingFrom(file string) (*Run, error) + func (p *Paragraph) AddInlineShape(w, h int64, name, bwMode, prst string, ln *ALine) *Run + func (p *Paragraph) AddLink(text string, link string) *Hyperlink + func (p *Paragraph) AddPageBreaks() *Run + func (p *Paragraph) AddTab() *Run + func (p *Paragraph) AddText(text string) *Run + func (p *Paragraph) DropCanvas() + func (p *Paragraph) DropGroup() + func (p *Paragraph) DropNilPicture() + func (p *Paragraph) DropShape() + func (p *Paragraph) DropShapeAndCanvas() + func (p *Paragraph) DropShapeAndCanvasAndGroup() + func (p *Paragraph) Justification(val string) *Paragraph + func (p *Paragraph) KeepElements(name ...string) + func (p *Paragraph) MergeText(canmerge RunMergeRule) (np Paragraph) + func (p *Paragraph) String() string + func (p *Paragraph) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type ParagraphProperties struct + AdjustRightInd *AdjustRightInd + Ind *Ind + Justification *Justification + Kern *Kern + Kinsoku *Kinsoku + OverflowPunct *OverflowPunct + RunProperties *RunProperties + Shade *Shade + SnapToGrid *SnapToGrid + Spacing *Spacing + Style *Style + Tabs *Tabs + TextAlignment *TextAlignment + XMLName xml.Name + func (p *ParagraphProperties) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type ParagraphSplitRule func(*Paragraph) bool + func SplitDocxByPlainTextRegex(re *regexp.Regexp) ParagraphSplitRule + type PgSz struct + H int + Orient string + W int + func (pgsz *PgSz) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type PicCNvPicPr struct + Locks *APicLocks + XMLName xml.Name + func (p *PicCNvPicPr) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type Picture struct + BlipFill *PICBlipFill + NonVisualPicProperties *PICNonVisualPicProperties + SpPr *PICSpPr + XMLName xml.Name + XMLPIC string + func (p *Picture) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type Relationship struct + ID string + Target string + TargetMode string + Type string + type Relationships struct + Relationship []Relationship + Xmlns string + type Run struct + Children []interface{} + InstrText string + RunProperties *RunProperties + Space string + XMLName xml.Name + func (r *Run) AddTab() *Run + func (r *Run) Bold() *Run + func (r *Run) Color(color string) *Run + func (r *Run) Font(ascii, hansi, hint string) *Run + func (r *Run) Highlight(val string) *Run + func (r *Run) Italic() *Run + func (r *Run) KeepElements(name ...string) + func (r *Run) Shade(val, color, fill string) *Run + func (r *Run) Size(size string) *Run + func (r *Run) Underline(val string) *Run + func (r *Run) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type RunFonts struct + ASCII string + EastAsia string + HAnsi string + Hint string + XMLName xml.Name + func (f *RunFonts) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type RunMergeRule func(r1, r2 *Run) bool + func MergeSamePropRunsOf(name ...string) RunMergeRule + type RunProperties struct + Bold *Bold + Color *Color + Fonts *RunFonts + Highlight *Highlight + ICs *struct{} + Italic *Italic + Kern *Kern + RunStyle *RunStyle + Shade *Shade + Size *Size + SizeCs *SizeCs + Spacing *Spacing + Strike *Strike + Style *Style + Underline *Underline + VertAlign *VertAlign + XMLName xml.Name + func (r *RunProperties) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type RunStyle struct + Val string + XMLName xml.Name + type SectPr struct + PgSz *PgSz + XMLName xml.Name + func (sect *SectPr) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type Shade struct + Color string + Fill string + ThemeFill string + ThemeFillTint string + Val string + XMLName xml.Name + func (s *Shade) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type ShapeProperties struct + BWMode string + BlipFill *ABlipFill + Line *ALine + NoFill *struct{} + PrstGeom APrstGeom + SolidFill *ASolidFill + Xfrm AXfrm + func (w *ShapeProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type Size struct + Val string + XMLName xml.Name + type SizeCs struct + Val string + XMLName xml.Name + type SnapToGrid struct + Val int + XMLName xml.Name + type Spacing struct + Before int + BeforeLines int + Line int + LineRule string + Val int + XMLName xml.Name + func (s *Spacing) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type Strike struct + Val string + XMLName xml.Name + type Style struct + Val string + XMLName xml.Name + type Tab struct + Position int + Val string + XMLName xml.Name + func (t *Tab) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type Table struct + TableGrid *WTableGrid + TableProperties *WTableProperties + TableRows []*WTableRow + XMLName xml.Name + func (t *Table) Justification(val string) *Table + func (t *Table) String() string + func (t *Table) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type Tabs struct + Tabs []*Tab + XMLName xml.Name + func (tb *Tabs) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type Text struct + Text string + XMLName xml.Name + XMLSpace string + func (r *Text) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type TextAlignment struct + Val string + XMLName xml.Name + type Underline struct + Val string + XMLName xml.Name + type VertAlign struct + Val string + XMLName xml.Name + type WGridCol struct + W int64 + XMLName xml.Name + func (g *WGridCol) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type WGridSpan struct + Val int + XMLName xml.Name + type WPAnchor struct + AllowOverlap int + BehindDoc int + CNvGraphicFramePr *WPCNvGraphicFramePr + DistB int64 + DistL int64 + DistR int64 + DistT int64 + DocPr *WPDocPr + EffectExtent *WPEffectExtent + Extent *WPExtent + Graphic *AGraphic + LayoutInCell int + Locked int + PositionH *WPPositionH + PositionV *WPPositionV + RelativeHeight int + SimplePos int + SimplePosXY *WPSimplePos + WrapNone *struct{} + WrapSquare *WPWrapSquare + XMLName xml.Name + func (r *WPAnchor) Size(w, h int64) + func (r *WPAnchor) String() string + func (r *WPAnchor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type WPCBackground struct + NoFill *struct{} + XMLName xml.Name + func (b *WPCBackground) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) (err error) + type WPCNvGraphicFramePr struct + Locks AGraphicFrameLocks + XMLName xml.Name + func (w *WPCNvGraphicFramePr) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WPCWhole struct + Line *ALine + XMLName xml.Name + func (w *WPCWhole) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) (err error) + type WPDocPr struct + ID int + Name string + XMLName xml.Name + func (r *WPDocPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type WPEffectExtent struct + B int64 + L int64 + R int64 + T int64 + XMLName xml.Name + func (r *WPEffectExtent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type WPExtent struct + CX int64 + CY int64 + XMLName xml.Name + func (r *WPExtent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type WPGGroupShape struct + CNvGrpSpPr *WPGcNvGrpSpPr + CNvPr *NonVisualProperties + Elems []interface{} + GroupShapeProperties *ShapeProperties + XMLName xml.Name + func (w *WPGGroupShape) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WPGcNvGrpSpPr struct + Locks *AGroupShapeLocks + XMLName xml.Name + func (w *WPGcNvGrpSpPr) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WPInline struct + CNvGraphicFramePr *WPCNvGraphicFramePr + DistB int64 + DistL int64 + DistR int64 + DistT int64 + DocPr *WPDocPr + EffectExtent *WPEffectExtent + Extent *WPExtent + Graphic *AGraphic + XMLName xml.Name + func (r *WPInline) Size(w, h int64) + func (r *WPInline) String() string + func (r *WPInline) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type WPPositionH struct + PosOffset int64 + RelativeFrom string + XMLName xml.Name + func (r *WPPositionH) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type WPPositionV struct + PosOffset int64 + RelativeFrom string + XMLName xml.Name + func (r *WPPositionV) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type WPSBodyPr struct + Anchor string + AnchorCtr int + BIns int64 + LIns int64 + NoAutofit *struct{} + RIns int64 + Rot int + TIns int64 + Upright int + Vert string + Wrap string + XMLName xml.Name + func (r *WPSBodyPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type WPSCNvCnPr struct + ConnShapeLocks *struct{} + XMLName xml.Name + func (w *WPSCNvCnPr) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WPSCNvSpPr struct + SPLocks *ASPLocks + TxBox int + XMLName xml.Name + func (w *WPSCNvSpPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type WPSTextBox struct + Content *WTextBoxContent + XMLName xml.Name + func (b *WPSTextBox) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WPSimplePos struct + X int64 + XMLName xml.Name + Y int64 + type WPWrapSquare struct + WrapText string + XMLName xml.Name + type WTableBorder struct + Color string + Size int + Space int + Val string + func (t *WTableBorder) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type WTableBorders struct + Bottom *WTableBorder + InsideH *WTableBorder + InsideV *WTableBorder + Left *WTableBorder + Right *WTableBorder + Top *WTableBorder + func (w *WTableBorders) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WTableCell struct + Paragraphs []*Paragraph + TableCellProperties *WTableCellProperties + XMLName xml.Name + func (c *WTableCell) AddParagraph() *Paragraph + func (c *WTableCell) Shade(val, color, fill string) *WTableCell + func (c *WTableCell) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WTableCellProperties struct + GridSpan *WGridSpan + Shade *Shade + TableBorders *WTableBorders + TableCellWidth *WTableCellWidth + VAlign *WVerticalAlignment + VMerge *WvMerge + XMLName xml.Name + func (r *WTableCellProperties) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WTableCellWidth struct + Type string + W int64 + XMLName xml.Name + type WTableGrid struct + GridCols []*WGridCol + XMLName xml.Name + func (t *WTableGrid) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WTableLook struct + FirstCol int + FirstRow int + LastCol int + LastRow int + NoHBand int + NoVBand int + Val string + XMLName xml.Name + func (t *WTableLook) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type WTablePositioningProperties struct + HorzAnchor string + LeftFromText int + RightFromText int + TblpX int + TblpXSpec string + TblpY int + TblpYSpec string + VertAnchor string + XMLName xml.Name + func (tp *WTablePositioningProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type WTableProperties struct + Justification *Justification + Look *WTableLook + Position *WTablePositioningProperties + Style *WTableStyle + TableBorders *WTableBorders + Width *WTableWidth + XMLName xml.Name + func (t *WTableProperties) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WTableRow struct + TableCells []*WTableCell + TableRowProperties *WTableRowProperties + XMLName xml.Name + func (w *WTableRow) Justification(val string) *WTableRow + func (w *WTableRow) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WTableRowHeight struct + Rule string + Val int64 + XMLName xml.Name + type WTableRowProperties struct + Justification *Justification + TableRowHeight *WTableRowHeight + XMLName xml.Name + func (t *WTableRowProperties) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WTableStyle struct + Val string + XMLName xml.Name + func (t *WTableStyle) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type WTableWidth struct + Type string + W int64 + XMLName xml.Name + func (t *WTableWidth) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type WTextBoxContent struct + Paragraphs []Paragraph + XMLName xml.Name + func (c *WTextBoxContent) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WVerticalAlignment struct + Val string + XMLName xml.Name + type WordprocessingCanvas struct + Background *WPCBackground + Items []interface{} + Whole *WPCWhole + XMLName xml.Name + func (c *WordprocessingCanvas) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) (err error) + type WordprocessingGroup struct + CNvGrpSpPr *WPGcNvGrpSpPr + Elems []interface{} + GroupShapeProperties *ShapeProperties + XMLName xml.Name + func (w *WordprocessingGroup) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WordprocessingShape struct + BodyPr *WPSBodyPr + CNvCnPr *WPSCNvCnPr + CNvPr *NonVisualProperties + CNvSpPr *WPSCNvSpPr + SpPr *ShapeProperties + TextBox *WPSTextBox + XMLName xml.Name + func (w *WordprocessingShape) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error + type WvMerge struct + Val string + XMLName xml.Name