reader

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FontFromFile

type FontFromFile interface {
	font.Embedded

	ForeachGlyph(s pdf.String, yield func(gid glyph.ID, text []rune, width float64, is_space bool))

	FontData() interface{}

	Key() pdf.Reference
}

FontFromFile represents a font which has been extracted from a PDF file.

type Reader

type Reader struct {
	R pdf.Getter

	Resources *pdf.Resources
	graphics.State

	// User callbacks
	DrawGlyph func(g font.Glyph) error
	Text      func(text string) error
	UnknownOp func(op string, args []pdf.Object) error
	EveryOp   func(op string, args []pdf.Object) error
	// contains filtered or unexported fields
}

A Reader reads a PDF content stream.

func New

func New(r pdf.Getter, loader *loader.FontLoader) *Reader

New creates a new Reader.

func (*Reader) NewPage

func (r *Reader) NewPage()

func (*Reader) ParseContentStream

func (r *Reader) ParseContentStream(in io.Reader) error

ParseContentStream parses a PDF content stream.

func (*Reader) ParsePage

func (r *Reader) ParsePage(page pdf.Object, ctm matrix.Matrix) error

ParsePage parses a page, and calls the appropriate callback functions.

func (*Reader) ReadExtGState

func (r *Reader) ReadExtGState(ref pdf.Object, defaultName pdf.Name) (*graphics.ExtGState, error)

ReadExtGState reads an graphics state parameter dictionary from a PDF file.

func (*Reader) ReadFont

func (r *Reader) ReadFont(ref pdf.Object, name pdf.Name) (F FontFromFile, err error)

ReadFont extracts a font from a PDF file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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