contentstream

package
v0.0.0-...-692e68a Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentStreamInlineImage

type ContentStreamInlineImage struct {
	BitsPerComponent core.PdfObject
	ColorSpace       core.PdfObject
	Decode           core.PdfObject
	DecodeParms      core.PdfObject
	Filter           core.PdfObject
	Height           core.PdfObject
	ImageMask        core.PdfObject
	Intent           core.PdfObject
	Interpolate      core.PdfObject
	Width            core.PdfObject
	// contains filtered or unexported fields
}

A representation of an inline image in a Content stream. Everything between the BI and EI operands. ContentStreamInlineImage implements the core.PdfObject interface although strictly it is not a PDF object.

func (*ContentStreamInlineImage) DefaultWriteString

func (this *ContentStreamInlineImage) DefaultWriteString() string

func (*ContentStreamInlineImage) String

func (this *ContentStreamInlineImage) String() string

type ContentStreamOperation

type ContentStreamOperation struct {
	Params  []PdfObject
	Operand string
}

type ContentStreamOperations

type ContentStreamOperations []*ContentStreamOperation

func (*ContentStreamOperations) Bytes

func (this *ContentStreamOperations) Bytes() []byte

Convert a set of content stream operations to a content stream byte presentation, i.e. the kind that can be stored as a PDF stream or string format.

func (*ContentStreamOperations) WrapIfNeeded

func (this *ContentStreamOperations) WrapIfNeeded() *ContentStreamOperations

Wrap entire contents within q ... Q. If unbalanced, then adds extra Qs at the end. Only does if needed. Ensures that when adding new content, one start with all states in the default condition.

type ContentStreamParser

type ContentStreamParser struct {
	// contains filtered or unexported fields
}

Content stream parser.

func NewContentStreamParser

func NewContentStreamParser(contentStr string) *ContentStreamParser

Create a new instance of the content stream parser from an input content stream string.

func (*ContentStreamParser) Parse

Parses all commands in content stream, returning a list of operation data.

func (*ContentStreamParser) ParseInlineImage

func (this *ContentStreamParser) ParseInlineImage() (*ContentStreamInlineImage, error)

Parse an inline image from a content stream, both read its properties and binary data. When called, "BI" has already been read from the stream. This function finishes reading through "EI" and then returns the ContentStreamInlineImage.

type ContentStreamProcessor

type ContentStreamProcessor struct {
	// contains filtered or unexported fields
}

func NewContentStreamProcessor

func NewContentStreamProcessor(ops []*ContentStreamOperation) *ContentStreamProcessor

func (*ContentStreamProcessor) AddHandler

func (csp *ContentStreamProcessor) AddHandler(condition HandlerConditionEnum, operand string, handler HandlerFunc)

func (*ContentStreamProcessor) Process

func (this *ContentStreamProcessor) Process(resources FontsByNames) error

Process the entire operations.

type HandlerConditionEnum

type HandlerConditionEnum int
const (
	HandlerConditionEnumOperand     HandlerConditionEnum = iota
	HandlerConditionEnumAllOperands HandlerConditionEnum = iota
)

func (HandlerConditionEnum) All

func (this HandlerConditionEnum) All() bool

func (HandlerConditionEnum) Operand

func (this HandlerConditionEnum) Operand() bool

type HandlerEntry

type HandlerEntry struct {
	Condition HandlerConditionEnum
	Operand   string
	Handler   HandlerFunc
}

type HandlerFunc

type HandlerFunc func(op *ContentStreamOperation, resources FontsByNames) error

type HandlerFunc func(op *ContentStreamOperation, gs GraphicsState, resources *PdfPageResources) error

Jump to

Keyboard shortcuts

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