types

package
v0.8.3-mateyai Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EolLF   = "\x0A"
	EolCR   = "\x0D"
	EolCRLF = "\x0D\x0A"
)

Supported line delimiters

View Source
const FreeHeadGeneration = 65535

FreeHeadGeneration is the predefined generation number for the head of the free list.

Variables

View Source
var ErrInvalidUTF16BE = errors.New("pdfcpu: invalid UTF-16BE detected")

ErrInvalidUTF16BE represents an error that gets raised for invalid UTF-16BE byte sequences.

View Source
var PaperSize = map[string]*Dim{}/* 150 elements not displayed */

PaperSize is a map of known paper sizes in user units (=72 dpi pixels).

Functions

func AnchorPosition

func AnchorPosition(a Anchor, r *Rectangle, w, h float64) (x float64, y float64)

func BestFitRectIntoRect

func BestFitRectIntoRect(rSrc, rDest *Rectangle, enforceOrient, scaleUp bool) (w, h, dx, dy, rot float64)

func ByteForOctalString

func ByteForOctalString(octalBytes string) (b byte)

Convert a 1,2 or 3 digit unescaped octal string into the corresponding byte value.

func CP1252ToUTF8

func CP1252ToUTF8(s string) string

CP1252ToUTF8 converts CP1252 to UTF-8.

func DateString

func DateString(t time.Time) string

DateString returns a string representation of t.

func DateTime

func DateTime(s string, relaxed bool) (time.Time, bool)

DateTime decodes s into a time.Time.

func DecodeName

func DecodeName(s string) (string, error)

DecodeName applies name decoding according to PDF spec.

func DecodeUTF16String

func DecodeUTF16String(s string) (string, error)

DecodeUTF16String decodes a UTF16BE string from a hex string.

func EncodeName

func EncodeName(s string) string

EncodeName applies name encoding according to PDF spec.

func EncodeUTF16String

func EncodeUTF16String(s string) string

func EqualSlices

func EqualSlices(a, b []string) bool

func Escape

func Escape(s string) (*string, error)

Escape applies all defined escape sequences to s.

func EscapeUTF16String

func EscapeUTF16String(s string) (*string, error)

func HexLiteralToString

func HexLiteralToString(hl HexLiteral) (string, error)

HexLiteralToString returns a possibly UTF16 encoded string for a hex string.

func IndRefMemberOf

func IndRefMemberOf(i IndirectRef, arr Array) bool

IntMemberOf returns true if list contains i.

func IntMemberOf

func IntMemberOf(i int, list []int) bool

IntMemberOf returns true if list contains i.

func IsStringUTF16BE

func IsStringUTF16BE(s string) bool

IsStringUTF16BE checks a string for Big Endian byte order BOM.

func IsUTF16BE

func IsUTF16BE(b []byte) bool

IsUTF16BE checks for Big Endian byte order mark and valid length.

func MemberOf

func MemberOf(s string, list []string) bool

MemberOf returns true if list contains s.

func NormalizeCoord

func NormalizeCoord(x, y float64, r *Rectangle, origin Corner, absolute bool) (float64, float64)

NormalizeCoord transfers P(x,y) from pdfcpu user space into PDF user space, which uses a coordinate system with origin in the lower left corner of r.

pdfcpu user space coordinate systems have the origin in one of four corners of r:

LowerLeft corner (default = PDF user space)

x extends to the right,
y extends upward

LowerRight corner:

x extends to the left,
y extends upward

UpperLeft corner:

x extends to the right,
y extends downward

UpperRight corner:

x extends to the left,
y extends downward

func NormalizeOffset

func NormalizeOffset(x, y float64, origin Corner) (float64, float64)

Normalize offset transfers x and y into offsets in the PDF user space.

func Reverse

func Reverse(s string) string

Reverse reverses the runes within s.

func StringLiteralToString

func StringLiteralToString(sl StringLiteral) (string, error)

StringLiteralToString returns the best possible string rep for a string literal.

func StringOrHexLiteral

func StringOrHexLiteral(obj Object) (*string, error)

func ToUserSpace

func ToUserSpace(f float64, unit DisplayUnit) float64

func UTF8ToCP1252

func UTF8ToCP1252(s string) string

UTF8ToCP1252 converts UTF-8 to CP1252.

func Unescape

func Unescape(s string) ([]byte, error)

Unescape resolves all escape sequences of s.

Types

type Anchor

type Anchor int

Anchor represents symbolic positions within a rectangular region.

const (
	TopLeft Anchor = iota
	TopCenter
	TopRight
	Left
	Center // default
	Right
	BottomLeft
	BottomCenter
	BottomRight
	Full // special case, no anchor needed, imageSize = pageSize
)

These are the defined anchors for relative positioning.

func ParseAnchor

func ParseAnchor(s string) (Anchor, error)

func ParsePositionAnchor

func ParsePositionAnchor(s string) (Anchor, error)

func (Anchor) String

func (a Anchor) String() string

type Array

type Array []Object

Array represents a PDF array object.

func NewHexLiteralArray

func NewHexLiteralArray(sVars ...string) Array

NewHexLiteralArray returns a PDFArray with HexLiteralLiteral entries.

func NewIntegerArray

func NewIntegerArray(fVars ...int) Array

NewIntegerArray returns a PDFArray with Integer entries.

func NewNameArray

func NewNameArray(sVars ...string) Array

NewNameArray returns a PDFArray with Name entries.

func NewNumberArray

func NewNumberArray(fVars ...float64) Array

NewNumberArray returns a PDFArray with Float entries.

func NewStringLiteralArray

func NewStringLiteralArray(sVars ...string) Array

NewStringLiteralArray returns a PDFArray with StringLiteral entries.

func (Array) Clone

func (a Array) Clone() Object

Clone returns a clone of a.

func (Array) PDFString

func (a Array) PDFString() string

PDFString returns a string representation as found in and written to a PDF file.

func (Array) String

func (a Array) String() string

type Boolean

type Boolean bool

Boolean represents a PDF boolean object.

func (Boolean) Clone

func (boolean Boolean) Clone() Object

Clone returns a clone of boolean.

func (Boolean) PDFString

func (boolean Boolean) PDFString() string

PDFString returns a string representation as found in and written to a PDF file.

func (Boolean) String

func (boolean Boolean) String() string

func (Boolean) Value

func (boolean Boolean) Value() bool

Value returns a bool value for this PDF object.

type ByteSize

type ByteSize float64

ByteSize represents the various terms for storage space.

const (
	KB ByteSize = 1 << (10 * iota)
	MB
	GB
)

Storage space terms.

func (ByteSize) String

func (b ByteSize) String() string

type Corner

type Corner int

Corner represents one of four rectangle corners.

const (
	LowerLeft Corner = iota
	LowerRight
	UpperLeft
	UpperRight
)

The four corners of a rectangle.

func ParseOrigin

func ParseOrigin(s string) (Corner, error)

type DecodeLazyObjectStreamObjectFunc

type DecodeLazyObjectStreamObjectFunc func(c context.Context, s string) (Object, error)

type Dict

type Dict map[string]Object

Dict represents a PDF dict object.

func NewDict

func NewDict() Dict

NewDict returns a new PDFDict object.

func (Dict) ArrayEntry

func (d Dict) ArrayEntry(key string) Array

ArrayEntry expects and returns a Array entry for given key.

func (Dict) BooleanEntry

func (d Dict) BooleanEntry(key string) *bool

BooleanEntry expects and returns a BooleanEntry for given key.

func (Dict) Clone

func (d Dict) Clone() Object

Clone returns a clone of d.

func (Dict) Delete

func (d Dict) Delete(key string) (value Object)

Delete deletes the Object for given key.

func (Dict) DictEntry

func (d Dict) DictEntry(key string) Dict

DictEntry expects and returns a PDFDict entry for given key.

func (Dict) Entry

func (d Dict) Entry(dictName, key string, required bool) (Object, error)

Entry returns the value for given key.

func (Dict) Find

func (d Dict) Find(key string) (Object, bool)

Find returns the Object for given key and PDFDict.

func (Dict) First

func (d Dict) First() *int

First returns a *int for key "First".

func (Dict) HexLiteralEntry

func (d Dict) HexLiteralEntry(key string) *HexLiteral

HexLiteralEntry returns a HexLiteral object for given key.

func (*Dict) Increment

func (d *Dict) Increment(key string) error

Increment increments the integer value for given key.

func (*Dict) IncrementBy

func (d *Dict) IncrementBy(key string, i int) error

IncrementBy increments the integer value for given key by i.

func (Dict) Index

func (d Dict) Index() Array

Index returns a *Array for key "Index".

func (Dict) IndirectRefEntry

func (d Dict) IndirectRefEntry(key string) *IndirectRef

IndirectRefEntry returns an indirectRefEntry for given key for this dictionary.

func (Dict) Insert

func (d Dict) Insert(k string, v Object) bool

Insert adds a new entry to this PDFDict.

func (Dict) InsertBool

func (d Dict) InsertBool(key string, value bool)

InsertBool adds a new bool entry to this PDFDict.

func (Dict) InsertFloat

func (d Dict) InsertFloat(key string, value float32)

InsertFloat adds a new float entry to this PDFDict.

func (Dict) InsertInt

func (d Dict) InsertInt(key string, value int)

InsertInt adds a new int entry to this PDFDict.

func (Dict) InsertName

func (d Dict) InsertName(key, value string)

InsertName adds a new name entry to this PDFDict.

func (Dict) InsertString

func (d Dict) InsertString(key, value string)

InsertString adds a new string entry to this PDFDict.

func (Dict) Int64Entry

func (d Dict) Int64Entry(key string) *int64

Int64Entry expects and returns a Integer entry representing an int64 value for given key.

func (Dict) IntEntry

func (d Dict) IntEntry(key string) *int

IntEntry expects and returns a Integer entry for given key.

func (Dict) IsLinearizationParmDict

func (d Dict) IsLinearizationParmDict() bool

IsLinearizationParmDict returns true if this dict has an int entry for key "Linearized".

func (Dict) IsObjStm

func (d Dict) IsObjStm() bool

IsObjStm returns true if given PDFDict is an object stream.

func (Dict) IsPage

func (d Dict) IsPage() bool

func (Dict) Len

func (d Dict) Len() int

Len returns the length of this PDFDict.

func (Dict) Length

func (d Dict) Length() (*int64, *int)

Length returns a *int64 for entry with key "Length". Stream length may be referring to an indirect object.

func (Dict) N

func (d Dict) N() *int

N returns a *int for key "N".

func (Dict) NameEntry

func (d Dict) NameEntry(key string) *string

NameEntry expects and returns a Name entry for given key.

func (Dict) NewIDForPrefix

func (d Dict) NewIDForPrefix(prefix string, i int) string

NewIDForPrefix returns next id with prefix.

func (Dict) PDFString

func (d Dict) PDFString() string

PDFString returns a string representation as found in and written to a PDF file.

func (Dict) Prev

func (d Dict) Prev() *int64

Prev returns the previous offset.

func (Dict) Size

func (d Dict) Size() *int

Size returns the value of the int entry for key "Size"

func (Dict) StreamDictEntry

func (d Dict) StreamDictEntry(key string) *StreamDict

StreamDictEntry expects and returns a StreamDict entry for given key. unused.

func (Dict) String

func (d Dict) String() string

func (Dict) StringEntry

func (d Dict) StringEntry(key string) *string

StringEntry expects and returns a StringLiteral entry for given key.

func (Dict) StringEntryBytes

func (d Dict) StringEntryBytes(key string) ([]byte, error)

StringEntryBytes returns the byte slice representing the string value for key.

func (Dict) StringLiteralEntry

func (d Dict) StringLiteralEntry(key string) *StringLiteral

StringLiteralEntry returns a StringLiteral object for given key.

func (Dict) StringOrHexLiteralEntry

func (d Dict) StringOrHexLiteralEntry(key string) (*string, error)

func (Dict) Subtype

func (d Dict) Subtype() *string

Subtype returns the value of the name entry for key "Subtype".

func (Dict) Type

func (d Dict) Type() *string

Type returns the value of the name entry for key "Type".

func (Dict) Update

func (d Dict) Update(key string, value Object)

Update modifies an existing entry of this PDFDict.

func (Dict) W

func (d Dict) W() Array

W returns a *Array for key "W".

type Dim

type Dim struct {
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
}

Dim represents the dimensions of a rectangular view medium like a PDF page, a sheet of paper or an image grid in user space, inches, centimetres or millimetres.

func ParsePageFormat

func ParsePageFormat(v string) (*Dim, string, error)

func (Dim) AspectRatio

func (d Dim) AspectRatio() float64

AspectRatio returns the relation between width and height.

func (Dim) ConvertToUnit

func (d Dim) ConvertToUnit(unit DisplayUnit) Dim

ConvertToUnit converts d to unit.

func (Dim) Landscape

func (d Dim) Landscape() bool

Landscape returns true if d is in landscape mode.

func (Dim) Portrait

func (d Dim) Portrait() bool

Portrait returns true if d is in portrait mode.

func (Dim) String

func (d Dim) String() string

func (Dim) ToCentimetres

func (d Dim) ToCentimetres() Dim

ToCentimetres converts d to centimetres.

func (Dim) ToInches

func (d Dim) ToInches() Dim

ToInches converts d to inches.

func (Dim) ToMillimetres

func (d Dim) ToMillimetres() Dim

ToMillimetres converts d to millimetres.

type DisplayUnit

type DisplayUnit int

DisplayUnit is the metric unit used to output paper sizes.

const (
	POINTS DisplayUnit = iota
	INCHES
	CENTIMETRES
	MILLIMETRES
)

Options for display unit in effect.

type Float

type Float float64

Float represents a PDF float object.

func (Float) Clone

func (f Float) Clone() Object

Clone returns a clone of f.

func (Float) PDFString

func (f Float) PDFString() string

PDFString returns a string representation as found in and written to a PDF file.

func (Float) String

func (f Float) String() string

func (Float) Value

func (f Float) Value() float64

Value returns a float64 value for this PDF object.

type HAlignment

type HAlignment int

HAlignment represents the horizontal alignment of text.

const (
	AlignLeft HAlignment = iota
	AlignCenter
	AlignRight
	AlignJustify
)

These are the options for horizontal aligned text.

func ParseHorAlignment

func ParseHorAlignment(s string) (HAlignment, error)

type HexLiteral

type HexLiteral string

HexLiteral represents a PDF hex literal object.

func NewHexLiteral

func NewHexLiteral(b []byte) HexLiteral

NewHexLiteral creates a new HexLiteral for b..

func (HexLiteral) Bytes

func (hexliteral HexLiteral) Bytes() ([]byte, error)

Bytes returns the byte representation.

func (HexLiteral) Clone

func (hexliteral HexLiteral) Clone() Object

Clone returns a clone of hexliteral.

func (HexLiteral) PDFString

func (hexliteral HexLiteral) PDFString() string

PDFString returns the string representation as found in and written to a PDF file.

func (HexLiteral) String

func (hexliteral HexLiteral) String() string

func (HexLiteral) Value

func (hexliteral HexLiteral) Value() string

Value returns a string value for this PDF object.

type IndirectRef

type IndirectRef struct {
	ObjectNumber     Integer
	GenerationNumber Integer
}

IndirectRef represents a PDF indirect object.

func NewIndirectRef

func NewIndirectRef(objectNumber, generationNumber int) *IndirectRef

NewIndirectRef returns a new PDFIndirectRef object.

func (IndirectRef) Clone

func (ir IndirectRef) Clone() Object

Clone returns a clone of ir.

func (IndirectRef) PDFString

func (ir IndirectRef) PDFString() string

PDFString returns a string representation as found in and written to a PDF file.

func (IndirectRef) String

func (ir IndirectRef) String() string

type IntSet

type IntSet map[int]bool

IntSet is a set of integers.

type Integer

type Integer int

Integer represents a PDF integer object.

func (Integer) Clone

func (i Integer) Clone() Object

Clone returns a clone of i.

func (Integer) PDFString

func (i Integer) PDFString() string

PDFString returns a string representation as found in and written to a PDF file.

func (Integer) String

func (i Integer) String() string

func (Integer) Value

func (i Integer) Value() int

Value returns an int value for this PDF object.

type LazyObjectStreamObject

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

func (LazyObjectStreamObject) Clone

func (l LazyObjectStreamObject) Clone() Object

func (*LazyObjectStreamObject) DecodedObject

func (l *LazyObjectStreamObject) DecodedObject(c context.Context) (Object, error)

func (*LazyObjectStreamObject) GetData

func (l *LazyObjectStreamObject) GetData() ([]byte, error)

func (LazyObjectStreamObject) PDFString

func (l LazyObjectStreamObject) PDFString() string

func (LazyObjectStreamObject) String

func (l LazyObjectStreamObject) String() string

type LineJoinStyle

type LineJoinStyle int

LineJoinStyle represents the shape to be used at the corners of paths that are stroked (see 8.4.3.4)

const (
	LJMiter LineJoinStyle = iota
	LJRound
	LJBevel
)

Render mode

type Name

type Name string

Name represents a PDF name object.

func (Name) Clone

func (nameObject Name) Clone() Object

Clone returns a clone of nameObject.

func (Name) PDFString

func (nameObject Name) PDFString() string

PDFString returns a string representation as found in and written to a PDF file.

func (Name) String

func (nameObject Name) String() string

func (Name) Value

func (nameObject Name) Value() string

Value returns a string value for this PDF object.

type Object

type Object interface {
	fmt.Stringer
	Clone() Object
	PDFString() string
}

Object defines an interface for all Objects.

func NewLazyObjectStreamObject

func NewLazyObjectStreamObject(osd *ObjectStreamDict, startOffset, endOffset int, decodeFunc DecodeLazyObjectStreamObjectFunc) Object

type ObjectStreamDict

type ObjectStreamDict struct {
	StreamDict
	Prolog         []byte
	ObjCount       int
	FirstObjOffset int
	ObjArray       Array
}

ObjectStreamDict represents a object stream dictionary.

func NewObjectStreamDict

func NewObjectStreamDict() *ObjectStreamDict

NewObjectStreamDict creates a new ObjectStreamDict object.

func (*ObjectStreamDict) AddObject

func (osd *ObjectStreamDict) AddObject(objNumber int, pdfString string) error

AddObject adds another object to this object stream. Relies on decoded content!

func (*ObjectStreamDict) Finalize

func (osd *ObjectStreamDict) Finalize()

Finalize prepares the final content of the objectstream.

func (*ObjectStreamDict) IndexedObject

func (osd *ObjectStreamDict) IndexedObject(index int) (Object, error)

IndexedObject returns the object at given index from a ObjectStreamDict.

type Orientation

type Orientation int

TODO Refactor because of orientation in nup.go

const (
	Horizontal Orientation = iota
	Vertical
)

type PDFFilter

type PDFFilter struct {
	Name        string
	DecodeParms Dict
}

PDFFilter represents a PDF stream filter object.

type Point

type Point struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

Point represents a user space location.

func (Point) String

func (p Point) String() string

func (*Point) Translate

func (p *Point) Translate(dx, dy float64)

Translate modifies p's coordinates.

type QuadLiteral

type QuadLiteral struct {
	P1, P2, P3, P4 Point
}

QuadLiteral is a polygon with four edges and four vertices. The four vertices are assumed to be specified in counter clockwise order.

func (QuadLiteral) Array

func (ql QuadLiteral) Array() Array

Array returns the PDF representation of ql.

func (QuadLiteral) EnclosingRectangle

func (ql QuadLiteral) EnclosingRectangle(f float64) *Rectangle

EnclosingRectangle calculates the rectangle enclosing ql's vertices at a distance f.

type QuadPoints

type QuadPoints []QuadLiteral

QuadPoints is an array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space.

func (*QuadPoints) AddQuadLiteral

func (qp *QuadPoints) AddQuadLiteral(ql QuadLiteral)

AddQuadLiteral adds a quadliteral to qp.

func (*QuadPoints) Array

func (qp *QuadPoints) Array() Array

Array returns the PDF representation of qp.

type Rectangle

type Rectangle struct {
	LL Point `json:"ll"`
	UR Point `json:"ur"`
}

Rectangle represents a rectangular region in userspace.

func NewRectangle

func NewRectangle(llx, lly, urx, ury float64) *Rectangle

NewRectangle returns a new rectangle for given corner coordinates.

func RectForDim

func RectForDim(width, height float64) *Rectangle

RectForDim returns a new rectangle for given dimensions.

func RectForFormat

func RectForFormat(f string) *Rectangle

RectForFormat returns a new rectangle for given format.

func RectForWidthAndHeight

func RectForWidthAndHeight(llx, lly, width, height float64) *Rectangle

RectForWidthAndHeight returns a new rectangle for given dimensions.

func (Rectangle) Array

func (r Rectangle) Array() Array

Array returns the PDF representation of a rectangle.

func (Rectangle) AspectRatio

func (r Rectangle) AspectRatio() float64

AspectRatio returns the relation between width and height of a rectangle.

func (Rectangle) Center

func (r Rectangle) Center() Point

Center returns the center point of a rectangle.

func (Rectangle) Clone

func (r Rectangle) Clone() *Rectangle

Clone returns a clone of r.

func (Rectangle) Contains

func (r Rectangle) Contains(p Point) bool

Contains returns true if rectangle r contains point p.

func (*Rectangle) ConvertToUnit

func (r *Rectangle) ConvertToUnit(unit DisplayUnit) *Rectangle

ConvertToUnit converts r to unit.

func (Rectangle) CroppedCopy

func (r Rectangle) CroppedCopy(margin float64) *Rectangle

CroppedCopy returns a copy of r with applied margin..

func (Rectangle) Dimensions

func (r Rectangle) Dimensions() Dim

Dimensions returns r's dimensions.

func (Rectangle) Equals

func (r Rectangle) Equals(r2 Rectangle) bool

func (Rectangle) FitsWithin

func (r Rectangle) FitsWithin(r2 *Rectangle) bool

FitsWithin returns true if rectangle r fits within rectangle r2.

func (Rectangle) Format

func (r Rectangle) Format(unit DisplayUnit) string

Format returns r's details converted into unit.

func (Rectangle) Height

func (r Rectangle) Height() float64

Height returns the vertical span of a rectangle in userspace.

func (Rectangle) Landscape

func (r Rectangle) Landscape() bool

Landscape returns true if r is in landscape mode.

func (Rectangle) Portrait

func (r Rectangle) Portrait() bool

Portrait returns true if r is in portrait mode.

func (Rectangle) ScaledHeight

func (r Rectangle) ScaledHeight(w float64) float64

ScaledHeight returns the height for given width according to r's aspect ratio.

func (Rectangle) ScaledWidth

func (r Rectangle) ScaledWidth(h float64) float64

ScaledWidth returns the width for given height according to r's aspect ratio.

func (Rectangle) ShortString

func (r Rectangle) ShortString() string

ShortString returns a compact string representation for r.

func (Rectangle) String

func (r Rectangle) String() string

func (Rectangle) ToCentimetres

func (r Rectangle) ToCentimetres() *Rectangle

ToCentimetres converts r to centimetres.

func (Rectangle) ToInches

func (r Rectangle) ToInches() *Rectangle

ToInches converts r to inches.

func (Rectangle) ToMillimetres

func (r Rectangle) ToMillimetres() *Rectangle

ToMillimetres converts r to millimetres.

func (*Rectangle) Translate

func (r *Rectangle) Translate(dx, dy float64)

Translate moves r by dx and dy.

func (Rectangle) Width

func (r Rectangle) Width() float64

Width returns the horizontal span of a rectangle in userspace.

type RelPosition

type RelPosition int

RelPosition represents the relative position of a text field's label.

const (
	RelPosLeft RelPosition = iota
	RelPosRight
	RelPosTop
	RelPosBottom
)

These are the options for relative label positions.

func ParseRelPosition

func ParseRelPosition(s string) (RelPosition, error)

type StreamDict

type StreamDict struct {
	Dict
	StreamOffset      int64
	StreamLength      *int64
	StreamLengthObjNr *int
	FilterPipeline    []PDFFilter
	Raw               []byte // Encoded
	Content           []byte // Decoded
	//DCTImage          image.Image
	IsPageContent bool
	CSComponents  int
}

StreamDict represents a PDF stream dict object.

func NewStreamDict

func NewStreamDict(d Dict, streamOffset int64, streamLength *int64, streamLengthObjNr *int, filterPipeline []PDFFilter) StreamDict

NewStreamDict creates a new PDFStreamDict for given PDFDict, stream offset and length.

func (StreamDict) Clone

func (sd StreamDict) Clone() Object

Clone returns a clone of sd.

func (*StreamDict) Decode

func (sd *StreamDict) Decode() error

Decode applies sd's filter pipeline to sd.Raw in order to produce sd.Content.

func (*StreamDict) DecodeLength

func (sd *StreamDict) DecodeLength(maxLen int64) ([]byte, error)

func (*StreamDict) Encode

func (sd *StreamDict) Encode() error

Encode applies sd's filter pipeline to sd.Content in order to produce sd.Raw.

func (StreamDict) HasSoleFilterNamed

func (sd StreamDict) HasSoleFilterNamed(filterName string) bool

HasSoleFilterNamed returns true if sd has a filterPipeline with 1 filter named filterName.

func (StreamDict) Image

func (sd StreamDict) Image() bool

type StringLiteral

type StringLiteral string

StringLiteral represents a PDF string literal object.

func (StringLiteral) Clone

func (stringliteral StringLiteral) Clone() Object

Clone returns a clone of stringLiteral.

func (StringLiteral) PDFString

func (stringliteral StringLiteral) PDFString() string

PDFString returns a string representation as found in and written to a PDF file.

func (StringLiteral) String

func (stringliteral StringLiteral) String() string

func (StringLiteral) Value

func (stringliteral StringLiteral) Value() string

Value returns a string value for this PDF object.

type StringSet

type StringSet map[string]bool

StringSet is a set of strings.

func NewStringSet

func NewStringSet(slice []string) StringSet

NewStringSet returns a new StringSet for slice.

type VAlignment

type VAlignment int

VAlignment represents the vertical alignment of text.

const (
	AlignBaseline VAlignment = iota
	AlignTop
	AlignMiddle
	AlignBottom
)

These are the options for vertical aligned text.

type XRefStreamDict

type XRefStreamDict struct {
	StreamDict
	Size           int
	Objects        []int
	W              [3]int
	PreviousOffset *int64
}

XRefStreamDict represents a cross reference stream dictionary.

Jump to

Keyboard shortcuts

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