Versions in this module Expand all Collapse all v0 v0.1.0 Aug 1, 2026 Changes in this version + func DefaultSRGBProfile() []byte + func DocumentEqual(a, b *Document) bool + func EmbedFacturX(doc *Document, invoiceXML []byte, profile formalis.Profile, title string) error + func Equal(a, b Object) bool + func GenerateXMPMetadata(level PDFALevel, title, author string) []byte + func IsCheckerFinding(v Violation) bool + type Array []Object + type Boolean bool + func (b Boolean) String() string + type DPartViolation struct + Message string + Object int + Rule string + func ValidateDParts(doc *Document) []DPartViolation + func ValidateDPartsContext(ctx context.Context, doc *Document) []DPartViolation + func (v DPartViolation) Error() string + func (v DPartViolation) ObjectNum() int + func (v DPartViolation) RuleID() string + type Dictionary struct + Keys []Name + Values []Object + func (d *Dictionary) Clone() *Dictionary + func (d *Dictionary) Delete(key Name) bool + func (d *Dictionary) Get(key Name) Object + func (d *Dictionary) Len() int + func (d *Dictionary) Set(key Name, value Object) + type Document struct + Encrypted bool + Objects map[int]*IndirectObject + Offsets map[int]int64 + Trailer Dictionary + Version string + func NewPDFADocument(level PDFALevel) *Document + func NewPDFADocumentWithInfo(level PDFALevel, title, author string) *Document + func Read(r io.ReaderAt, size int64, opts ...Option) (*Document, error) + func ReadContext(ctx context.Context, r io.ReaderAt, size int64, opts ...Option) (*Document, error) + func ReadWithPassword(r io.ReaderAt, size int64, password string, opts ...Option) (*Document, error) + func ReadWithPasswordContext(ctx context.Context, r io.ReaderAt, size int64, password string, ...) (*Document, error) + func (d *Document) AppendPages(other *Document) + func (d *Document) DSSCerts() []*x509.Certificate + func (d *Document) DSSRevocationMaterial() (crls, ocsps [][]byte) + func (d *Document) ExtractImages() []ExtractedImage + func (d *Document) ExtractImagesContext(ctx context.Context) ([]ExtractedImage, error) + func (d *Document) ExtractPageText(page *Dictionary) string + func (d *Document) ExtractPages(indices []int) (*Document, error) + func (d *Document) ExtractText() string + func (d *Document) ExtractTextContext(ctx context.Context) (string, error) + func (d *Document) Images() iter.Seq[ExtractedImage] + func (d *Document) Locked() bool + func (d *Document) PageCount() int + func (d *Document) PageList() []*Dictionary + func (d *Document) RemoveEncryption() + func (d *Document) Repair(level PDFALevel) []RepairAction + func (d *Document) Resolve(obj Object) Object + func (d *Document) ResolveDict(obj Object) *Dictionary + func (d *Document) SetEncryption(userPassword, ownerPassword string) error + func (d *Document) ValidatePAdES(raw []byte) []PAdESResult + func (d *Document) VerifySignatures(raw []byte) []SignatureResult + func (d *Document) VerifySignaturesWithRoots(raw []byte, roots *x509.CertPool) []SignatureResult + func (d *Document) Write(w io.Writer) error + func (d *Document) WriteArchivalTimestamp(w io.Writer, original []byte, certs []*x509.Certificate, ...) error + func (d *Document) WriteContext(ctx context.Context, w io.Writer) error + func (d *Document) WriteIncremental(w io.Writer, original []byte, changed []int) error + func (d *Document) WriteSigned(w io.Writer, cert *x509.Certificate, key crypto.Signer) error + func (d *Document) WriteSignedIncremental(w io.Writer, original []byte, cert *x509.Certificate, key crypto.Signer) error + func (d *Document) WriteSignedTimestamped(w io.Writer, cert *x509.Certificate, key crypto.Signer, ...) error + type ExtractedImage struct + BitsPerComponent int + ColorSpace string + Decoded bool + Encoded []byte + Filter string + Height int + Image image.Image + Note string + ObjNum int + Width int + type FacturXResult struct + CIUS formalis.CIUS + InvoiceComplete bool + InvoiceNotEvaluated []formalis.RuleFamily + InvoiceWarnings []FacturXViolation + Profile formalis.Profile + Violations []FacturXViolation + XML []byte + XMLName string + func ValidateFacturX(doc *Document, rawData []byte) FacturXResult + func ValidateFacturXContext(ctx context.Context, doc *Document, rawData []byte) (res FacturXResult) + type FacturXViolation struct + Message string + Object int + Rule string + Source formalis.Source + func (v FacturXViolation) Error() string + func (v FacturXViolation) ObjectNum() int + func (v FacturXViolation) RuleID() string + type IndirectObject struct + Generation int + Number int + Value Object + func (obj IndirectObject) String() string + type IndirectRef struct + Generation int + Number int + func (ref IndirectRef) String() string + type Integer int64 + func (i Integer) String() string + type Lexer struct + func NewLexer(data []byte) *Lexer + func NewLexerFromReaderAt(r io.ReaderAt, size int64) (*Lexer, error) + func (l *Lexer) Data() []byte + func (l *Lexer) NextToken() (Token, error) + func (l *Lexer) Position() int64 + func (l *Lexer) SetPosition(offset int64) + type Name string + func (n Name) String() string + type Null struct + func (n Null) String() string + type Object interface + type Option interface + func WithMaxCIDRangeSpan(n int) Option + func WithMaxCmapWork(n int) Option + func WithMaxContentStreamBytes(n int) Option + func WithMaxDecodedContentBytes(n int64) Option + func WithMaxDecodedStreamBytes(n int) Option + func WithMaxICCProfileBytes(n int) Option + func WithMaxObjectStreamBytes(n int64) Option + func WithMaxPostScriptSteps(n int) Option + func WithMaxRoleMapSteps(n int) Option + func WithMaxTableGridFills(n int64) Option + func WithMaxXMPPacketBytes(n int) Option + type OrderXProfile string + const OrderXBasic + const OrderXComfort + const OrderXExtended + type OrderXResult struct + OrderComplete bool + OrderNotEvaluated []formalis.RuleFamily + OrderWarnings []OrderXViolation + Profile OrderXProfile + Violations []OrderXViolation + XML []byte + XMLName string + func ValidateOrderX(doc *Document, rawData []byte) OrderXResult + func ValidateOrderXContext(ctx context.Context, doc *Document, rawData []byte) (res OrderXResult) + type OrderXViolation struct + Message string + Object int + Rule string + Source formalis.Source + func (v OrderXViolation) Error() string + func (v OrderXViolation) ObjectNum() int + func (v OrderXViolation) RuleID() string + type PAdESLevel string + const PAdESBB + const PAdESBLT + const PAdESBLTA + const PAdESBT + const PAdESNone + type PAdESResult struct + Conformant bool + CoversDocument bool + Field string + IsPAdES bool + Issues []string + Level PAdESLevel + SignerCommonName string + SubFilter string + TimestampTime time.Time + TimestampValid bool + Valid bool + type PDFALevel int + const PDFA1a + const PDFA1b + const PDFA2a + const PDFA2b + const PDFA3a + const PDFA3b + const PDFA4 + func (l PDFALevel) String() string + type PDFRViolation struct + Message string + Object int + Rule string + func ValidatePDFR(d *Document) []PDFRViolation + func ValidatePDFRContext(ctx context.Context, d *Document) []PDFRViolation + func (v PDFRViolation) Error() string + func (v PDFRViolation) ObjectNum() int + func (v PDFRViolation) RuleID() string + type PDFVTViolation struct + Message string + Object int + Rule string + func ValidatePDFVT(doc *Document) []PDFVTViolation + func ValidatePDFVT2(doc *Document) []PDFVTViolation + func ValidatePDFVT2Context(ctx context.Context, doc *Document) []PDFVTViolation + func ValidatePDFVTContext(ctx context.Context, doc *Document) []PDFVTViolation + func (v PDFVTViolation) Error() string + func (v PDFVTViolation) ObjectNum() int + func (v PDFVTViolation) RuleID() string + type PDFXLevel int + const PDFX1a + const PDFX3 + const PDFX4 + const PDFX4p + const PDFX6 + func (l PDFXLevel) String() string + type PDFXViolation struct + Message string + Object int + Rule string + func ValidatePDFX(doc *Document, level PDFXLevel) []PDFXViolation + func ValidatePDFXContext(ctx context.Context, doc *Document, level PDFXLevel) []PDFXViolation + func (v PDFXViolation) Error() string + func (v PDFXViolation) ObjectNum() int + func (v PDFXViolation) RuleID() string + type Parser struct + func NewParser(data []byte) *Parser + func NewParserFromLexer(lexer *Lexer) *Parser + func (p *Parser) Lexer() *Lexer + func (p *Parser) ParseIndirectObject() (*IndirectObject, error) + func (p *Parser) ParseObject() (Object, error) + type Real float64 + func (r Real) String() string + type RepairAction struct + Description string + type RevocationInfo struct + RevokedAt time.Time + Source string + Status RevocationStatus + func CheckCertRevocation(cert, issuer *x509.Certificate, crls, ocsps [][]byte) RevocationInfo + type RevocationStatus int + const RevocationGood + const RevocationRevoked + const RevocationUnknown + func (s RevocationStatus) String() string + type Serializer struct + func NewSerializer(w io.Writer) *Serializer + func (s *Serializer) Offset() int64 + func (s *Serializer) WriteIndirectObject(obj *IndirectObject) error + func (s *Serializer) WriteObject(obj Object) error + type SignatureResult struct + ChainErr error + CoversWholeDocument bool + Err error + Field string + Revocation RevocationInfo + SignerCommonName string + SigningTime time.Time + TrustedChain bool + Valid bool + func (r SignatureResult) DocumentUnmodified() bool + type Stream struct + Data []byte + Dict Dictionary + type String struct + IsHex bool + Value []byte + func (s String) String() string + type Token struct + Offset int64 + Type TokenType + Value []byte + func (t Token) String() string + type TokenType int + const TokenArrayEnd + const TokenArrayStart + const TokenBoolean + const TokenDictEnd + const TokenDictStart + const TokenEOF + const TokenEndObj + const TokenEndStream + const TokenInteger + const TokenName + const TokenNull + const TokenObj + const TokenReal + const TokenRef + const TokenStartXref + const TokenStream + const TokenString + const TokenTrailer + const TokenXref + func (t TokenType) String() string + type UAViolation struct + Clause string + Message string + Object int + func ValidatePDFUA(doc *Document) []UAViolation + func ValidatePDFUA2(d *Document) []UAViolation + func ValidatePDFUA2Context(ctx context.Context, d *Document) []UAViolation + func ValidatePDFUAContext(ctx context.Context, doc *Document) []UAViolation + func (v UAViolation) Error() string + func (v UAViolation) ObjectNum() int + func (v UAViolation) RuleID() string + type ValidationError struct + Level PDFALevel + Message string + Object int + Rule string + func ValidatePDFA(doc *Document, level PDFALevel) []ValidationError + func ValidatePDFABytes(doc *Document, level PDFALevel, rawData []byte) []ValidationError + func ValidatePDFABytesContext(ctx context.Context, doc *Document, level PDFALevel, rawData []byte) []ValidationError + func ValidatePDFAContext(ctx context.Context, doc *Document, level PDFALevel) []ValidationError + func (e ValidationError) Error() string + func (e ValidationError) ObjectNum() int + func (e ValidationError) RuleID() string + type Violation interface + ObjectNum func() int + RuleID func() string + type XRefEntry struct + Compressed bool + Free bool + Generation int + IndexInStream int + Offset int64 + StreamObjNum int + type XRefTable struct + Entries map[int]XRefEntry + func ParseXRefStream(stream *Stream, opts ...Option) (*XRefTable, error) + func ParseXRefTable(data []byte, pos int64) (*XRefTable, error)