Documentation
¶
Index ¶
- type Editor
- type EditorImpl
- func (e *EditorImpl) RemoveRect(ctx context.Context, page *semantic.Page, rect semantic.Rectangle) error
- func (e *EditorImpl) RepairStructTree(page *semantic.Page, structTree *semantic.StructureTree)
- func (e *EditorImpl) ReplaceText(ctx context.Context, page *semantic.Page, oldText, newText string) error
- type OpSpatialIndex
- type PointData
- type QuadTree
- type SpatialIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Editor ¶
type Editor interface {
// RemoveRect removes all content within the specified rectangle.
// This is useful for redaction.
// It also updates the StructureTree to remove references to deleted content (MCIDs).
RemoveRect(ctx context.Context, page *semantic.Page, rect semantic.Rectangle) error
// ReplaceText replaces occurrences of oldText with newText.
// Note: This is a complex operation that may require font subsetting adjustments
// and layout recalculation.
ReplaceText(ctx context.Context, page *semantic.Page, oldText, newText string) error
}
Editor provides high-level content editing capabilities.
type EditorImpl ¶
type EditorImpl struct{}
func NewEditor ¶
func NewEditor() *EditorImpl
func (*EditorImpl) RemoveRect ¶
func (*EditorImpl) RepairStructTree ¶
func (e *EditorImpl) RepairStructTree(page *semantic.Page, structTree *semantic.StructureTree)
RepairStructTree removes references to MCIDs that no longer exist on the page.
func (*EditorImpl) ReplaceText ¶
type OpSpatialIndex ¶
type OpSpatialIndex struct {
// contains filtered or unexported fields
}
func NewOpSpatialIndex ¶
func NewOpSpatialIndex(pageBounds semantic.Rectangle) *OpSpatialIndex
type QuadTree ¶
type QuadTree struct {
Bounds semantic.Rectangle
Capacity int
Points []PointData
Nodes []*QuadTree
}
QuadTree implements a spatial index for rectangles.
type SpatialIndex ¶
type SpatialIndex interface {
// Index indexes the operations of a page.
Index(ops []semantic.Operation, resources *semantic.Resources) error
// Query returns operations that intersect with the given rectangle.
Query(rect semantic.Rectangle) []int // Returns indices of operations
}
SpatialIndex indexes content stream operations by their bounding box.
Click to show internal directories.
Click to hide internal directories.