xmptpg

package
v0.0.0-...-a3fba17 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package xmptpg implements the XMP Paged Text namespace as defined by XMP Specification Part 2.

Package xmptpg implements the XMP Paged Text namespace as defined by XMP Specification Part 2.

Index

Constants

This section is empty.

Variables

View Source
var (
	NsXmpTPg = xmp.NewNamespace("xmpTPg", "http://ns.adobe.com/xap/1.0/t/pg/", NewModel)
)

Functions

func NewModel

func NewModel(name string) xmp.Model

Types

type ColorType

type ColorType string
const (
	ColorTypeProcess ColorType = "PROCESS"
	ColorTypeSpot    ColorType = "SPOT"
)

type Colorant

type Colorant struct {
	A          int64        `xmp:"xmpG:A,attr"`
	B          int64        `xmp:"xmpG:B,attr"`
	L          float64      `xmp:"xmpG:L,attr"`
	Black      float64      `xmp:"xmpG:black,attr"`
	Cyan       float64      `xmp:"xmpG:cyan,attr"`
	Magenta    float64      `xmp:"xmpG:magenta,attr"`
	Yellow     float64      `xmp:"xmpG:yellow,attr"`
	Blue       int64        `xmp:"xmpG:blue,attr"`
	Green      int64        `xmp:"xmpG:green,attr"`
	Red        int64        `xmp:"xmpG:red,attr"`
	Mode       ColorantMode `xmp:"xmpG:mode,attr"`
	SwatchName string       `xmp:"xmpG:swatchName,attr"`
	Type       ColorType    `xmp:"xmpG:type,attr"`
}

Part 2: 1.2.2.1 Colorant

func (Colorant) IsZero

func (x Colorant) IsZero() bool

func (Colorant) MarshalXMP

func (x Colorant) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

type ColorantList

type ColorantList []Colorant

func (ColorantList) MarshalXMP

func (x ColorantList) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (ColorantList) Typ

func (x ColorantList) Typ() xmp.ArrayType

func (*ColorantList) UnmarshalXMP

func (x *ColorantList) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error

type ColorantMode

type ColorantMode string
const (
	ColorantModeCMYK ColorantMode = "CMYK"
	ColorantModeRGB  ColorantMode = "RGB"
	ColorantModeLAB  ColorantMode = "LAB"
)

type Dimensions

type Dimensions struct {
	H    float32 `xmp:"stDim:h,attr"`
	W    float32 `xmp:"stDim:w,attr"`
	Unit Unit    `xmp:"stDim:unit,attr"`
}

Part 2: 1.2.2.2 Dimensions

Default dimensions Letter 612x792 LetterSmall 612x792 Tabloid 792x1224 Ledger 1224x792 Legal 612x1008 Statement 396x612 Executive 540x720 A0 2384x3371 A1 1685x2384 A2 1190x1684 A3 842x1190 A4 595x842 A4Small 595x842 A5 420x595 B4 729x1032 B5 516x729 Envelope ???x??? Folio 612x936 Quarto 610x780 10x14 720x1008

func (Dimensions) IsZero

func (x Dimensions) IsZero() bool

func (Dimensions) MarshalXMP

func (x Dimensions) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

type Font

type Font struct {
	ChildFontFiles xmp.StringArray `xmp:"stFnt:childFontFiles"`
	Composite      xmp.Bool        `xmp:"stFnt:composite,attr"`
	FontFace       string          `xmp:"stFnt:fontFace,attr"`
	FontFamily     string          `xmp:"stFnt:fontFamily,attr"`
	FontFileName   string          `xmp:"stFnt:fontFileName,attr"`
	FontName       string          `xmp:"stFnt:fontName,attr"`
	FontType       FontType        `xmp:"stFnt:fontType,attr"`
	VersionString  string          `xmp:"stFnt:versionString,attr"`
}

Part 2: 1.2.2.3 Font

type FontArray

type FontArray []Font

func (FontArray) MarshalXMP

func (x FontArray) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (FontArray) Typ

func (x FontArray) Typ() xmp.ArrayType

func (*FontArray) UnmarshalXMP

func (x *FontArray) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error

type FontType

type FontType string
const (
	FontTypeTrueType FontType = "TrueType"
	FontTypeType1    FontType = "Type 1"
	FontTypeOpenType FontType = "Open Type"
)

type PagedText

type PagedText struct {
	Colorants              ColorantList    `xmp:"xmpTPg:Colorants"`
	Fonts                  FontArray       `xmp:"xmpTPg:Fonts"`
	MaxPageSize            Dimensions      `xmp:"xmpTPg:MaxPageSize"`
	NPages                 int64           `xmp:"xmpTPg:NPages,attr"`
	PlateNames             xmp.StringArray `xmp:"xmpTPg:PlateNames"`
	HasVisibleTransparency xmp.Bool        `xmp:"xmpTPg:HasVisibleTransparency"`
	HasVisibleOverprint    xmp.Bool        `xmp:"xmpTPg:HasVisibleOverprint"`
	SwatchGroups           SwatchGroupList `xmp:"xmpTPg:SwatchGroups"`
}

func FindModel

func FindModel(d *xmp.Document) *PagedText

func MakeModel

func MakeModel(d *xmp.Document) (*PagedText, error)

func (PagedText) Can

func (x PagedText) Can(nsName string) bool

func (*PagedText) CanTag

func (x *PagedText) CanTag(tag string) bool

func (*PagedText) GetTag

func (x *PagedText) GetTag(tag string) (string, error)

func (PagedText) Namespaces

func (x PagedText) Namespaces() xmp.NamespaceList

func (*PagedText) SetTag

func (x *PagedText) SetTag(tag, value string) error

func (*PagedText) SyncFromXMP

func (x *PagedText) SyncFromXMP(d *xmp.Document) error

func (*PagedText) SyncModel

func (x *PagedText) SyncModel(d *xmp.Document) error

func (PagedText) SyncToXMP

func (x PagedText) SyncToXMP(d *xmp.Document) error

type SwatchGroup

type SwatchGroup struct {
	GroupName string       `xmp:"xmpG:groupName"`
	GroupType int          `xmp:"xmpG:groupType"`
	Colorants ColorantList `xmp:"xmpG:Colorants"`
}

type SwatchGroupList

type SwatchGroupList []SwatchGroup

func (SwatchGroupList) MarshalXMP

func (x SwatchGroupList) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (SwatchGroupList) Typ

func (x SwatchGroupList) Typ() xmp.ArrayType

func (*SwatchGroupList) UnmarshalXMP

func (x *SwatchGroupList) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error

type Unit

type Unit string
const (
	UnitInch       Unit = "inch"
	UnitMillimeter Unit = "mm"
	UnitPixel      Unit = "pixel"
	UnitPica       Unit = "pica"
	UnitPoint      Unit = "point"
)

Jump to

Keyboard shortcuts

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