pdffile

package
v1.0.102 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultVersion = 1.4

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Version float64
	Root    types.Reference
	Info    types.Reference
	ID      [2]types.String
	// contains filtered or unexported fields
}

File is the most basic representation of a pdf file: a list of indirect objects

func NewFile

func NewFile() *File

NewFile creates a new File object

func (*File) AddIndirectObject added in v1.0.15

func (q *File) AddIndirectObject(obj types.IndirectObject)

AddIndirectObject adds an indirect object (only used by pdf parser)

func (*File) AddObject

func (q *File) AddObject(obj types.Object) types.Reference

AddObject adds an object to the file and returns its reference

func (*File) GetObject added in v1.0.5

func (q *File) GetObject(ref types.Reference) (types.Object, error)

GetObject returns an object from the file

func (*File) GetObjects added in v1.0.79

func (q *File) GetObjects() []types.IndirectObject

GetObjects returns all objects

func (*File) ResolveReference added in v1.0.68

func (q *File) ResolveReference(v types.Object) (types.Object, error)

ResolveReference returns v if it is not a reference, or the referenced object if it is a reference

func (*File) WriteTo

func (q *File) WriteTo(w io.Writer) (int64, error)

WriteTo writes the parsed to the given writer

type Update

type Update struct {
	Objects []types.RawIndirectObject

	Trailer types.Trailer
	// contains filtered or unexported fields
}

Update is one generation of a PDF file. A pdf file can be modified by added updates to the file.

type XRefTable

type XRefTable []XRefTableSection

XRefTable is the cross-reference table consisting of several XRefTableSections

func (*XRefTable) ToRawBytes

func (q *XRefTable) ToRawBytes() []byte

type XRefTableEntry

type XRefTableEntry struct {
	Start                       int64
	Generation                  int
	Free                        bool
	StoredInCompressStreamNo    int
	StoredInCompressStreamIndex int
}

XRefTableEntry is one entry in a XRefTableSection

func (*XRefTableEntry) ToRawBytes

func (q *XRefTableEntry) ToRawBytes() []byte

type XRefTableSection

type XRefTableSection struct {
	Start   int
	Count   int
	Entries []XRefTableEntry
}

XRefTableSection is a section of a xref-table

func (*XRefTableSection) ToRawBytes

func (q *XRefTableSection) ToRawBytes() []byte

Jump to

Keyboard shortcuts

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