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 modules, 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

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