presentation

package
v0.0.0-...-9dee689 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 (i Image) Properties() drawing.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 (s PlaceHolder) AddParagraph() drawing.Paragraph

AddParagraph adds a new paragraph to a placeholder.

func (PlaceHolder) Clear

func (s 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 (s 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 (s PlaceHolder) Index() uint32

Index returns the placeholder index

func (PlaceHolder) Paragraphs

func (s PlaceHolder) Paragraphs() []drawing.Paragraph

Paragraphs returns the paragraphs defined in the placeholder.

func (PlaceHolder) Remove

func (s PlaceHolder) Remove() error

Remove removes a placeholder from a presentation.

func (PlaceHolder) SetText

func (s 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

Type returns the placeholder type

func (PlaceHolder) X

func (s PlaceHolder) X() *pml.CT_Shape

X returns the inner wrapped XML type.

type Presentation

type Presentation struct {
	common.DocBase
	// contains filtered or unexported fields
}

Presentation is the a presentation base document.

func New

func New() *Presentation

New initializes and reurns a new presentation

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 io.ReaderAt, size int64) (*Presentation, error)

Read reads a document from an io.Reader.

func (*Presentation) AddDefaultSlideWithLayout

func (p *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

func (p *Presentation) 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 (*Presentation) AddSlide

func (p *Presentation) AddSlide() Slide

AddSlide adds a new slide to the presentation.

func (*Presentation) AddSlideWithLayout

func (p *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) GetImageByRelID

func (p *Presentation) GetImageByRelID(relID string) (common.ImageRef, bool)

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

func (*Presentation) GetLayoutByName

func (p *Presentation) GetLayoutByName(name string) (SlideLayout, error)

GetLayoutByName retrieves a slide layout given a layout name.

func (*Presentation) GetOrCreateCustomProperties

func (p *Presentation) GetOrCreateCustomProperties() common.CustomProperties

GetOrCreateCustomProperties returns the custom properties of the document (and if they not exist yet, creating them first)

func (*Presentation) RemoveSlide

func (p *Presentation) RemoveSlide(s Slide) error

RemoveSlide removes a slide from a presentation.

func (*Presentation) Save

func (p *Presentation) Save(w io.Writer) error

Save writes the presentation out to a writer in the Zip package format

func (*Presentation) SaveAsTemplate

func (p *Presentation) SaveAsTemplate(w io.Writer) error

SaveAsTemplate writes the presentation out to a writer in the Zip package format as a template

func (*Presentation) SaveToFile

func (p *Presentation) SaveToFile(path string) error

SaveToFile writes the Presentation out to a file.

func (*Presentation) SaveToFileAsTemplate

func (p *Presentation) SaveToFileAsTemplate(path string) error

SaveToFileAsTemplate writes the Presentation out to a file as a template.

func (*Presentation) SlideLayouts

func (p *Presentation) SlideLayouts() []SlideLayout

SlideLayouts returns the slide layouts defined in the presentation.

func (*Presentation) SlideMasters

func (p *Presentation) SlideMasters() []SlideMaster

SlideMasters returns the slide masters defined in the presentation.

func (*Presentation) Slides

func (p *Presentation) Slides() []Slide

Slides returns the slides in the presentation.

func (*Presentation) Validate

func (p *Presentation) Validate() error

func (*Presentation) X

func (p *Presentation) X() *pml.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

ClrMru returns the ClrMru property.

func (PresentationProperties) ExtLst

ExtLst returns the ExtLst property.

func (PresentationProperties) HtmlPubPr

HtmlPubPr returns the HtmlPubPr property.

func (PresentationProperties) PrnPr

PrnPr returns the PrnPr property.

func (PresentationProperties) ShowPr

ShowPr returns the ShowPr property.

func (PresentationProperties) WebPr

WebPr returns the WebPr property.

func (PresentationProperties) X

X returns the inner wrapped XML type.

type Slide

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

Slide represents a slide of a presentation.

func (Slide) AddImage

func (s Slide) AddImage(img common.ImageRef) Image

AddImage adds an image textbox to a slide.

func (Slide) AddImageToRels

func (s Slide) AddImageToRels(img common.ImageRef) string

AddImageToRels adds an image relationship to a slide without putting image on the slide.

func (Slide) AddTextBox

func (s Slide) AddTextBox() TextBox

AddTextBox adds an empty textbox to a slide.

func (Slide) GetPlaceholder

func (s Slide) GetPlaceholder(t pml.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 (s 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) PlaceHolders

func (s Slide) PlaceHolders() []PlaceHolder

PlaceHolders returns all of the content place holders within a given slide.

func (Slide) ValidateWithPath

func (s Slide) ValidateWithPath(path string) error

ValidateWithPath validates the slide passing path informaton for a better error message.

func (Slide) X

func (s Slide) X() *pml.Sld

X returns the inner wrapped XML type.

type SlideLayout

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

SlideLayout is a layout from which slides can be created.

func (SlideLayout) Name

func (s SlideLayout) Name() string

Name returns the name of the slide layout.

func (SlideLayout) Type

Type returns the type of the slide layout.

func (SlideLayout) X

func (s SlideLayout) X() *pml.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 (s SlideMaster) SlideLayouts() []SlideLayout

SlideLayouts returns a slice of all layouts in SlideMaster.

func (SlideMaster) X

func (s SlideMaster) X() *pml.SldMaster

X returns the inner wrapped XML type.

type TextBox

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

TextBox is a text box within a slide.

func (TextBox) AddParagraph

func (t TextBox) AddParagraph() drawing.Paragraph

AddParagraph adds a paragraph to the text box

func (TextBox) Properties

func (t TextBox) Properties() drawing.ShapeProperties

Properties returns the properties of the TextBox.

func (TextBox) SetTextAnchor

func (t TextBox) SetTextAnchor(a dml.ST_TextAnchoringType)

SetTextAnchor controls the text anchoring

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 (p ViewProperties) ExtLst() *pml.CT_ExtensionList

ExtLst returns the ExtLst property.

func (ViewProperties) GridSpacing

func (p ViewProperties) GridSpacing() *dml.CT_PositiveSize2D

GridSpacing returns the GridSpacing property.

func (ViewProperties) LastViewAttr

func (p ViewProperties) LastViewAttr() pml.ST_ViewType

LastViewAttr returns the LastViewAttr property.

func (ViewProperties) NormalViewPr

func (p ViewProperties) NormalViewPr() *pml.CT_NormalViewProperties

NormalViewPr returns the NormalViewPr property.

func (ViewProperties) NotesTextViewPr

func (p ViewProperties) NotesTextViewPr() *pml.CT_NotesTextViewProperties

NotesTextViewPr returns the NotesTextViewPr property.

func (ViewProperties) NotesViewPr

func (p ViewProperties) NotesViewPr() *pml.CT_NotesViewProperties

NotesViewPr returns the NotesViewPr property.

func (ViewProperties) OutlineViewPr

func (p ViewProperties) OutlineViewPr() *pml.CT_OutlineViewProperties

OutlineViewPr returns the OutlineViewPr property.

func (ViewProperties) ShowCommentsAttr

func (p ViewProperties) ShowCommentsAttr() *bool

ShowCommentsAttr returns the WebPr property.

func (ViewProperties) SlideViewPr

func (p ViewProperties) SlideViewPr() *pml.CT_SlideViewProperties

SlideViewPr returns the SlideViewPr property.

func (ViewProperties) SorterViewPr

SorterViewPr returns the SorterViewPr property.

func (ViewProperties) X

func (p ViewProperties) X() *pml.ViewPr

X returns the inner wrapped XML type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL