Documentation
¶
Overview ¶
Package manifold reads, writes and converts rich documents in pure Go.
Index ¶
- Constants
- Variables
- func Write(ctx context.Context, w io.Writer, d *Document, format Format, ...) error
- func WriteStructured(ctx context.Context, w io.Writer, s *StructuredDocument) error
- func WriteVDOCS(ctx context.Context, w io.Writer, d *Document) error
- type Block
- type Cell
- type Diagnostic
- type Document
- func FromStructured(s *StructuredDocument) (*Document, error)
- func Read(ctx context.Context, r io.Reader, format Format, opts ReadOptions) (*Document, error)
- func ReadDOCX(ctx context.Context, src io.Reader) (*Document, error)
- func ReadPDF(ctx context.Context, src io.Reader, opts ReadOptions) (doc *Document, err error)
- func ReadPPTX(ctx context.Context, r io.Reader) (*Document, error)
- func ReadVDOCS(ctx context.Context, r io.Reader) (*Document, error)
- type FontFace
- type Format
- type Image
- type Kind
- type Layout
- type ListItem
- type ListMarker
- type ListNumbering
- type Matrix
- type Metadata
- type Note
- type NoteReference
- type OfficeMath
- type PDFArtifact
- type PDFDestination
- type PDFNavigation
- type PDFNavigationLink
- type PDFPage
- type PDFReadLimits
- type PageMargins
- type Point
- type Presentation
- type PresentationResource
- type PresentationSlide
- type Quad
- type ReadOptions
- type Row
- type Run
- type RunningStories
- type RunningStory
- type Section
- type SectionStart
- type SlideObject
- type SourceElementReference
- type SourceInfo
- type SourceRegion
- type SourceStructureReference
- type StructuredAttributes
- type StructuredDocument
- type StructuredMark
- type StructuredNode
- type StructuredNote
- type StructuredPresentation
- type StructuredSlide
- type StructuredSlideObject
- type StructuredSlideResource
- type TableSpanSource
- type TableWidthSource
- type WriteOptions
Constants ¶
const AnchorPoint = engine.AnchorPoint
const DOCX = engine.DOCX
const Endnote = engine.Endnote
const Footnote = engine.Footnote
const Heading = engine.Heading
const JSON = engine.JSON
const ListBlock = engine.ListBlock
const OfficeMathBlock = engine.OfficeMathBlock
const PDF = engine.PDF
const PPTX = engine.PPTX
const PageBreak = engine.PageBreak
const Paragraph = engine.Paragraph
const Picture = engine.Picture
const SF = engine.SF
const SFGzip = engine.SFGzip
const SectionBlock = engine.SectionBlock
const SectionContinuous = engine.SectionContinuous
const SectionEvenPage = engine.SectionEvenPage
const SectionNextPage = engine.SectionNextPage
const SectionOddPage = engine.SectionOddPage
const StructuredSchema = engine.StructuredSchema
const Table = engine.Table
const Text = engine.Text
const VDOCS = engine.VDOCS
const VDOCSMIME = engine.VDOCSMIME
Variables ¶
var ErrLossy = engine.ErrLossy
var ErrUnsupported = engine.ErrUnsupported
Functions ¶
func WriteStructured ¶
WriteStructured validates and writes the ProseMirror profile.
Types ¶
type Diagnostic ¶
type Diagnostic = engine.Diagnostic
type Document ¶
Document is manifold's interchange model. Diagnostics describe input features whose structure cannot be represented. Converters reject lossy output unless the caller explicitly acknowledges those diagnostics.
func FromStructured ¶
func FromStructured(s *StructuredDocument) (*Document, error)
FromStructured validates and converts a ProseMirror tree to the document model.
type FontFace ¶
FontFace supplies one embeddable TTF program under a lookup family name. Bold/Italic select its request slot; the supplied outlines determine appearance. The renderer does not synthesize missing variants.
type Format ¶
func FormatFromName ¶
FormatFromName identifies a supported format from a filename.
type Layout ¶
Layout dimensions are points, 72 per inch. Zero Width/Height/Margin use A4 and the legacy 54pt fallback. Margins and distance pointers retain explicit zeros.
type ListItem ¶
ListItem owns its ordered blocks, including continuation paragraphs and nested lists.
type ListMarker ¶
type ListMarker = engine.ListMarker
ListMarker retains literal visible label content and its independent source owner. It does not define an automatic numbering or restart rule.
type ListNumbering ¶
type ListNumbering = engine.ListNumbering
ListNumbering describes an ordered-list label using OOXML's %1..%9 placeholders. Level is zero-based. Formats contains one format per level; Ancestors contains fallback values for levels before Level. Enclosing lists override matching ancestor levels when serialized, so nested edits renumber. Legal renders every referenced level in decimal, retaining its original format.
type NoteReference ¶
type NoteReference = engine.NoteReference
NoteReference identifies a note independently of its displayed automatic number. IDs are scoped by Kind and may be application identifiers rather than integers.
type OfficeMath ¶ added in v0.4.0
type OfficeMath = engine.OfficeMath
OfficeMath retains native OOXML equations through SF and DOCX.
type PDFArtifact ¶
type PDFArtifact = engine.PDFArtifact
PDFArtifact records an explicit marked-content artifact, independently of any inferred reusable header/footer template. BBox uses default user-space units (not the current content CTM); Bounds uses Matrix to map it into displayed physical points. Content refers back here through SourceInfo.Artifacts, including nested marked-content and images.
type PDFDestination ¶
type PDFDestination = engine.PDFDestination
type PDFNavigation ¶
type PDFNavigation = engine.PDFNavigation
PDFNavigation retains explicit PDF annotation/view evidence independently of inferred editable-flow anchors. Coordinates in Point/Region use displayed pt; Parameters retain original PDF user units and nullable viewer settings.
type PDFNavigationLink ¶
type PDFNavigationLink = engine.PDFNavigationLink
type PDFPage ¶
PDFPage records physical page boundaries even when a logical tagged paragraph spans pages. Boxes retain PDF user units; Width/Height and source quads use pt.
type PDFReadLimits ¶ added in v0.4.0
type PDFReadLimits = engine.PDFReadLimits
type PageMargins ¶
type PageMargins = engine.PageMargins
PageMargins overrides all four edges of Layout.Margin. Zero is an explicit zero margin. Top/Bottom may be negative for OOXML fixed body offsets that permit running-content overlap; Left/Right are nonnegative.
type Point ¶
Point is in physical points in displayed page coordinates: top-left origin, x right and y down. PDFPage.Transform maps original PDF user coordinates here.
type Presentation ¶ added in v0.3.0
type Presentation = engine.Presentation
type PresentationResource ¶ added in v0.3.0
type PresentationResource = engine.PresentationResource
type PresentationSlide ¶ added in v0.3.0
type PresentationSlide = engine.PresentationSlide
type ReadOptions ¶
type ReadOptions = engine.ReadOptions
type RunningStories ¶
type RunningStories = engine.RunningStories
RunningStories distinguishes an inherited nil story from an explicit empty one. Default serves odd pages (and all ordinary pages without EvenAndOddHeaders).
type RunningStory ¶
type RunningStory = engine.RunningStory
RunningStory is an independently inherited header or footer variant. A non-nil story with no blocks explicitly suppresses that variant.
type Section ¶
Section owns body content. Layout nil inherits the previous effective layout (the document layout for the first section). Stories inherit independently. Native PDF keeps the stories of the section that opened a physical page. A continuous section counts a shared page as local page one, even when its body is empty. Later pages select its default/even stories using that count.
type SectionStart ¶
type SectionStart = engine.SectionStart
SectionStart controls the section start relative to the preceding section. An empty value means nextPage; the first section starts the document.
type SlideObject ¶ added in v0.3.0
type SlideObject = engine.SlideObject
type SourceElementReference ¶
type SourceElementReference = engine.SourceElementReference
SourceElementReference retains an explicit logical cell that was an empty continuation of a geometrically recovered merged cell.
type SourceInfo ¶
type SourceInfo = engine.SourceInfo
SourceInfo records provenance, not an alternative copy of content. Quads use advance/font metrics, not glyph ink outlines. Precision discloses estimates. Confidence is a heuristic ranking, not a calibrated probability.
type SourceRegion ¶
type SourceRegion = engine.SourceRegion
type SourceStructureReference ¶
type SourceStructureReference = engine.SourceStructureReference
SourceStructureReference identifies the explicit owner and targets of a PDF structure Ref entry. Aggregate source bounds retain contributing edges too.
type StructuredAttributes ¶
type StructuredAttributes = engine.StructuredAttributes
type StructuredDocument ¶
type StructuredDocument = engine.StructuredDocument
StructuredDocument is a ProseMirror document using the versioned schema in docs/reference/STRUCTURED_FORMAT.md. It needs no JavaScript or ProseMirror runtime.
func ReadStructured ¶
ReadStructured reads and validates the ProseMirror profile.
func ToStructured ¶
func ToStructured(d *Document) (*StructuredDocument, error)
ToStructured converts the document model to its ProseMirror representation.
type StructuredMark ¶
type StructuredMark = engine.StructuredMark
type StructuredNode ¶
type StructuredNode = engine.StructuredNode
Attrs contains the attributes defined for this node type, encoded as an object. Unknown nodes, marks and attributes are rejected, never silently flattened.
type StructuredNote ¶
type StructuredNote = engine.StructuredNote
type StructuredPresentation ¶ added in v0.3.0
type StructuredPresentation = engine.StructuredPresentation
type StructuredSlide ¶ added in v0.3.0
type StructuredSlide = engine.StructuredSlide
type StructuredSlideObject ¶ added in v0.3.0
type StructuredSlideObject = engine.StructuredSlideObject
type StructuredSlideResource ¶ added in v0.3.0
type StructuredSlideResource = engine.StructuredSlideResource
type TableSpanSource ¶
type TableSpanSource = engine.TableSpanSource
TableSpanSource separates explicit logical membership from recovered spans. ColSpan and RowSpan are "explicit" or "inferred". Bounds records the painted cell boundary; SourceInfo.Quad continues to record its content bounds.
type TableWidthSource ¶
type TableWidthSource = engine.TableWidthSource
TableWidthSource records measured painted-grid widths independently from explicit PDF logical table membership. Confidence is not a probability.
type WriteOptions ¶
type WriteOptions = engine.WriteOptions
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
manifold
command
|
|
|
examples
|
|
|
bidi
command
Bidi layout uses paragraph context, directional shaping and logical text.
|
Bidi layout uses paragraph context, directional shaping and logical text. |
|
continuous
command
Four conversion paths with shared-page story changes and section-local parity.
|
Four conversion paths with shared-page story changes and section-local parity. |
|
continuous-admission
command
Four conversion paths for individually valid continuous stories needing new pages.
|
Four conversion paths for individually valid continuous stories needing new pages. |
|
continuous-geometry
command
Four conversion paths with changing continuous body frames and paper canvases.
|
Four conversion paths with changing continuous body frames and paper canvases. |
|
destinations
command
Named navigation points through SF, DOCX, native PDF and PDF view recovery.
|
Named navigation points through SF, DOCX, native PDF and PDF view recovery. |
|
font-subset
command
Exercise all four SF conversion paths with an explicitly supplied TTF.
|
Exercise all four SF conversion paths with an explicitly supplied TTF. |
|
glyphs
command
|
|
|
image-fit
command
Run with: GOWORK=off go run ./examples/image-fit -out output/image-fit
|
Run with: GOWORK=off go run ./examples/image-fit -out output/image-fit |
|
language
command
Language bindings and paragraph/run direction persist through SF and DOCX.
|
Language bindings and paragraph/run direction persist through SF and DOCX. |
|
lists
command
Run with: GOWORK=off go run ./examples/lists -out output/lists
|
Run with: GOWORK=off go run ./examples/lists -out output/lists |
|
merged-tables
command
Run with: GOWORK=off go run ./examples/merged-tables -out output/merged-tables
|
Run with: GOWORK=off go run ./examples/merged-tables -out output/merged-tables |
|
notes
command
Run with: GOWORK=off go run ./examples/notes -out output/notes
|
Run with: GOWORK=off go run ./examples/notes -out output/notes |
|
numbering
command
Numbering formats, nested edits, external contexts and rich stories via SF.
|
Numbering formats, nested edits, external contexts and rich stories via SF. |
|
page-breaks
command
Run with: GOWORK=off go run ./examples/page-breaks -out output/page-breaks
|
Run with: GOWORK=off go run ./examples/page-breaks -out output/page-breaks |
|
page-layout
command
Four conversion paths with explicit asymmetric/zero margins and running offsets.
|
Four conversion paths with explicit asymmetric/zero margins and running offsets. |
|
paint-context
command
Compatible typography keeps context across color, decorations and links.
|
Compatible typography keeps context across color, decorations and links. |
|
paragraph-breaks
command
Run with: GOWORK=off go run ./examples/paragraph-breaks -out output/paragraph-breaks
|
Run with: GOWORK=off go run ./examples/paragraph-breaks -out output/paragraph-breaks |
|
presentation
command
Create, edit and convert slides through the central SF reader/writer API.
|
Create, edit and convert slides through the central SF reader/writer API. |
|
recursive-tables
command
Run with: GOWORK=off go run ./examples/recursive-tables -out output/recursive-tables
|
Run with: GOWORK=off go run ./examples/recursive-tables -out output/recursive-tables |
|
repeated-headers
command
Run with: GOWORK=off go run ./examples/repeated-headers -out output/repeated-headers
|
Run with: GOWORK=off go run ./examples/repeated-headers -out output/repeated-headers |
|
report
command
Run with: go run ./examples/report -out output
|
Run with: go run ./examples/report -out output |
|
rich-cells
command
Run with: GOWORK=off go run ./examples/rich-cells -out output/rich-cells
|
Run with: GOWORK=off go run ./examples/rich-cells -out output/rich-cells |
|
running-content
command
Rich running stories are measured once and repeated without body overlap.
|
Rich running stories are measured once and repeated without body overlap. |
|
running-images
command
Budgeted DOCX running rasters, including serial, nested and body figures.
|
Budgeted DOCX running rasters, including serial, nested and body figures. |
|
section-controls
command
Four conversion paths for page controls, empty sections and note ownership.
|
Four conversion paths for page controls, empty sections and note ownership. |
|
sections
command
Four paths with section-specific geometry, inheritance and running variants.
|
Four paths with section-specific geometry, inheritance and running variants. |
|
shaping
command
Default text shaping needs no language tag or external runtime font service.
|
Default text shaping needs no language tag or external runtime font service. |
|
signed-overlap
command
Four conversion paths for minimum and signed fixed running/body margins.
|
Four conversion paths for minimum and signed fixed running/body margins. |
|
table-continuation
command
Run with: GOWORK=off go run ./examples/table-continuation -out output/table-continuation
|
Run with: GOWORK=off go run ./examples/table-continuation -out output/table-continuation |
|
table-widths
command
Preferred grid widths, merged cells, nested layout and continued headers.
|
Preferred grid widths, merged cells, nested layout and continued headers. |
|
tagged-spans
command
Extract an original tagged PDF and emit a small provenance audit and SF sample.
|
Extract an original tagged PDF and emit a small provenance audit and SF sample. |
|
text-style
command
Run with: GOWORK=off go run ./examples/text-style -out output/text-style
|
Run with: GOWORK=off go run ./examples/text-style -out output/text-style |
|
typography
command
Typography exercises proportional Unicode spacing and line breaking in Go.
|
Typography exercises proportional Unicode spacing and line breaking in Go. |
|
uri
command
Unicode IRI targets retain their URI semantics through the four SF paths.
|
Unicode IRI targets retain their URI semantics through the four SF paths. |
|
vdocs
command
Run from the repository root: GOWORK=off go run ./examples/vdocs -out output/vdocs-example
|
Run from the repository root: GOWORK=off go run ./examples/vdocs -out output/vdocs-example |
|
internal
|
|
|
bidilevels
Package bidilevels retains paragraph embedding levels for line layout.
|
Package bidilevels retains paragraph embedding levels for line layout. |
|
presentation/edit
Package edit plans and applies targeted deck mutations while preserving unrelated package content.
|
Package edit plans and applies targeted deck mutations while preserving unrelated package content. |
|
presentation/fixtures
Package fixtures provides deterministic fixture builders and helpers for .pptx acceptance and regression tests.
|
Package fixtures provides deterministic fixture builders and helpers for .pptx acceptance and regression tests. |
|
presentation/inspect
Package inspect turns .pptx packages into structured deck facts for agents and human reviewers.
|
Package inspect turns .pptx packages into structured deck facts for agents and human reviewers. |
|
presentation/model
Package model defines stable deck, slide, object, media, notes, warning, validation, and report data structures shared by Puppt workflows.
|
Package model defines stable deck, slide, object, media, notes, warning, validation, and report data structures shared by Puppt workflows. |
|
presentation/pptx
Package pptx contains Puppt-owned Open XML package reading, writing, relationships, and content-type handling for modern .pptx files.
|
Package pptx contains Puppt-owned Open XML package reading, writing, relationships, and content-type handling for modern .pptx files. |
|
presentation/render
Package render turns selected .pptx slides into PNG images using a Puppt-owned Open XML interpretation path.
|
Package render turns selected .pptx slides into PNG images using a Puppt-owned Open XML interpretation path. |
|
presentation/report
Package report produces stable JSON and concise human-readable summaries for Puppt commands.
|
Package report produces stable JSON and concise human-readable summaries for Puppt commands. |
|
presentation/review
Package review produces agent-readable and human-readable summaries of deck changes using the same stable result envelope as other commands.
|
Package review produces agent-readable and human-readable summaries of deck changes using the same stable result envelope as other commands. |
|
presentation/target
Package target resolves slide, object, text, notes, metadata, and media selectors before mutation.
|
Package target resolves slide, object, text, notes, metadata, and media selectors before mutation. |
|
presentation/validate
Package validate will verify .pptx package structure, relationship integrity, and expected content after inspection, edits, or creation.
|
Package validate will verify .pptx package structure, relationship integrity, and expected content after inspection, edits, or creation. |
|
Package presentation inspects, edits, validates and renders editable PPTX decks.
|
Package presentation inspects, edits, validates and renders editable PPTX decks. |
|
tools
|
|
|
hugetest
command
Command hugetest measures downloaded original documents in isolated child processes.
|
Command hugetest measures downloaded original documents in isolated child processes. |
|
loadtest
command
Command loadtest measures embedded Manifold operations; it is not a server.
|
Command loadtest measures embedded Manifold operations; it is not a server. |