idml

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package idml provides functionality for parsing and processing InDesign IDML files.

Index

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 Open

func Open(path string) (*Package, error)

Open opens an IDML file and reads its structure

func (*Package) Close

func (p *Package) Close() error

Close closes the IDML package

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) GetSpread

func (p *Package) GetSpread(storyID string) ([]types.Spread, error)

GetSpread implements Reader interface - retrieves spreads for a story

func (*Package) GetSpreads

func (p *Package) GetSpreads() []types.Spread

GetSpreads returns all loaded spreads

func (*Package) GetStory

func (p *Package) GetStory(id string) (*types.Story, error)

GetStory retrieves a specific story by ID

func (*Package) LoadColorGroups

func (p *Package) LoadColorGroups(idms *types.IDMS) error

LoadColorGroups implements ResourceLoader interface

func (*Package) LoadColorsAndSwatches

func (p *Package) LoadColorsAndSwatches(idms *types.IDMS) error

LoadColorsAndSwatches implements ResourceLoader interface

func (*Package) LoadLayers

func (p *Package) LoadLayers(idms *types.IDMS) error

LoadLayers implements ResourceLoader interface

func (*Package) LoadResources

func (p *Package) LoadResources(idms *types.IDMS) error

LoadResources loads all resources (styles, colors, layers, etc.) into the IDMS document

func (*Package) LoadStyles

func (p *Package) LoadStyles(idms *types.IDMS) error

LoadStyles implements ResourceLoader interface

func (*Package) LoadTransparencyDefaults

func (p *Package) LoadTransparencyDefaults(idms *types.IDMS) error

LoadTransparencyDefaults implements ResourceLoader interface

type ParseError

type ParseError struct {
	FileName string
	Err      error
}

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

Jump to

Keyboard shortcuts

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