Documentation
¶
Index ¶
- Variables
- type Image
- type PlaceHolder
- func (_bfa PlaceHolder) AddParagraph() _dea.Paragraph
- func (_bfb PlaceHolder) AddTable() *_ae.Table
- func (_cfg PlaceHolder) Clear()
- func (_fgd PlaceHolder) ClearAll()
- func (_dcg PlaceHolder) Index() uint32
- func (_bg PlaceHolder) Paragraphs() []_dea.Paragraph
- func (_cgcf PlaceHolder) Remove() error
- func (_fff PlaceHolder) SetText(text string)
- func (_eb PlaceHolder) Type() _gf.ST_PlaceholderType
- func (_dagb PlaceHolder) X() *_gf.CT_Shape
- type Presentation
- func (_cee *Presentation) AddDefaultSlideWithLayout(l SlideLayout) (Slide, error)
- func (_dafde *Presentation) AddImage(i _ae.Image) (_ae.ImageRef, error)
- func (_caed *Presentation) AddSlide() Slide
- func (_ecf *Presentation) AddSlideWithLayout(l SlideLayout) (Slide, error)
- func (_aafg *Presentation) Charts() []_b.ChartSpace
- func (_deff *Presentation) Close() error
- func (_cedb *Presentation) CopySlide(s Slide) (Slide, error)
- func (_aaf *Presentation) ExtractText() *PresentationText
- func (_dcca *Presentation) GetColorBySchemeColor(schClr _gbg.ST_SchemeColorVal) *_gbg.CT_Color
- func (_ecee *Presentation) GetImageByRelID(relID string) (_ae.ImageRef, bool)
- func (_beda *Presentation) GetImageByTarget(target string) (_ae.ImageRef, bool)
- func (_eca *Presentation) GetLayoutByName(name string) (SlideLayout, error)
- func (_faba *Presentation) GetTableStyleById(id string) *_gbg.CT_TableStyle
- func (_abg *Presentation) MoveSlide(slideNumber, targetPos int) error
- func (_cacd *Presentation) RemoveSlide(s Slide) error
- func (_efa *Presentation) Save(w _ff.Writer) error
- func (_cedf *Presentation) SaveAsTemplate(w _ff.Writer) error
- func (_gdea *Presentation) SaveToFile(path string) error
- func (_fcfd *Presentation) SaveToFileAsTemplate(path string) error
- func (_gbac *Presentation) SlideLayouts() []SlideLayout
- func (_cde *Presentation) SlideMasters() []SlideMaster
- func (_bdddf *Presentation) SlideSize() SlideSize
- func (_ffbge *Presentation) Slides() []Slide
- func (_afbd *Presentation) Themes() []*_gbg.Theme
- func (_caea *Presentation) Validate() error
- func (_abc *Presentation) X() *_gf.Presentation
- type PresentationProperties
- func (_ccg PresentationProperties) ClrMru() *_gbg.CT_ColorMRU
- func (_dcd PresentationProperties) ExtLst() *_gf.CT_ExtensionList
- func (_ged PresentationProperties) HtmlPubPr() *_gf.CT_HtmlPublishProperties
- func (_fb PresentationProperties) PrnPr() *_gf.CT_PrintProperties
- func (_cge PresentationProperties) ShowPr() *_gf.CT_ShowProperties
- func (_cfgd PresentationProperties) WebPr() *_gf.CT_WebProperties
- func (_fac PresentationProperties) X() *_gf.PresentationPr
- type PresentationText
- type Slide
- func (_dfee Slide) AddImage(img _ae.ImageRef) Image
- func (_ecad Slide) AddImageToRels(img _ae.ImageRef) string
- func (_ggdb Slide) AddTable() *_ae.Table
- func (_ccce Slide) AddTextBox() TextBox
- func (_dga *Slide) ExtractText() *SlideText
- func (_gdbe *Slide) GetChartSpaceByRelId(relId string) *_b.ChartSpace
- func (_fgaf *Slide) GetColorBySchemeColor(schClr _gbg.ST_SchemeColorVal) *_gbg.CT_Color
- func (_abf *Slide) GetImageByRelID(relID string) (_ae.ImageRef, bool)
- func (_fda *Slide) GetLayoutImageByRelID(relID string) (_ae.ImageRef, bool)
- func (_cggb Slide) GetPlaceholder(t _gf.ST_PlaceholderType) (PlaceHolder, error)
- func (_bgccc Slide) GetPlaceholderByIndex(idx uint32) (PlaceHolder, error)
- func (_aea *Slide) GetSlideLayout() *_gf.SldLayout
- func (_gbba Slide) GetTextBoxes() []*TextBox
- func (_cege Slide) PlaceHolders() []PlaceHolder
- func (_edb Slide) Presentation() *Presentation
- func (_agc Slide) Sid() *_gf.CT_SlideIdListEntry
- func (_gdaa Slide) Tables() []*_ae.Table
- func (_fcfba Slide) ValidateWithPath(path string) error
- func (_dafdg Slide) X() *_gf.Sld
- type SlideLayout
- type SlideMaster
- type SlideScreenSize
- type SlideSize
- type SlideText
- type TableInfo
- type TextBox
- type TextItem
- type ViewProperties
- func (_eefc ViewProperties) ExtLst() *_gf.CT_ExtensionList
- func (_cdf ViewProperties) GridSpacing() *_gbg.CT_PositiveSize2D
- func (_cgf ViewProperties) LastViewAttr() _gf.ST_ViewType
- func (_gbad ViewProperties) NormalViewPr() *_gf.CT_NormalViewProperties
- func (_cecb ViewProperties) NotesTextViewPr() *_gf.CT_NotesTextViewProperties
- func (_eccg ViewProperties) NotesViewPr() *_gf.CT_NotesViewProperties
- func (_dfbf ViewProperties) OutlineViewPr() *_gf.CT_OutlineViewProperties
- func (_gfcf ViewProperties) ShowCommentsAttr() *bool
- func (_ccdcd ViewProperties) SlideViewPr() *_gf.CT_SlideViewProperties
- func (_acg ViewProperties) SorterViewPr() *_gf.CT_SlideSorterViewProperties
- func (_ddga ViewProperties) X() *_gf.ViewPr
Constants ¶
This section is empty.
Variables ¶
var ( SlideScreenSize16x9 = SlideScreenSize{12192000, 6858000} SlideScreenSize4x3 = SlideScreenSize{9144000, 6858000} SlideScreenSizeA4 = SlideScreenSize{9906000, 6858000} )
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image is an image within a slide.
func (Image) Properties ¶
func (_bdc Image) Properties() _dea.ShapeProperties
Properties returns the properties of the TextBox.
type PlaceHolder ¶
type PlaceHolder struct {
// contains filtered or unexported fields
}
PlaceHolder is a place holder from a slide.
func (PlaceHolder) AddParagraph ¶
func (_bfa PlaceHolder) AddParagraph() _dea.Paragraph
AddParagraph adds a new paragraph to a placeholder.
func (PlaceHolder) AddTable ¶
func (_bfb PlaceHolder) AddTable() *_ae.Table
AddTable adds a new table to a placeholder.
func (PlaceHolder) Clear ¶
func (_cfg PlaceHolder) Clear()
Clear clears the placeholder contents and adds a single empty paragraph. The empty paragrah is required by PowerPoint or it will report the file as being invalid.
func (PlaceHolder) ClearAll ¶
func (_fgd PlaceHolder) ClearAll()
ClearAll completely clears a placeholder. To be useable, at least one paragraph must be added after ClearAll via AddParagraph.
func (PlaceHolder) Index ¶
func (_dcg PlaceHolder) Index() uint32
Index returns the placeholder index
func (PlaceHolder) Paragraphs ¶
func (_bg PlaceHolder) Paragraphs() []_dea.Paragraph
Paragraphs returns the paragraphs defined in the placeholder.
func (PlaceHolder) Remove ¶
func (_cgcf PlaceHolder) Remove() error
Remove removes a placeholder from a presentation.
func (PlaceHolder) SetText ¶
func (_fff PlaceHolder) SetText(text string)
SetText sets the text of a placeholder for the initial paragraph. This is a shortcut method that is useful for things like titles which only contain a single paragraph.
func (PlaceHolder) Type ¶
func (_eb PlaceHolder) Type() _gf.ST_PlaceholderType
Type returns the placeholder type
func (PlaceHolder) X ¶
func (_dagb PlaceHolder) X() *_gf.CT_Shape
X returns the inner wrapped XML type.
type Presentation ¶
Presentation is the a presentation base document.
func Open ¶
func Open(filename string) (*Presentation, error)
Open opens and reads a document from a file (.pptx).
func OpenTemplate ¶
func OpenTemplate(fn string) (*Presentation, error)
OpenTemplate opens a template file.
func Read ¶
func Read(r _ff.ReaderAt, size int64) (*Presentation, error)
Read reads a document from an io.Reader.
func (*Presentation) AddDefaultSlideWithLayout ¶
func (_cee *Presentation) AddDefaultSlideWithLayout(l SlideLayout) (Slide, error)
AddDefaultSlideWithLayout tries to replicate what PowerPoint does when inserting a slide with a new style by clearing placeholder content and removing some placeholders. Use AddSlideWithLayout if you need more control.
func (*Presentation) AddImage ¶
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 (*Presentation) AddSlide ¶
func (_caed *Presentation) AddSlide() Slide
AddSlide adds a new slide to the presentation.
func (*Presentation) AddSlideWithLayout ¶
func (_ecf *Presentation) AddSlideWithLayout(l SlideLayout) (Slide, error)
AddSlideWithLayout adds a new slide with content copied from a layout. Normally you should use AddDefaultSlideWithLayout as it will do some post processing similar to PowerPoint to clear place holder text, etc.
func (*Presentation) Charts ¶
func (_aafg *Presentation) Charts() []_b.ChartSpace
Charts return the array of presentation charts.
func (*Presentation) Close ¶
func (_deff *Presentation) Close() error
Close closes the presentation, removing any temporary files that might have been created when opening a document.
func (*Presentation) CopySlide ¶
func (_cedb *Presentation) CopySlide(s Slide) (Slide, error)
CopySlide copies existing slide from another presentation and inserts it as a last one.
func (*Presentation) ExtractText ¶
func (_aaf *Presentation) ExtractText() *PresentationText
ExtractText returns text from a presentation as a PresentationText object.
func (*Presentation) GetColorBySchemeColor ¶
func (_dcca *Presentation) GetColorBySchemeColor(schClr _gbg.ST_SchemeColorVal) *_gbg.CT_Color
GetColorBySchemeColor returns *dml.CT_Color mapped to scheme colors like dk1, lt1 etc. depending on what theme is used in the presentation.
func (*Presentation) GetImageByRelID ¶
func (_ecee *Presentation) GetImageByRelID(relID string) (_ae.ImageRef, bool)
GetImageByRelID returns an ImageRef with the associated relation ID in the document.
func (*Presentation) GetImageByTarget ¶
func (_beda *Presentation) GetImageByTarget(target string) (_ae.ImageRef, bool)
GetImageByTarget returns an ImageRef with the given target in the document.
func (*Presentation) GetLayoutByName ¶
func (_eca *Presentation) GetLayoutByName(name string) (SlideLayout, error)
GetLayoutByName retrieves a slide layout given a layout name.
func (*Presentation) GetTableStyleById ¶
func (_faba *Presentation) GetTableStyleById(id string) *_gbg.CT_TableStyle
GetTableStyleById returns *dml.CT_TableStyle by its style id.
func (*Presentation) MoveSlide ¶
func (_abg *Presentation) MoveSlide(slideNumber, targetPos int) error
MoveSlide moves a slide with given number to position targetPos within a presentation.
func (*Presentation) RemoveSlide ¶
func (_cacd *Presentation) RemoveSlide(s Slide) error
RemoveSlide removes a slide from a presentation.
func (*Presentation) Save ¶
func (_efa *Presentation) Save(w _ff.Writer) error
Save writes the presentation out to a writer in the Zip package format
func (*Presentation) SaveAsTemplate ¶
func (_cedf *Presentation) SaveAsTemplate(w _ff.Writer) error
SaveAsTemplate writes the presentation out to a writer in the Zip package format as a template
func (*Presentation) SaveToFile ¶
func (_gdea *Presentation) SaveToFile(path string) error
SaveToFile writes the Presentation out to a file.
func (*Presentation) SaveToFileAsTemplate ¶
func (_fcfd *Presentation) SaveToFileAsTemplate(path string) error
SaveToFileAsTemplate writes the Presentation out to a file as a template.
func (*Presentation) SlideLayouts ¶
func (_gbac *Presentation) SlideLayouts() []SlideLayout
SlideLayouts returns the slide layouts defined in the presentation.
func (*Presentation) SlideMasters ¶
func (_cde *Presentation) SlideMasters() []SlideMaster
SlideMasters returns the slide masters defined in the presentation.
func (*Presentation) SlideSize ¶
func (_bdddf *Presentation) SlideSize() SlideSize
SlideSize returns presentation slide size.
func (*Presentation) Slides ¶
func (_ffbge *Presentation) Slides() []Slide
Slides returns the slides in the presentation.
func (*Presentation) Themes ¶
func (_afbd *Presentation) Themes() []*_gbg.Theme
Themes returns an array of presentation themes.
func (*Presentation) Validate ¶
func (_caea *Presentation) Validate() error
func (*Presentation) X ¶
func (_abc *Presentation) X() *_gf.Presentation
X returns the inner wrapped XML type.
type PresentationProperties ¶
type PresentationProperties struct {
// contains filtered or unexported fields
}
PresentationProperties contains document specific properties.
func NewPresentationProperties ¶
func NewPresentationProperties() PresentationProperties
NewPresentationProperties constructs a new PresentationProperties.
func (PresentationProperties) ClrMru ¶
func (_ccg PresentationProperties) ClrMru() *_gbg.CT_ColorMRU
ClrMru returns the ClrMru property.
func (PresentationProperties) ExtLst ¶
func (_dcd PresentationProperties) ExtLst() *_gf.CT_ExtensionList
ExtLst returns the ExtLst property.
func (PresentationProperties) HtmlPubPr ¶
func (_ged PresentationProperties) HtmlPubPr() *_gf.CT_HtmlPublishProperties
HtmlPubPr returns the HtmlPubPr property.
func (PresentationProperties) PrnPr ¶
func (_fb PresentationProperties) PrnPr() *_gf.CT_PrintProperties
PrnPr returns the PrnPr property.
func (PresentationProperties) ShowPr ¶
func (_cge PresentationProperties) ShowPr() *_gf.CT_ShowProperties
ShowPr returns the ShowPr property.
func (PresentationProperties) WebPr ¶
func (_cfgd PresentationProperties) WebPr() *_gf.CT_WebProperties
WebPr returns the WebPr property.
func (PresentationProperties) X ¶
func (_fac PresentationProperties) X() *_gf.PresentationPr
X returns the inner wrapped XML type.
type PresentationText ¶
type PresentationText struct{ Slides []*SlideText }
PresentationText is an array of extracted text items which has some methods for representing extracted text.
func (*PresentationText) Text ¶
func (_ge *PresentationText) Text() string
Text returns text from a presentation as one string separated with line breaks.
type Slide ¶
type Slide struct {
// contains filtered or unexported fields
}
Slide represents a slide of a presentation.
func (Slide) AddImageToRels ¶
AddImageToRels adds an image relationship to a slide without putting image on the slide.
func (Slide) AddTextBox ¶
AddTextBox adds an empty textbox to a slide.
func (*Slide) ExtractText ¶
ExtractText returns text from a slide as a SlideText object.
func (*Slide) GetChartSpaceByRelId ¶
func (_gdbe *Slide) GetChartSpaceByRelId(relId string) *_b.ChartSpace
GetChartSpaceByRelId returns a *crt.ChartSpace with the associated relation ID in the slide.
func (*Slide) GetColorBySchemeColor ¶
func (_fgaf *Slide) GetColorBySchemeColor(schClr _gbg.ST_SchemeColorVal) *_gbg.CT_Color
GetColorBySchemeColor returns *dml.CT_Color mapped to scheme colors like dk1, lt1 etc. depending on what theme is used in the presentation.
func (*Slide) GetImageByRelID ¶
GetImageByRelID returns an ImageRef with the associated relation ID in the slide.
func (*Slide) GetLayoutImageByRelID ¶
GetLayoutImageByRelID returns an ImageRef with the associated relation ID in the slide layout.
func (Slide) GetPlaceholder ¶
func (_cggb Slide) GetPlaceholder(t _gf.ST_PlaceholderType) (PlaceHolder, error)
GetPlaceholder returns a placeholder given its type. If there are multiplace placeholders of the same type, this method returns the first one. You must use the PlaceHolders() method to access the others.
func (Slide) GetPlaceholderByIndex ¶
func (_bgccc Slide) GetPlaceholderByIndex(idx uint32) (PlaceHolder, error)
GetPlaceholderByIndex returns a placeholder given its index. If there are multiplace placeholders of the same index, this method returns the first one. You must use the PlaceHolders() method to access the others.
func (*Slide) GetSlideLayout ¶
GetSlideLayout returns a slide layout related to the slide.
func (Slide) GetTextBoxes ¶
GetTextBoxes returns a list of all text boxes from a slide.
func (Slide) PlaceHolders ¶
func (_cege Slide) PlaceHolders() []PlaceHolder
PlaceHolders returns all of the content place holders within a given slide.
func (Slide) Presentation ¶
func (_edb Slide) Presentation() *Presentation
Presentation returns a slide's presentation.
func (Slide) ValidateWithPath ¶
ValidateWithPath validates the slide passing path informaton for a better error message.
type SlideLayout ¶
type SlideLayout struct {
// contains filtered or unexported fields
}
SlideLayout is a layout from which slides can be created.
func (SlideLayout) Name ¶
func (_aga SlideLayout) Name() string
Name returns the name of the slide layout.
func (SlideLayout) Type ¶
func (_ceea SlideLayout) Type() _gf.ST_SlideLayoutType
Type returns the type of the slide layout.
func (SlideLayout) X ¶
func (_cec SlideLayout) X() *_gf.SldLayout
X returns the inner wrapped XML type.
type SlideMaster ¶
type SlideMaster struct {
// contains filtered or unexported fields
}
SlideMaster is the slide master for a presentation.
func (SlideMaster) SlideLayouts ¶
func (_cfcg SlideMaster) SlideLayouts() []SlideLayout
SlideLayouts returns a slice of all layouts in SlideMaster.
func (SlideMaster) X ¶
func (_ccbd SlideMaster) X() *_gf.SldMaster
X returns the inner wrapped XML type.
type SlideScreenSize ¶
type SlideScreenSize [2]int32
SlideScreenSize represents the slide screen size as a 2 element array representing the width and height in EMU units.
func NewSlideScreenSize ¶
func NewSlideScreenSize() SlideScreenSize
NewSlideScreenSize returns slide screen size with default MS PowerPoint slide screen size 16x9.
func NewSlideScreenSizeWithValue ¶
func NewSlideScreenSizeWithValue(width, height int32) SlideScreenSize
NewSlideScreenSizeWithValue returns slide screen size with given width and height. Width and Height value is in EMU units, use our measurement.ToEMU to convert the - width and height value.
func (*SlideScreenSize) Height ¶
func (_bedb *SlideScreenSize) Height() int32
Height returns slide screen size height in EMU units.
func (*SlideScreenSize) SetHeight ¶
func (_cbbg *SlideScreenSize) SetHeight(val int32)
SetHeight sets height of slide screen size with given value in EMU units.
func (*SlideScreenSize) SetWidth ¶
func (_fgdad *SlideScreenSize) SetWidth(val int32)
SetWidth sets width of slide screen size with given value in EMU units.
func (*SlideScreenSize) Width ¶
func (_aadc *SlideScreenSize) Width() int32
Width returns slide screen size width in EMU units.
type SlideSize ¶
type SlideSize struct {
// contains filtered or unexported fields
}
SlideSize represents a slide size of a presentation.
func (*SlideSize) SetSize ¶
func (_bbdcc *SlideSize) SetSize(sz SlideScreenSize)
SetSize sets the slide size, take argument of SlideScreenSize.
func (*SlideSize) Size ¶
func (_gece *SlideSize) Size() SlideScreenSize
Size returns slide size value as SlideScreenSize.
func (*SlideSize) X ¶
func (_aff *SlideSize) X() *_gf.CT_SlideSize
X returns the inner wrapped XML type.
type SlideText ¶
type SlideText struct{ Items []*TextItem }
SlideText is an array of extracted text items which has some methods for representing extracted text from a slide.
type TableInfo ¶
type TableInfo struct {
Table *_gbg.CT_Table
Row *_gbg.CT_TableRow
Cell *_gbg.CT_TableCell
RowIndex int
ColIndex int
}
TableInfo is used for keep information about a table, a row and a cell where the text is located.
type TextBox ¶
type TextBox struct {
// contains filtered or unexported fields
}
TextBox is a text box within a slide.
func (TextBox) AddParagraph ¶
AddParagraph adds a paragraph to the text box
func (TextBox) Properties ¶
func (_gdge TextBox) Properties() _dea.ShapeProperties
Properties returns the properties of the TextBox.
func (TextBox) SetOffsetX ¶
SetOffsetX sets horizontal offset of text box in distance units (see measurement package).
func (TextBox) SetOffsetY ¶
SetOffsetY sets vertical offset of text box in distance units (see measurement package).
func (TextBox) SetTextAnchor ¶
func (_cbcb TextBox) SetTextAnchor(a _gbg.ST_TextAnchoringType)
SetTextAnchor controls the text anchoring
type TextItem ¶
type TextItem struct {
Text string
Presentation *Presentation
Shape *_gf.CT_Shape
GraphicFrame *_gf.CT_GraphicalObjectFrame
Paragraph *_gbg.CT_TextParagraph
Run *_gbg.CT_RegularTextRun
TableInfo *TableInfo
// contains filtered or unexported fields
}
TextItem is used for keeping text with references to a paragraph and run, a shape or a table, a row and a cell where it is located.
type ViewProperties ¶
type ViewProperties struct {
// contains filtered or unexported fields
}
ViewProperties contains presentation specific properties.
func NewViewProperties ¶
func NewViewProperties() ViewProperties
NewViewProperties constructs a new ViewProperties.
func (ViewProperties) ExtLst ¶
func (_eefc ViewProperties) ExtLst() *_gf.CT_ExtensionList
ExtLst returns the ExtLst property.
func (ViewProperties) GridSpacing ¶
func (_cdf ViewProperties) GridSpacing() *_gbg.CT_PositiveSize2D
GridSpacing returns the GridSpacing property.
func (ViewProperties) LastViewAttr ¶
func (_cgf ViewProperties) LastViewAttr() _gf.ST_ViewType
LastViewAttr returns the LastViewAttr property.
func (ViewProperties) NormalViewPr ¶
func (_gbad ViewProperties) NormalViewPr() *_gf.CT_NormalViewProperties
NormalViewPr returns the NormalViewPr property.
func (ViewProperties) NotesTextViewPr ¶
func (_cecb ViewProperties) NotesTextViewPr() *_gf.CT_NotesTextViewProperties
NotesTextViewPr returns the NotesTextViewPr property.
func (ViewProperties) NotesViewPr ¶
func (_eccg ViewProperties) NotesViewPr() *_gf.CT_NotesViewProperties
NotesViewPr returns the NotesViewPr property.
func (ViewProperties) OutlineViewPr ¶
func (_dfbf ViewProperties) OutlineViewPr() *_gf.CT_OutlineViewProperties
OutlineViewPr returns the OutlineViewPr property.
func (ViewProperties) ShowCommentsAttr ¶
func (_gfcf ViewProperties) ShowCommentsAttr() *bool
ShowCommentsAttr returns the WebPr property.
func (ViewProperties) SlideViewPr ¶
func (_ccdcd ViewProperties) SlideViewPr() *_gf.CT_SlideViewProperties
SlideViewPr returns the SlideViewPr property.
func (ViewProperties) SorterViewPr ¶
func (_acg ViewProperties) SorterViewPr() *_gf.CT_SlideSorterViewProperties
SorterViewPr returns the SorterViewPr property.
func (ViewProperties) X ¶
func (_ddga ViewProperties) X() *_gf.ViewPr
X returns the inner wrapped XML type.