Documentation
¶
Overview ¶
Package idml provides functionality for parsing and processing InDesign IDML files.
Index ¶
- type FileNotFoundError
- type Package
- func (p *Package) Close() error
- func (p *Package) CollectTextFrames(shouldInclude types.TextFramePredicate) ([]types.SelectedFrame, error)
- func (p *Package) GetSpread(storyID string) ([]types.Spread, error)
- func (p *Package) GetSpreads() []types.Spread
- func (p *Package) GetStory(id string) (*types.Story, error)
- func (p *Package) LoadColorGroups(idms *types.IDMS) error
- func (p *Package) LoadColorsAndSwatches(idms *types.IDMS) error
- func (p *Package) LoadLayers(idms *types.IDMS) error
- func (p *Package) LoadResources(idms *types.IDMS) error
- func (p *Package) LoadStyles(idms *types.IDMS) error
- func (p *Package) LoadTransparencyDefaults(idms *types.IDMS) error
- type ParseError
- type SpreadNotFoundError
- type StoryNotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileNotFoundError ¶
type FileNotFoundError struct {
FileName string
}
FileNotFoundError is returned when a required file is not found in the IDML archive
func (*FileNotFoundError) Error ¶
func (e *FileNotFoundError) Error() string
type Package ¶
type Package struct {
Stories []types.Story
Spreads []types.Spread
// contains filtered or unexported fields
}
Package represents an opened IDML file
func (*Package) CollectTextFrames ¶
func (p *Package) CollectTextFrames(shouldInclude types.TextFramePredicate) ([]types.SelectedFrame, error)
CollectTextFrames iterates through all spreads and collects TextFrames matching the predicate
func (*Package) GetSpreads ¶
GetSpreads returns all loaded spreads
func (*Package) LoadColorGroups ¶
LoadColorGroups implements ResourceLoader interface
func (*Package) LoadColorsAndSwatches ¶
LoadColorsAndSwatches implements ResourceLoader interface
func (*Package) LoadLayers ¶
LoadLayers implements ResourceLoader interface
func (*Package) LoadResources ¶
LoadResources loads all resources (styles, colors, layers, etc.) into the IDMS document
func (*Package) LoadStyles ¶
LoadStyles implements ResourceLoader interface
type ParseError ¶
ParseError is returned when XML parsing fails
func (*ParseError) Error ¶
func (e *ParseError) Error() string
func (*ParseError) Unwrap ¶
func (e *ParseError) Unwrap() error
type SpreadNotFoundError ¶
type SpreadNotFoundError struct {
StoryID string
}
SpreadNotFoundError is returned when no spreads contain the specified story
func (*SpreadNotFoundError) Error ¶
func (e *SpreadNotFoundError) Error() string
type StoryNotFoundError ¶
type StoryNotFoundError struct {
StoryID string
}
StoryNotFoundError is returned when a story with the given ID cannot be found
func (*StoryNotFoundError) Error ¶
func (e *StoryNotFoundError) Error() string