iwork

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package iwork reads documents of Apple's iWork applications, Pages, Keynote and Numbers, which are zip archives: the properties of a document from iWork '09, such as its title and authors, and the template and version of a document from iWork 2013 and later, and their previews

Index

Constants

View Source
const (
	ContentTypePages   = "application/vnd.apple.pages"
	ContentTypeKeynote = "application/vnd.apple.keynote"
	ContentTypeNumbers = "application/vnd.apple.numbers"
)

The content types of documents of Pages, Keynote and Numbers

Variables

View Source
var (
	// ErrNotDocument is returned for a zip archive which isn't an iWork
	// document
	ErrNotDocument = errors.New("not an iWork document")
)

Functions

This section is empty.

Types

type Document

type Document struct {
	// The document's properties, which a document from iWork '09 has
	Title, Comment, Copyright   string
	Authors, Keywords, Projects []string

	// The template the document was made from, and when, and the version
	// of the application which last saved it, such as 7.1, which a
	// document from iWork 2013 or later has
	Template string
	Created  time.Time
	Version  string

	// The document's preview, which is a JPEG image, or nil
	Preview []byte
}

Document is what's known of an iWork document, each of which is empty, or zero, when it isn't known

func Parse

func Parse(r io.ReaderAt, size int64) (*Document, error)

Parse returns what's known of the iWork document of the size: the properties of a document from iWork '09, from its index.xml, which can be compressed, or the template and version of a document from iWork 2013 or later, from its build version history, and its preview, or ErrNotDocument when it isn't an iWork document

Jump to

Keyboard shortcuts

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