Documentation ¶
Index ¶
- Constants
- Variables
- func ASCII85Decode(data []byte) []byte
- func ASCIIHexDecode(data []byte) []byte
- func BytesToInt(b []byte) int
- func Debug(format string, a ...interface{})
- func DecodeStream(filter string, data []byte, decode_parms Dictionary) []byte
- func FlateDecode(data []byte, decode_parms Dictionary) []byte
- func GetBits(d []byte, p int, n int) uint32
- func IsHex(b byte) bool
- func LZWDecode(data []byte, decode_parms Dictionary) []byte
- func Parse(file_path string, password string, output_dir string) error
- func ReadInt(reader io.Reader, width int) (int, bool)
- func ReadInt64(reader io.Reader, width int) (int64, bool)
- func ReversePredictor(data []byte, decode_parms Dictionary) []byte
- func RunLengthDecode(data []byte) []byte
- func SetBits(d []byte, p int, n int, v uint32)
- type Action
- type Array
- func (a Array) GetArray(index int) (Array, bool)
- func (a Array) GetBool(index int) (bool, bool)
- func (a Array) GetBytes(index int) ([]byte, bool)
- func (a Array) GetDictionary(index int) (Dictionary, bool)
- func (a Array) GetInt(index int) (int, bool)
- func (a Array) GetInt64(index int) (int64, bool)
- func (a Array) GetName(index int) (string, bool)
- func (a Array) GetNumber(index int) (Number, bool)
- func (a Array) GetObject(index int) (Object, bool)
- func (a Array) GetStream(index int) ([]byte, bool)
- func (a Array) GetString(index int) (string, bool)
- func (a Array) String() string
- type CryptFilter
- type CryptFilterAES
- type CryptFilterNone
- type CryptFilterRC4
- type Decryptor
- type DecryptorAES
- type DecryptorNone
- type DecryptorRC4
- type Dictionary
- func (d Dictionary) GetArray(key string) (Array, bool)
- func (d Dictionary) GetBool(key string) (bool, bool)
- func (d Dictionary) GetBytes(key string) ([]byte, bool)
- func (d Dictionary) GetDictionary(key string) (Dictionary, bool)
- func (d Dictionary) GetInt(key string) (int, bool)
- func (d Dictionary) GetInt64(key string) (int64, bool)
- func (d Dictionary) GetName(key string) (string, bool)
- func (d Dictionary) GetNameTreeMap(key string) Array
- func (d Dictionary) GetNumber(key string) (Number, bool)
- func (d Dictionary) GetObject(key string) (Object, bool)
- func (d Dictionary) GetPageTree(key string) ([]Dictionary, bool)
- func (d Dictionary) GetReference(key string) (*Reference, bool)
- func (d Dictionary) GetStream(key string) ([]byte, bool)
- func (d Dictionary) GetString(key string) (string, bool)
- func (d Dictionary) ResolveKids(resolved_kids map[int]interface{}) []Dictionary
- func (d Dictionary) String() string
- type File
- type Font
- type IndirectObject
- type Keyword
- type Name
- type Number
- type Object
- type Output
- type Page
- type Parser
- func (parser *Parser) CurrentOffset() int64
- func (parser *Parser) GetObject(number int) *IndirectObject
- func (parser *Parser) Load(password string) error
- func (parser *Parser) ReadArray(decryptor Decryptor) Array
- func (parser *Parser) ReadCommand() (Keyword, Array, error)
- func (parser *Parser) ReadDictionary(decryptor Decryptor) Dictionary
- func (parser *Parser) ReadHexString(decryptor Decryptor) String
- func (parser *Parser) ReadInt() (int, bool)
- func (parser *Parser) ReadInt64() (int64, bool)
- func (parser *Parser) ReadKeyword() Keyword
- func (parser *Parser) ReadName() Name
- func (parser *Parser) ReadNumber() Number
- func (parser *Parser) ReadObject(decryptor Decryptor) (Object, error)
- func (parser *Parser) ReadObjectHeader() (int, int, bool)
- func (parser *Parser) ReadStream(decryptor Decryptor, filter_list Array, decode_parms_list Array) []byte
- func (parser *Parser) ReadString(decryptor Decryptor) String
- func (parser *Parser) Seek(offset int64, whence int) (int64, error)
- func (parser *Parser) SetPassword(password string) error
- type Reference
- type SecurityHandler
- type String
- type XrefEntry
Constants ¶
View Source
const ( KEYWORD_XREF = Keyword("xref") KEYWORD_TRAILER = Keyword("trailer") KEYWORD_OBJ = Keyword("obj") KEYWORD_STREAM = Keyword("stream") KEYWORD_R = Keyword("R") KEYWORD_N = Keyword("n") KEYWORD_NULL = Keyword("null") KEYWORD_TRUE = Keyword("true") KEYWORD_FALSE = Keyword("false") KEYWORD_TEXT = Keyword("BT") KEYWORD_TEXT_END = Keyword("ET") KEYWORD_TEXT_FONT = Keyword("Tf") KEYWORD_TEXT_MOVE_1 = Keyword("T*") KEYWORD_TEXT_MOVE_2 = Keyword("Td") KEYWORD_TEXT_MOVE_3 = Keyword("TD") KEYWORD_TEXT_POSITION = Keyword("TJ") KEYWORD_TEXT_SHOW_1 = Keyword("Tj") KEYWORD_TEXT_SHOW_2 = Keyword("'") KEYWORD_TEXT_SHOW_3 = Keyword("\"") KEYWORD_BEGIN_BF_RANGE = Keyword("beginbfrange") KEYWORD_BEGIN_BF_CHAR = Keyword("beginbfchar") )
View Source
const ( XrefTypeFreeObject = iota XrefTypeIndirectObject XrefTypeCompressedObject )
Variables ¶
View Source
var EncryptionError = errors.New("missing required encryption info")
errors
View Source
var EncryptionPasswordError = errors.New("incorrect password")
View Source
var EncryptionUnsupported = errors.New("unsupported encryption")
View Source
var EndOfArray = errors.New("end of array")
View Source
var EndOfDictionary = errors.New("end of dictionary")
View Source
var EndOfHexString = errors.New("end of hex string")
View Source
var EndOfString = errors.New("end of string")
View Source
var InvalidDictionaryKeyType = "invalid dictionary key type"
format errors and abnormalities
View Source
var InvalidHexStringChar = "invalid hex string character"
View Source
var InvalidNameEscapeChar = "invalid name escape character"
View Source
var InvalidOctal = "invalid octal in string"
View Source
var MissingDictionaryValue = "missing dictionary value"
View Source
var ReadError = errors.New("read failed")
View Source
var UnclosedArray = "unclosed array"
View Source
var UnclosedDictionary = "unclosed dictionary"
View Source
var UnclosedHexString = "unclosed hex string"
View Source
var UnclosedStream = "unclosed stream"
View Source
var UnclosedString = "unclosed string"
View Source
var UnclosedStringEscape = "unclosed escape in string"
View Source
var UnclosedStringOctal = "unclosed octal in string"
View Source
var UnnecessaryEscapeName = "unnecessary espace sequence in name"
View Source
var UnnecessaryEscapeString = "unnecessary espace sequence in string"
View Source
var Verbose *bool
Functions ¶
func ASCII85Decode ¶
func ASCIIHexDecode ¶
func BytesToInt ¶
func DecodeStream ¶
func DecodeStream(filter string, data []byte, decode_parms Dictionary) []byte
func FlateDecode ¶
func FlateDecode(data []byte, decode_parms Dictionary) []byte
func LZWDecode ¶
func LZWDecode(data []byte, decode_parms Dictionary) []byte
func ReversePredictor ¶
func ReversePredictor(data []byte, decode_parms Dictionary) []byte
func RunLengthDecode ¶
Types ¶
type Action ¶
type Action Dictionary
type Array ¶
type Array []Object
func (Array) GetDictionary ¶
func (a Array) GetDictionary(index int) (Dictionary, bool)
type CryptFilter ¶
type CryptFilterAES ¶
type CryptFilterAES struct {
// contains filtered or unexported fields
}
AES
func (*CryptFilterAES) NewDecryptor ¶
func (c *CryptFilterAES) NewDecryptor(n int, g int) Decryptor
type CryptFilterNone ¶
type CryptFilterNone struct{}
No encryption
func (*CryptFilterNone) NewDecryptor ¶
func (c *CryptFilterNone) NewDecryptor(n int, g int) Decryptor
type CryptFilterRC4 ¶
type CryptFilterRC4 struct {
// contains filtered or unexported fields
}
RC4
func (*CryptFilterRC4) NewDecryptor ¶
func (c *CryptFilterRC4) NewDecryptor(n int, g int) Decryptor
type DecryptorAES ¶
type DecryptorAES struct {
// contains filtered or unexported fields
}
func (*DecryptorAES) Decrypt ¶
func (d *DecryptorAES) Decrypt(data []byte)
type DecryptorNone ¶
type DecryptorNone struct{}
func (*DecryptorNone) Decrypt ¶
func (d *DecryptorNone) Decrypt(data []byte)
type DecryptorRC4 ¶
type DecryptorRC4 struct {
// contains filtered or unexported fields
}
func (*DecryptorRC4) Decrypt ¶
func (d *DecryptorRC4) Decrypt(data []byte)
type Dictionary ¶
func (Dictionary) GetDictionary ¶
func (d Dictionary) GetDictionary(key string) (Dictionary, bool)
func (Dictionary) GetNameTreeMap ¶
func (d Dictionary) GetNameTreeMap(key string) Array
func (Dictionary) GetPageTree ¶
func (d Dictionary) GetPageTree(key string) ([]Dictionary, bool)
func (Dictionary) GetReference ¶
func (d Dictionary) GetReference(key string) (*Reference, bool)
func (Dictionary) ResolveKids ¶
func (d Dictionary) ResolveKids(resolved_kids map[int]interface{}) []Dictionary
func (Dictionary) String ¶
func (d Dictionary) String() string
type File ¶
type File Dictionary
type IndirectObject ¶
func NewIndirectObject ¶
func NewIndirectObject(number int) *IndirectObject
func (*IndirectObject) Extract ¶
func (object *IndirectObject) Extract(output *Output)
func (*IndirectObject) String ¶
func (object *IndirectObject) String() string
type Output ¶
type Parser ¶
type Parser struct { *bufio.Reader Xref map[int]*XrefEntry // contains filtered or unexported fields }
func (*Parser) CurrentOffset ¶
func (*Parser) GetObject ¶
func (parser *Parser) GetObject(number int) *IndirectObject
func (*Parser) ReadDictionary ¶
func (parser *Parser) ReadDictionary(decryptor Decryptor) Dictionary
func (*Parser) ReadHexString ¶
func (*Parser) ReadKeyword ¶
func (*Parser) ReadNumber ¶
func (*Parser) ReadObjectHeader ¶
ReadObjectHeader reads an object header (10 0 obj) from the current position and returns the object number and generation
func (*Parser) ReadStream ¶
func (*Parser) ReadString ¶
func (*Parser) SetPassword ¶
type Reference ¶
func (*Reference) ResolveStream ¶
type SecurityHandler ¶
type SecurityHandler struct {
// contains filtered or unexported fields
}
func NewSecurityHandler ¶
func NewSecurityHandler() *SecurityHandler
func (*SecurityHandler) Init ¶
func (sh *SecurityHandler) Init(password []byte, trailer Dictionary) error
Click to show internal directories.
Click to hide internal directories.