model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Metadata Metadata `json:"metadata"`
	Pages    []Page   `json:"pages"`
}

Document represents the final output of the library.

type Image

type Image struct {
	Type       string    `json:"type"`                  // "image" or "inline_image"
	ID         string    `json:"id,omitempty"`          // e.g., "Im1" (empty for inline images)
	Rect       []float64 `json:"rect,omitempty"`        // [x, y, width, height]
	Width      float64   `json:"width,omitempty"`       // Image width in pixels
	Height     float64   `json:"height,omitempty"`      // Image height in pixels
	ColorSpace string    `json:"color_space,omitempty"` // e.g., "/DeviceRGB"
}

Image represents an image reference on a page.

type Metadata

type Metadata struct {
	Title    string `json:"title,omitempty"`
	Author   string `json:"author,omitempty"`
	Creator  string `json:"creator,omitempty"`
	Producer string `json:"producer,omitempty"`
	// Encrypted indicates if the file was password protected
	Encrypted bool `json:"encrypted"`
}

Metadata holds document-level information.

type Page

type Page struct {
	PageNumber int      `json:"page_number"`
	Content    string   `json:"content"` // Markdown/Formatted text
	CharCount  int      `json:"char_count"`
	Width      float64  `json:"width"`
	Height     float64  `json:"height"`
	Images     *[]Image `json:"images,omitempty"` // Pointer allows nil (omitted) vs empty slice (shown as [])
}

Page represents a single page in the PDF.

Jump to

Keyboard shortcuts

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