Versions in this module Expand all Collapse all v1 v1.0.4 Feb 17, 2024 v1.0.3 Feb 17, 2024 v1.0.2 Feb 17, 2024 v1.0.1 Feb 17, 2024 v1.0.0 Feb 16, 2024 Changes in this version + const EolCR + const EolCRLF + const EolLF + const FreeHeadGeneration + var ErrInvalidUTF16BE = errors.New("pdfcpu: invalid UTF-16BE detected") + var PaperSize = map[string]*Dim + func AnchorPosition(a Anchor, r *Rectangle, w, h float64) (x float64, y float64) + func BestFitRectIntoRect(rSrc, rDest *Rectangle, enforceOrient, scaleUp bool) (w, h, dx, dy, rot float64) + func ByteForOctalString(octalBytes string) (b byte) + func CP1252ToUTF8(s string) string + func DateString(t time.Time) string + func DateTime(s string, relaxed bool) (time.Time, bool) + func DecodeName(s string) (string, error) + func DecodeUTF16String(s string) (string, error) + func EncodeName(s string) string + func EncodeUTF16String(s string) string + func EqualSlices(a, b []string) bool + func Escape(s string) (*string, error) + func EscapeUTF16String(s string) (*string, error) + func HexLiteralToString(hl HexLiteral) (string, error) + func IndRefMemberOf(i IndirectRef, arr Array) bool + func IntMemberOf(i int, list []int) bool + func IsStringUTF16BE(s string) bool + func IsUTF16BE(b []byte) bool + func MemberOf(s string, list []string) bool + func NormalizeCoord(x, y float64, r *Rectangle, origin Corner, absolute bool) (float64, float64) + func NormalizeOffset(x, y float64, origin Corner) (float64, float64) + func Reverse(s string) string + func StringLiteralToString(sl StringLiteral) (string, error) + func StringOrHexLiteral(obj Object) (*string, error) + func ToUserSpace(f float64, unit DisplayUnit) float64 + func UTF8ToCP1252(s string) string + func Unescape(s string) ([]byte, error) + type Anchor int + const BottomCenter + const BottomLeft + const BottomRight + const Center + const Full + const Left + const Right + const TopCenter + const TopLeft + const TopRight + func ParseAnchor(s string) (Anchor, error) + func ParsePositionAnchor(s string) (Anchor, error) + func (a Anchor) String() string + type Array []Object + func NewHexLiteralArray(sVars ...string) Array + func NewIntegerArray(fVars ...int) Array + func NewNameArray(sVars ...string) Array + func NewNumberArray(fVars ...float64) Array + func NewStringLiteralArray(sVars ...string) Array + func (a Array) Clone() Object + func (a Array) PDFString() string + func (a Array) String() string + type Boolean bool + func (boolean Boolean) Clone() Object + func (boolean Boolean) PDFString() string + func (boolean Boolean) String() string + func (boolean Boolean) Value() bool + type ByteSize float64 + const GB + const KB + const MB + func (b ByteSize) String() string + type Corner int + const LowerLeft + const LowerRight + const UpperLeft + const UpperRight + func ParseOrigin(s string) (Corner, error) + type Dict map[string]Object + func NewDict() Dict + func (d *Dict) Increment(key string) error + func (d *Dict) IncrementBy(key string, i int) error + func (d Dict) ArrayEntry(key string) Array + func (d Dict) BooleanEntry(key string) *bool + func (d Dict) Clone() Object + func (d Dict) Delete(key string) (value Object) + func (d Dict) DictEntry(key string) Dict + func (d Dict) Entry(dictName, key string, required bool) (Object, error) + func (d Dict) Find(key string) (Object, bool) + func (d Dict) First() *int + func (d Dict) HexLiteralEntry(key string) *HexLiteral + func (d Dict) Index() Array + func (d Dict) IndirectRefEntry(key string) *IndirectRef + func (d Dict) Insert(k string, v Object) bool + func (d Dict) InsertBool(key string, value bool) + func (d Dict) InsertFloat(key string, value float32) + func (d Dict) InsertInt(key string, value int) + func (d Dict) InsertName(key, value string) + func (d Dict) InsertString(key, value string) + func (d Dict) Int64Entry(key string) *int64 + func (d Dict) IntEntry(key string) *int + func (d Dict) IsLinearizationParmDict() bool + func (d Dict) IsObjStm() bool + func (d Dict) Len() int + func (d Dict) Length() (*int64, *int) + func (d Dict) N() *int + func (d Dict) NameEntry(key string) *string + func (d Dict) NewIDForPrefix(prefix string, i int) string + func (d Dict) PDFString() string + func (d Dict) Prev() *int64 + func (d Dict) Size() *int + func (d Dict) StreamDictEntry(key string) *StreamDict + func (d Dict) String() string + func (d Dict) StringEntry(key string) *string + func (d Dict) StringEntryBytes(key string) ([]byte, error) + func (d Dict) StringLiteralEntry(key string) *StringLiteral + func (d Dict) StringOrHexLiteralEntry(key string) (*string, error) + func (d Dict) Subtype() *string + func (d Dict) Type() *string + func (d Dict) Update(key string, value Object) + func (d Dict) W() Array + type Dim struct + Height float64 + Width float64 + func ParsePageFormat(v string) (*Dim, string, error) + func (d Dim) AspectRatio() float64 + func (d Dim) ConvertToUnit(unit DisplayUnit) Dim + func (d Dim) Landscape() bool + func (d Dim) Portrait() bool + func (d Dim) String() string + func (d Dim) ToCentimetres() Dim + func (d Dim) ToInches() Dim + func (d Dim) ToMillimetres() Dim + type DisplayUnit int + const CENTIMETRES + const INCHES + const MILLIMETRES + const POINTS + type Float float64 + func (f Float) Clone() Object + func (f Float) PDFString() string + func (f Float) String() string + func (f Float) Value() float64 + type HAlignment int + const AlignCenter + const AlignJustify + const AlignLeft + const AlignRight + func ParseHorAlignment(s string) (HAlignment, error) + type HexLiteral string + func NewHexLiteral(b []byte) HexLiteral + func (hexliteral HexLiteral) Bytes() ([]byte, error) + func (hexliteral HexLiteral) Clone() Object + func (hexliteral HexLiteral) PDFString() string + func (hexliteral HexLiteral) String() string + func (hexliteral HexLiteral) Value() string + type IndirectRef struct + GenerationNumber Integer + ObjectNumber Integer + func NewIndirectRef(objectNumber, generationNumber int) *IndirectRef + func (ir IndirectRef) Clone() Object + func (ir IndirectRef) PDFString() string + func (ir IndirectRef) String() string + type IntSet map[int]bool + type Integer int + func (i Integer) Clone() Object + func (i Integer) PDFString() string + func (i Integer) String() string + func (i Integer) Value() int + type LineJoinStyle int + const LJBevel + const LJMiter + const LJRound + type Name string + func (nameObject Name) Clone() Object + func (nameObject Name) PDFString() string + func (nameObject Name) String() string + func (nameObject Name) Value() string + type Object interface + Clone func() Object + PDFString func() string + type ObjectStreamDict struct + FirstObjOffset int + ObjArray Array + ObjCount int + Prolog []byte + func NewObjectStreamDict() *ObjectStreamDict + func (osd *ObjectStreamDict) AddObject(objNumber int, pdfString string) error + func (osd *ObjectStreamDict) Finalize() + func (osd *ObjectStreamDict) IndexedObject(index int) (Object, error) + type Orientation int + const Horizontal + const Vertical + type PDFFilter struct + DecodeParms Dict + Name string + type Point struct + X float64 + Y float64 + func (p *Point) Translate(dx, dy float64) + func (p Point) String() string + type QuadLiteral struct + P1 Point + P2 Point + P3 Point + P4 Point + func (ql QuadLiteral) Array() Array + func (ql QuadLiteral) EnclosingRectangle(f float64) *Rectangle + type QuadPoints []QuadLiteral + func (qp *QuadPoints) AddQuadLiteral(ql QuadLiteral) + func (qp *QuadPoints) Array() Array + type Rectangle struct + LL Point + UR Point + func NewRectangle(llx, lly, urx, ury float64) *Rectangle + func RectForDim(width, height float64) *Rectangle + func RectForFormat(f string) *Rectangle + func RectForWidthAndHeight(llx, lly, width, height float64) *Rectangle + func (r *Rectangle) Translate(dx, dy float64) + func (r Rectangle) Array() Array + func (r Rectangle) AspectRatio() float64 + func (r Rectangle) Center() Point + func (r Rectangle) Clone() *Rectangle + func (r Rectangle) Contains(p Point) bool + func (r Rectangle) CroppedCopy(margin float64) *Rectangle + func (r Rectangle) Dimensions() Dim + func (r Rectangle) Equals(r2 Rectangle) bool + func (r Rectangle) FitsWithin(r2 *Rectangle) bool + func (r Rectangle) Format(unit DisplayUnit) string + func (r Rectangle) Height() float64 + func (r Rectangle) Landscape() bool + func (r Rectangle) Portrait() bool + func (r Rectangle) ScaledHeight(w float64) float64 + func (r Rectangle) ScaledWidth(h float64) float64 + func (r Rectangle) ShortString() string + func (r Rectangle) String() string + func (r Rectangle) Width() float64 + type RelPosition int + const RelPosBottom + const RelPosLeft + const RelPosRight + const RelPosTop + func ParseRelPosition(s string) (RelPosition, error) + type StreamDict struct + CSComponents int + Content []byte + FilterPipeline []PDFFilter + IsPageContent bool + Raw []byte + StreamLength *int64 + StreamLengthObjNr *int + StreamOffset int64 + func NewStreamDict(d Dict, streamOffset int64, streamLength *int64, streamLengthObjNr *int, ...) StreamDict + func (sd *StreamDict) Decode() error + func (sd *StreamDict) Encode() error + func (sd StreamDict) Clone() Object + func (sd StreamDict) HasSoleFilterNamed(filterName string) bool + func (sd StreamDict) Image() bool + type StringLiteral string + func (stringliteral StringLiteral) Clone() Object + func (stringliteral StringLiteral) PDFString() string + func (stringliteral StringLiteral) String() string + func (stringliteral StringLiteral) Value() string + type StringSet map[string]bool + func NewStringSet(slice []string) StringSet + type VAlignment int + const AlignBaseline + const AlignBottom + const AlignMiddle + const AlignTop + type XRefStreamDict struct + Objects []int + PreviousOffset *int64 + Size int + W [3]int