Documentation
¶
Overview ¶
Package common contains wrapper types and utilities common to all of the OOXML document formats.
Package common contains common properties used by the subpackages.
Index ¶
- Constants
- Variables
- func AddImageToZip(z *_f.Writer, img ImageRef, imageNum int, dt _ef.DocType) error
- func UtcTimeFormat(t _gc.Time) string
- type AppProperties
- func (_gd AppProperties) Application() string
- func (_bfa AppProperties) ApplicationVersion() string
- func (_cee AppProperties) Company() string
- func (_eb AppProperties) Pages() int32
- func (_agg AppProperties) SetApplication(s string)
- func (_gbc AppProperties) SetApplicationVersion(s string)
- func (_cca AppProperties) SetCompany(s string)
- func (_adg AppProperties) SetDocSecurity(v int32)
- func (_gfd AppProperties) SetLinksUpToDate(v bool)
- func (_ee AppProperties) SetPages(n int32)
- func (_fe AppProperties) X() *_bef.Properties
- type ContentTypes
- func (_fge ContentTypes) AddDefault(fileExtension string, contentType string)
- func (_ebc ContentTypes) AddOverride(path, contentType string)
- func (_gdc ContentTypes) CopyOverride(path, newPath string)
- func (_dcf ContentTypes) EnsureDefault(ext, contentType string)
- func (_bb ContentTypes) EnsureOverride(path, contentType string)
- func (_dfa ContentTypes) RemoveOverride(path string)
- func (_acb ContentTypes) RemoveOverrideByIndex(path string, indexToFind int) error
- func (_gga ContentTypes) X() *_ea.Types
- type CoreProperties
- func (_ega CoreProperties) Author() string
- func (_abbb CoreProperties) Category() string
- func (_ecd CoreProperties) ContentStatus() string
- func (_cae CoreProperties) Created() _gc.Time
- func (_ced CoreProperties) Description() string
- func (_cga CoreProperties) LastModifiedBy() string
- func (_gfc CoreProperties) Modified() _gc.Time
- func (_afd CoreProperties) SetAuthor(s string)
- func (_bcc CoreProperties) SetCategory(s string)
- func (_bcg CoreProperties) SetContentStatus(s string)
- func (_bfab CoreProperties) SetCreated(t _gc.Time)
- func (_caf CoreProperties) SetDescription(s string)
- func (_gdcd CoreProperties) SetLanguage(s string)
- func (_bba CoreProperties) SetLastModifiedBy(s string)
- func (_caa CoreProperties) SetModified(t _gc.Time)
- func (_gee CoreProperties) SetTitle(s string)
- func (_eca CoreProperties) Title() string
- func (_dabb CoreProperties) X() *_bca.CoreProperties
- type CustomProperties
- func (_agb CustomProperties) GetPropertyByName(name string) CustomProperty
- func (_adf CustomProperties) PropertiesList() []*_ed.CT_Property
- func (_aec CustomProperties) SetPropertyAsArray(name string, array *_ba.Array)
- func (_ddc CustomProperties) SetPropertyAsBlob(name, blob string)
- func (_eaa CustomProperties) SetPropertyAsBool(name string, b bool)
- func (_gbf CustomProperties) SetPropertyAsBstr(name string, bstr string)
- func (_fbe CustomProperties) SetPropertyAsClsid(name string, clsid string)
- func (_cggf CustomProperties) SetPropertyAsCy(name string, cy string)
- func (_fdee CustomProperties) SetPropertyAsDate(name string, date _gc.Time)
- func (_ecda CustomProperties) SetPropertyAsDecimal(name string, decimal float64)
- func (_ffa CustomProperties) SetPropertyAsEmpty(name string)
- func (_edac CustomProperties) SetPropertyAsError(name string, error string)
- func (_bfbg CustomProperties) SetPropertyAsFiletime(name string, filetime _gc.Time)
- func (_bee CustomProperties) SetPropertyAsI1(name string, i1 int8)
- func (_bbf CustomProperties) SetPropertyAsI2(name string, i2 int16)
- func (_eab CustomProperties) SetPropertyAsI4(name string, i4 int32)
- func (_efe CustomProperties) SetPropertyAsI8(name string, i8 int64)
- func (_cgeb CustomProperties) SetPropertyAsInt(name string, i int)
- func (_aga CustomProperties) SetPropertyAsLpstr(name string, lpstr string)
- func (_cgg CustomProperties) SetPropertyAsLpwstr(name string, lpwstr string)
- func (_eae CustomProperties) SetPropertyAsNull(name string)
- func (_fea CustomProperties) SetPropertyAsOblob(name, oblob string)
- func (_ged CustomProperties) SetPropertyAsOstorage(name string, ostorage string)
- func (_cbd CustomProperties) SetPropertyAsOstream(name string, ostream string)
- func (_cbc CustomProperties) SetPropertyAsR4(name string, r4 float32)
- func (_faeg CustomProperties) SetPropertyAsR8(name string, r8 float64)
- func (_bae CustomProperties) SetPropertyAsStorage(name string, storage string)
- func (_afga CustomProperties) SetPropertyAsStream(name string, stream string)
- func (_fgbd CustomProperties) SetPropertyAsUi1(name string, ui1 uint8)
- func (_ggcc CustomProperties) SetPropertyAsUi2(name string, ui2 uint16)
- func (_ece CustomProperties) SetPropertyAsUi4(name string, ui4 uint32)
- func (_dgb CustomProperties) SetPropertyAsUi8(name string, ui8 uint64)
- func (_eac CustomProperties) SetPropertyAsUint(name string, ui uint)
- func (_gfe CustomProperties) SetPropertyAsVector(name string, vector *_ba.Vector)
- func (_cbg CustomProperties) SetPropertyAsVstream(name string, vstream *_ba.Vstream)
- func (_gdb CustomProperties) X() *_ed.Properties
- type CustomProperty
- type DocBase
- func (_dccg *DocBase) AddCustomRelationships()
- func (_fcea *DocBase) AddExtraFileFromZip(f *_f.File) error
- func (_agc DocBase) Append(docBase1 DocBase) DocBase
- func (_ccc *DocBase) CreateCustomProperties()
- func (_bfbf *DocBase) GetImageBytesByTarget(target string) (Image, error)
- func (_egaa *DocBase) GetOrCreateCustomProperties() CustomProperties
- func (_agcfd *DocBase) WriteExtraFiles(z *_f.Writer) error
- type ExtraFile
- type Hyperlink
- type Image
- type ImageRef
- func (_gfde ImageRef) Data() *[]byte
- func (_edad ImageRef) Format() string
- func (_gdg ImageRef) Path() string
- func (_bff ImageRef) RelID() string
- func (_dabg ImageRef) RelativeHeight(w _da.Distance) _da.Distance
- func (_fbff ImageRef) RelativeWidth(h _da.Distance) _da.Distance
- func (_dge *ImageRef) SetRelID(id string)
- func (_dagf *ImageRef) SetTarget(target string)
- func (_dbdd ImageRef) Size() _dd.Point
- func (_dec *ImageRef) Target() string
- type PageSize
- type Relationship
- type Relationships
- func (_cbba Relationships) AddAutoRelationship(dt _ef.DocType, src string, idx int, ctype string) Relationship
- func (_ecef Relationships) AddHyperlink(target string) Hyperlink
- func (_ecfc Relationships) AddRelationship(target, ctype string) Relationship
- func (_agef Relationships) Clear()
- func (_efd Relationships) CopyRelationship(idAttr string) (Relationship, bool)
- func (_babe Relationships) FindRIDForN(i int, t string) string
- func (_bbff Relationships) GetByRelId(idAttr string) Relationship
- func (_fbfd Relationships) GetTargetByRelId(idAttr string) string
- func (_cec Relationships) GetTargetByRelIdAndType(idAttr string, typeAttr string) string
- func (_cbce Relationships) IsEmpty() bool
- func (_gfcg Relationships) Relationships() []Relationship
- func (_gbg Relationships) Remove(rel Relationship) bool
- func (_cfcd Relationships) RemoveAllByTarget(target string) int
- func (_cgca Relationships) RemoveByTarget(target string) bool
- func (_gad Relationships) Reorder()
- func (_aecc Relationships) X() *_abd.Relationships
- type Table
- func (_cgae Table) AddCol() *TableCol
- func (_geeg Table) AddRow() *TableRow
- func (_geae Table) Grid() *_de.CT_TableGrid
- func (_bdf Table) Properties() *_de.CT_TableProperties
- func (_ebf Table) Rows() []*TableRow
- func (_cea Table) SetOffsetX(offX float64)
- func (_ffb Table) SetOffsetY(offY float64)
- func (_afdeb Table) SetStyle(style *_de.CT_TableStyle)
- func (_aab Table) X() *_de.Tbl
- type TableCol
- type TableRow
- type TableStyles
- type Theme
Constants ¶
const Version = "\u0032\u002e\u0031\u0030\u002e\u0030"
Variables ¶
var ( PageSizeA0 = PageSize{841 * _da.Millimeter, 1189 * _da.Millimeter} PageSizeA1 = PageSize{594 * _da.Millimeter, 841 * _da.Millimeter} PageSizeA2 = PageSize{420 * _da.Millimeter, 594 * _da.Millimeter} PageSizeA3 = PageSize{297 * _da.Millimeter, 420 * _da.Millimeter} PageSizeA4 = PageSize{210 * _da.Millimeter, 297 * _da.Millimeter} PageSizeA5 = PageSize{148 * _da.Millimeter, 210 * _da.Millimeter} PageSizeA6 = PageSize{105 * _da.Millimeter, 148 * _da.Millimeter} PageSizeB4 = PageSize{250 * _da.Millimeter, 353 * _da.Millimeter} PageSizeB5 = PageSize{176 * _da.Millimeter, 250 * _da.Millimeter} PageSizeLetter = PageSize{8.5 * _da.Inch, 11 * _da.Inch} PageSizeLegal = PageSize{8.5 * _da.Inch, 14 * _da.Inch} PageSizeTabloid = PageSize{11 * _da.Inch, 17 * _da.Inch} PageSizeExecutive = PageSize{7.25 * _da.Inch, 10.5 * _da.Inch} PageSizeStatement = PageSize{5.5 * _da.Inch, 8.5 * _da.Inch} PageSizeFolio = PageSize{8.5 * _da.Inch, 13 * _da.Inch} PageSizeQuarto = PageSize{8.5 * _da.Inch, 10.83 * _da.Inch} )
var ReleasedAt = _gc.Date(_fgc, _bdggg, _eeb, _gcad, _dbb, 0, 0, _gc.UTC)
Functions ¶
func AddImageToZip ¶
AddImageToZip adds an image (either from bytes or from disk) and adds it to the zip file.
func UtcTimeFormat ¶
Types ¶
type AppProperties ¶
type AppProperties struct {
// contains filtered or unexported fields
}
AppProperties contains properties specific to the document and the application that created it.
func NewAppProperties ¶
func NewAppProperties() AppProperties
NewAppProperties constructs a new AppProperties.
func (AppProperties) Application ¶
func (_gd AppProperties) Application() string
Application returns the name of the application that created the document. For gooffice created documents, it defaults to github.com/golgys0621/gooffice
func (AppProperties) ApplicationVersion ¶
func (_bfa AppProperties) ApplicationVersion() string
ApplicationVersion returns the version of the application that created the document.
func (AppProperties) Company ¶
func (_cee AppProperties) Company() string
Company returns the name of the company that created the document. For gooffice created documents, it defaults to github.com/golgys0621/gooffice
func (AppProperties) Pages ¶
func (_eb AppProperties) Pages() int32
Pages returns total number of pages which are saved by the text editor which produced the document. For gooffice created documents, it is 0.
func (AppProperties) SetApplication ¶
func (_agg AppProperties) SetApplication(s string)
SetApplication sets the name of the application that created the document.
func (AppProperties) SetApplicationVersion ¶
func (_gbc AppProperties) SetApplicationVersion(s string)
SetApplicationVersion sets the version of the application that created the document. Per MS, the verison string mut be in the form 'XX.YYYY'.
func (AppProperties) SetCompany ¶
func (_cca AppProperties) SetCompany(s string)
SetCompany sets the name of the company that created the document.
func (AppProperties) SetDocSecurity ¶
func (_adg AppProperties) SetDocSecurity(v int32)
SetDocSecurity sets the document security flag.
func (AppProperties) SetLinksUpToDate ¶
func (_gfd AppProperties) SetLinksUpToDate(v bool)
SetLinksUpToDate sets the links up to date flag.
func (AppProperties) SetPages ¶
func (_ee AppProperties) SetPages(n int32)
SetPages sets the pages count of the document.
func (AppProperties) X ¶
func (_fe AppProperties) X() *_bef.Properties
X returns the inner wrapped XML type.
type ContentTypes ¶
type ContentTypes struct {
// contains filtered or unexported fields
}
ContentTypes is the top level "[Content_Types].xml" in a zip package.
func NewContentTypes ¶
func NewContentTypes() ContentTypes
NewContentTypes returns a wrapper around a newly constructed content-types.
func (ContentTypes) AddDefault ¶
func (_fge ContentTypes) AddDefault(fileExtension string, contentType string)
AddDefault registers a default content type for a given file extension.
func (ContentTypes) AddOverride ¶
func (_ebc ContentTypes) AddOverride(path, contentType string)
AddOverride adds an override content type for a given path name.
func (ContentTypes) CopyOverride ¶
func (_gdc ContentTypes) CopyOverride(path, newPath string)
CopyOverride copies override content type for a given `path` and puts it with a path `newPath`.
func (ContentTypes) EnsureDefault ¶
func (_dcf ContentTypes) EnsureDefault(ext, contentType string)
EnsureDefault esnures that an extension and default content type exist, adding it if necessary.
func (ContentTypes) EnsureOverride ¶
func (_bb ContentTypes) EnsureOverride(path, contentType string)
EnsureOverride ensures that an override for the given path exists, adding it if necessary
func (ContentTypes) RemoveOverride ¶
func (_dfa ContentTypes) RemoveOverride(path string)
RemoveOverride removes an override given a path.
func (ContentTypes) RemoveOverrideByIndex ¶
func (_acb ContentTypes) RemoveOverrideByIndex(path string, indexToFind int) error
RemoveOverrideByIndex removes an override given a path and override index.
func (ContentTypes) X ¶
func (_gga ContentTypes) X() *_ea.Types
X returns the inner raw content types.
type CoreProperties ¶
type CoreProperties struct {
// contains filtered or unexported fields
}
CoreProperties contains document specific properties.
func NewCoreProperties ¶
func NewCoreProperties() CoreProperties
NewCoreProperties constructs a new CoreProperties.
func (CoreProperties) Author ¶
func (_ega CoreProperties) Author() string
Author returns the author of the document
func (CoreProperties) Category ¶
func (_abbb CoreProperties) Category() string
Category returns the category of the document
func (CoreProperties) ContentStatus ¶
func (_ecd CoreProperties) ContentStatus() string
ContentStatus returns the content status of the document (e.g. "Final", "Draft")
func (CoreProperties) Created ¶
func (_cae CoreProperties) Created() _gc.Time
Created returns the time that the document was created.
func (CoreProperties) Description ¶
func (_ced CoreProperties) Description() string
Description returns the description of the document
func (CoreProperties) LastModifiedBy ¶
func (_cga CoreProperties) LastModifiedBy() string
LastModifiedBy returns the name of the last person to modify the document
func (CoreProperties) Modified ¶
func (_gfc CoreProperties) Modified() _gc.Time
Modified returns the time that the document was modified.
func (CoreProperties) SetAuthor ¶
func (_afd CoreProperties) SetAuthor(s string)
SetAuthor records the author of the document.
func (CoreProperties) SetCategory ¶
func (_bcc CoreProperties) SetCategory(s string)
SetCategory records the category of the document.
func (CoreProperties) SetContentStatus ¶
func (_bcg CoreProperties) SetContentStatus(s string)
SetContentStatus records the content status of the document.
func (CoreProperties) SetCreated ¶
func (_bfab CoreProperties) SetCreated(t _gc.Time)
SetCreated sets the time that the document was created.
func (CoreProperties) SetDescription ¶
func (_caf CoreProperties) SetDescription(s string)
SetDescription records the description of the document.
func (CoreProperties) SetLanguage ¶
func (_gdcd CoreProperties) SetLanguage(s string)
SetLanguage records the language of the document.
func (CoreProperties) SetLastModifiedBy ¶
func (_bba CoreProperties) SetLastModifiedBy(s string)
SetLastModifiedBy records the last person to modify the document.
func (CoreProperties) SetModified ¶
func (_caa CoreProperties) SetModified(t _gc.Time)
SetModified sets the time that the document was modified.
func (CoreProperties) SetTitle ¶
func (_gee CoreProperties) SetTitle(s string)
SetTitle records the title of the document.
func (CoreProperties) Title ¶
func (_eca CoreProperties) Title() string
Title returns the Title of the document
func (CoreProperties) X ¶
func (_dabb CoreProperties) X() *_bca.CoreProperties
X returns the inner wrapped XML type.
type CustomProperties ¶
type CustomProperties struct {
// contains filtered or unexported fields
}
CustomProperties contains document specific properties.
func NewCustomProperties ¶
func NewCustomProperties() CustomProperties
NewCustomProperties constructs a new CustomProperties.
func (CustomProperties) GetPropertyByName ¶
func (_agb CustomProperties) GetPropertyByName(name string) CustomProperty
GetPropertyByName returns a custom property selected by it's name.
func (CustomProperties) PropertiesList ¶
func (_adf CustomProperties) PropertiesList() []*_ed.CT_Property
PropertiesList returns the list of all custom properties of the document.
func (CustomProperties) SetPropertyAsArray ¶
func (_aec CustomProperties) SetPropertyAsArray(name string, array *_ba.Array)
func (CustomProperties) SetPropertyAsBlob ¶
func (_ddc CustomProperties) SetPropertyAsBlob(name, blob string)
func (CustomProperties) SetPropertyAsBool ¶
func (_eaa CustomProperties) SetPropertyAsBool(name string, b bool)
func (CustomProperties) SetPropertyAsBstr ¶
func (_gbf CustomProperties) SetPropertyAsBstr(name string, bstr string)
func (CustomProperties) SetPropertyAsClsid ¶
func (_fbe CustomProperties) SetPropertyAsClsid(name string, clsid string)
func (CustomProperties) SetPropertyAsCy ¶
func (_cggf CustomProperties) SetPropertyAsCy(name string, cy string)
func (CustomProperties) SetPropertyAsDate ¶
func (_fdee CustomProperties) SetPropertyAsDate(name string, date _gc.Time)
func (CustomProperties) SetPropertyAsDecimal ¶
func (_ecda CustomProperties) SetPropertyAsDecimal(name string, decimal float64)
func (CustomProperties) SetPropertyAsEmpty ¶
func (_ffa CustomProperties) SetPropertyAsEmpty(name string)
func (CustomProperties) SetPropertyAsError ¶
func (_edac CustomProperties) SetPropertyAsError(name string, error string)
func (CustomProperties) SetPropertyAsFiletime ¶
func (_bfbg CustomProperties) SetPropertyAsFiletime(name string, filetime _gc.Time)
func (CustomProperties) SetPropertyAsI1 ¶
func (_bee CustomProperties) SetPropertyAsI1(name string, i1 int8)
func (CustomProperties) SetPropertyAsI2 ¶
func (_bbf CustomProperties) SetPropertyAsI2(name string, i2 int16)
func (CustomProperties) SetPropertyAsI4 ¶
func (_eab CustomProperties) SetPropertyAsI4(name string, i4 int32)
func (CustomProperties) SetPropertyAsI8 ¶
func (_efe CustomProperties) SetPropertyAsI8(name string, i8 int64)
func (CustomProperties) SetPropertyAsInt ¶
func (_cgeb CustomProperties) SetPropertyAsInt(name string, i int)
func (CustomProperties) SetPropertyAsLpstr ¶
func (_aga CustomProperties) SetPropertyAsLpstr(name string, lpstr string)
func (CustomProperties) SetPropertyAsLpwstr ¶
func (_cgg CustomProperties) SetPropertyAsLpwstr(name string, lpwstr string)
func (CustomProperties) SetPropertyAsNull ¶
func (_eae CustomProperties) SetPropertyAsNull(name string)
func (CustomProperties) SetPropertyAsOblob ¶
func (_fea CustomProperties) SetPropertyAsOblob(name, oblob string)
func (CustomProperties) SetPropertyAsOstorage ¶
func (_ged CustomProperties) SetPropertyAsOstorage(name string, ostorage string)
func (CustomProperties) SetPropertyAsOstream ¶
func (_cbd CustomProperties) SetPropertyAsOstream(name string, ostream string)
func (CustomProperties) SetPropertyAsR4 ¶
func (_cbc CustomProperties) SetPropertyAsR4(name string, r4 float32)
func (CustomProperties) SetPropertyAsR8 ¶
func (_faeg CustomProperties) SetPropertyAsR8(name string, r8 float64)
func (CustomProperties) SetPropertyAsStorage ¶
func (_bae CustomProperties) SetPropertyAsStorage(name string, storage string)
func (CustomProperties) SetPropertyAsStream ¶
func (_afga CustomProperties) SetPropertyAsStream(name string, stream string)
func (CustomProperties) SetPropertyAsUi1 ¶
func (_fgbd CustomProperties) SetPropertyAsUi1(name string, ui1 uint8)
func (CustomProperties) SetPropertyAsUi2 ¶
func (_ggcc CustomProperties) SetPropertyAsUi2(name string, ui2 uint16)
func (CustomProperties) SetPropertyAsUi4 ¶
func (_ece CustomProperties) SetPropertyAsUi4(name string, ui4 uint32)
func (CustomProperties) SetPropertyAsUi8 ¶
func (_dgb CustomProperties) SetPropertyAsUi8(name string, ui8 uint64)
func (CustomProperties) SetPropertyAsUint ¶
func (_eac CustomProperties) SetPropertyAsUint(name string, ui uint)
func (CustomProperties) SetPropertyAsVector ¶
func (_gfe CustomProperties) SetPropertyAsVector(name string, vector *_ba.Vector)
func (CustomProperties) SetPropertyAsVstream ¶
func (_cbg CustomProperties) SetPropertyAsVstream(name string, vstream *_ba.Vstream)
func (CustomProperties) X ¶
func (_gdb CustomProperties) X() *_ed.Properties
X returns the inner wrapped XML type.
type CustomProperty ¶
type CustomProperty struct {
// contains filtered or unexported fields
}
CustomProperty contains document specific property. Using of this type is deprecated.
func (CustomProperty) X ¶
func (_ddb CustomProperty) X() *_ed.CT_Property
X returns the inner wrapped XML type of CustomProperty.
type DocBase ¶
type DocBase struct {
ContentTypes ContentTypes
AppProperties AppProperties
Rels Relationships
CoreProperties CoreProperties
CustomProperties CustomProperties
Thumbnail _dd.Image
Images []ImageRef
ExtraFiles []ExtraFile
TmpPath string
}
DocBase is the type embedded in in the Document/Workbook/Presentation types that contains members common to all.
func (*DocBase) AddCustomRelationships ¶
func (_dccg *DocBase) AddCustomRelationships()
AddCustomRelationships adds relationships related to custom properties to the document.
func (*DocBase) AddExtraFileFromZip ¶
AddExtraFileFromZip is used when reading an unsupported file from an OOXML file. This ensures that unsupported file content will at least round-trip correctly.
func (*DocBase) CreateCustomProperties ¶
func (_ccc *DocBase) CreateCustomProperties()
CreateCustomProperties creates the custom properties of the document.
func (*DocBase) GetImageBytesByTarget ¶
GetImageBytesByTarget returns Image object with Data bytes read from its target.
func (*DocBase) GetOrCreateCustomProperties ¶
func (_egaa *DocBase) GetOrCreateCustomProperties() CustomProperties
GetOrCreateCustomProperties returns the custom properties of the document (and if they not exist yet, creating them first).
type ExtraFile ¶
ExtraFile is an unsupported file type extracted from, or to be written to a zip package
type Hyperlink ¶
type Hyperlink Relationship
Hyperlink is just an appropriately configured relationship.
type Image ¶
Image is a container for image information. It's used as we need format and and size information to use images. It contains either the filesystem path to the image, or the image itself.
func ImageFromBytes ¶
ImageFromBytes returns an Image struct for an in-memory image. You can also construct an Image directly if the file and size are known.
func ImageFromFile ¶
ImageFromFile reads an image from a file on disk. It doesn't keep the image in memory and only reads it to determine the format and size. You can also construct an Image directly if the file and size are known. NOTE: See also ImageFromStorage.
func ImageFromStorage ¶
ImageFromStorage reads an image using the currently set temporary storage mechanism (see tempstorage). You can also construct an Image directly if the file and size are known.
type ImageRef ¶
type ImageRef struct {
// contains filtered or unexported fields
}
ImageRef is a reference to an image within a document.
func MakeImageRef ¶
func MakeImageRef(img Image, d *DocBase, rels Relationships) ImageRef
MakeImageRef constructs an image reference which is a reference to a particular image file inside a document. The same image can be used multiple times in a document by re-use the ImageRef.
func (ImageRef) RelativeHeight ¶
RelativeHeight returns the relative height of an image given a fixed width. This is used when setting image to a fixed width to calculate the height required to keep the same image aspect ratio.
func (ImageRef) RelativeWidth ¶
RelativeWidth returns the relative width of an image given a fixed height. This is used when setting image to a fixed height to calculate the width required to keep the same image aspect ratio.
type PageSize ¶
PageSize represents the page size as a 2 element array representing the width and height in document units.
type Relationship ¶
type Relationship struct {
// contains filtered or unexported fields
}
Relationship is a relationship within a .rels file.
func NewRelationship ¶
func NewRelationship() Relationship
NewRelationship constructs a new relationship.
func (Relationship) SetID ¶
func (_eee Relationship) SetID(ID string)
SetID set the ID of a relationship.
func (Relationship) SetTarget ¶
func (_edc Relationship) SetTarget(s string)
SetTarget set the target (path) of a relationship.
func (Relationship) String ¶
func (_dagb Relationship) String() string
func (Relationship) Target ¶
func (_dagc Relationship) Target() string
Target returns the target (path) of a relationship.
func (Relationship) Type ¶
func (_gdbd Relationship) Type() string
Type returns the type of a relationship.
func (Relationship) X ¶
func (_bcdf Relationship) X() *_abd.Relationship
X returns the inner wrapped XML type.
type Relationships ¶
type Relationships struct {
// contains filtered or unexported fields
}
Relationships represents a .rels file.
func NewRelationships ¶
func NewRelationships() Relationships
NewRelationships creates a new relationship wrapper.
func NewRelationshipsCopy ¶
func NewRelationshipsCopy(rels Relationships) Relationships
NewRelationshipsCopy creates a new relationships wrapper as a copy of passed in instance.
func (Relationships) AddAutoRelationship ¶
func (_cbba Relationships) AddAutoRelationship(dt _ef.DocType, src string, idx int, ctype string) Relationship
AddAutoRelationship adds a relationship with an automatically generated filename based off of the type. It should be preferred over AddRelationship to ensure consistent filenames are maintained.
func (Relationships) AddHyperlink ¶
func (_ecef Relationships) AddHyperlink(target string) Hyperlink
AddHyperlink adds an external hyperlink relationship.
func (Relationships) AddRelationship ¶
func (_ecfc Relationships) AddRelationship(target, ctype string) Relationship
AddRelationship adds a relationship.
func (Relationships) Clear ¶
func (_agef Relationships) Clear()
Clear removes any existing relationships.
func (Relationships) CopyRelationship ¶
func (_efd Relationships) CopyRelationship(idAttr string) (Relationship, bool)
CopyRelationship copies the relationship.
func (Relationships) FindRIDForN ¶
func (_babe Relationships) FindRIDForN(i int, t string) string
FindRIDForN returns the relationship ID for the i'th relationship of type t.
func (Relationships) GetByRelId ¶
func (_bbff Relationships) GetByRelId(idAttr string) Relationship
GetByRelId returns a relationship with the associated relation ID.
func (Relationships) GetTargetByRelId ¶
func (_fbfd Relationships) GetTargetByRelId(idAttr string) string
GetTargetByRelId returns a target path with the associated relation ID.
func (Relationships) GetTargetByRelIdAndType ¶
func (_cec Relationships) GetTargetByRelIdAndType(idAttr string, typeAttr string) string
GetTargetByRelIdAndType returns a target path with the associated relation ID.
func (Relationships) IsEmpty ¶
func (_cbce Relationships) IsEmpty() bool
IsEmpty returns true if there are no relationships.
func (Relationships) Relationships ¶
func (_gfcg Relationships) Relationships() []Relationship
Relationships returns a slice of all of the relationships.
func (Relationships) Remove ¶
func (_gbg Relationships) Remove(rel Relationship) bool
Remove removes an existing relationship.
func (Relationships) RemoveAllByTarget ¶
func (_cfcd Relationships) RemoveAllByTarget(target string) int
RemoveAllByTarget removes all relationships matching the specified target. Returns the number of relationships removed. This is useful for cleaning up malformed documents that may have duplicate relationships with the same target.
func (Relationships) RemoveByTarget ¶
func (_cgca Relationships) RemoveByTarget(target string) bool
RemoveByTarget removes the first relationship matching the specified target. Returns true if a relationship was found and removed, false otherwise. Note: Only the first matching relationship is removed. If multiple relationships share the same target (which may occur in malformed documents), subsequent matches are left unchanged.
func (Relationships) Reorder ¶
func (_gad Relationships) Reorder()
Reorder reorders the relationships in a consistent manner.
func (Relationships) X ¶
func (_aecc Relationships) X() *_abd.Relationships
X returns the underlying raw XML data.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table represents a table in the document.
func NewTableFromTbl ¶
func NewTableFromTbl(tbl *_de.Tbl, xfrm *_de.CT_Transform2D) *Table
NewTableFromTbl creates a wrapper table by dml.Tbl and xfrm data.
func NewTableWithXfrm ¶
func NewTableWithXfrm(xfrm *_de.CT_Transform2D) *Table
NewTableWithXfrm makes a new table with a pointer to its parent Xfrm for changing its offset and size.
func (Table) Grid ¶
func (_geae Table) Grid() *_de.CT_TableGrid
Properties returns table properties.
func (Table) Properties ¶
func (_bdf Table) Properties() *_de.CT_TableProperties
Properties returns table properties.
func (Table) SetOffsetX ¶
SetOffsetX sets horizontal offset of a table in distance units (see measurement package).
func (Table) SetOffsetY ¶
SetOffsetY sets vertical offset of a table in distance units (see measurement package).
func (Table) SetStyle ¶
func (_afdeb Table) SetStyle(style *_de.CT_TableStyle)
SetStyle assigns TableStyle to a table.
type TableCol ¶
type TableCol struct {
// contains filtered or unexported fields
}
TableCol represents a column in a table.
type TableRow ¶
type TableRow struct {
// contains filtered or unexported fields
}
TableRow represents a row in a table.
func (TableRow) Cells ¶
func (_aad TableRow) Cells() []*_de.CT_TableCell
Cells returns an array of row cells.
type TableStyles ¶
type TableStyles struct {
// contains filtered or unexported fields
}
TableStyles contains document specific properties.
func NewTableStyles ¶
func NewTableStyles() TableStyles
NewTableStyles constructs a new TableStyles.
func (TableStyles) DefAttr ¶
func (_eaf TableStyles) DefAttr() string
DefAttr returns the DefAttr property.
func (TableStyles) TblStyle ¶
func (_gceg TableStyles) TblStyle() []*_de.CT_TableStyle
TblStyle returns the TblStyle property.
func (TableStyles) X ¶
func (_gef TableStyles) X() *_de.TblStyleLst
X returns the inner wrapped XML type.