Documentation
¶
Overview ¶
Package pdf holds the rules about PDF bytes. It is the lowest stratum: it imports only the standard library, so the engine boundary and every embedding application can ask the same question and get the same answer.
Index ¶
Constants ¶
const TrailerWindow = 1024
TrailerWindow is how far from the end %%EOF may sit. The PDF specification allows at most 1024 bytes after it.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Defect ¶
type Defect string
Defect names why a byte sequence is not a finished PDF. The set is closed.
const ( // DefectNone means the bytes are a finished PDF. DefectNone Defect = "" // DefectEmpty means there are no bytes at all. DefectEmpty Defect = "empty" // DefectMissingHeader means the bytes do not start with %PDF-. DefectMissingHeader Defect = "missing %PDF- header" // DefectMissingTrailer means the writer stopped before %%EOF: a compiler // that died, or a file read while it was still being written. DefectMissingTrailer Defect = "missing %%EOF trailer" )
type IncompleteError ¶
IncompleteError refuses a PDF that has a defect. Callers match it with errors.As to tell an unfinished document from other failures.
func (*IncompleteError) Error ¶
func (e *IncompleteError) Error() string