Versions in this module Expand all Collapse all v0 v0.0.1 Jun 5, 2026 Changes in this version + const Version + var ErrCorrupted = errors.New("gxpdf: PDF file is corrupted") + var ErrEncrypted = errors.New("gxpdf: PDF is encrypted") + var ErrInvalidPDF = errors.New("gxpdf: invalid PDF file") + var ErrNoTables = errors.New("gxpdf: no tables found") + var ErrPageNotFound = errors.New("gxpdf: page not found") + var ErrPasswordRequired = security.ErrPasswordRequired + var ErrUnsupportedFeature = errors.New("gxpdf: unsupported PDF feature") + var ErrWrongPassword = errors.New("gxpdf: wrong password") + func IsCorrupted(err error) bool + func IsEncrypted(err error) bool + func VerbCoordCount(v PathVerb) int + type Document struct + func MustOpen(path string) *Document + func Open(path string) (*Document, error) + func OpenFromBytes(data []byte) (*Document, error) + func OpenFromBytesWithContext(ctx context.Context, data []byte) (*Document, error) + func OpenFromBytesWithPassword(data []byte, password string) (*Document, error) + func OpenFromBytesWithPasswordAndContext(ctx context.Context, data []byte, password string) (*Document, error) + func OpenWithContext(ctx context.Context, path string) (*Document, error) + func OpenWithPassword(path, password string) (*Document, error) + func OpenWithPasswordAndContext(ctx context.Context, path, password string) (*Document, error) + func (d *Document) Author() string + func (d *Document) Close() error + func (d *Document) Creator() string + func (d *Document) ExtractTables() []*Table + func (d *Document) ExtractTablesFromPage(pageNum int) []*Table + func (d *Document) ExtractTablesWithOptions(opts *ExtractionOptions) ([]*Table, error) + func (d *Document) ExtractTextElementsFromPage(pageNum int) ([]TextElement, error) + func (d *Document) ExtractTextFromPage(pageNum int) (string, error) + func (d *Document) GetEmbeddedFonts() ([]EmbeddedFont, error) + func (d *Document) GetEmbeddedFontsForPage(pageNum int) ([]EmbeddedFont, error) + func (d *Document) GetFieldValue(name string) (interface{}, error) + func (d *Document) GetFormFields() ([]*FormField, error) + func (d *Document) GetImages() []*Image + func (d *Document) GetImagesWithError() ([]*Image, error) + func (d *Document) GetVectorGraphics() []*VectorPath + func (d *Document) GetVectorGraphicsForPage(pageNum int) ([]*VectorPath, error) + func (d *Document) GetVectorGraphicsWithError() ([]*VectorPath, error) + func (d *Document) HasForm() bool + func (d *Document) Info() *DocumentInfo + func (d *Document) IsEncrypted() bool + func (d *Document) Keywords() string + func (d *Document) Page(index int) *Page + func (d *Document) PageCount() int + func (d *Document) Pages() []*Page + func (d *Document) Path() string + func (d *Document) Producer() string + func (d *Document) Subject() string + func (d *Document) Title() string + func (d *Document) Version() string + type DocumentInfo struct + Author string + Creator string + Encrypted bool + Keywords string + PageCount int + Path string + Producer string + Subject string + Title string + Version string + type EmbeddedFont struct + Data []byte + Encoding string + Name string + Subtype string + type ExtractionMethod int + const MethodAuto + const MethodHybrid + const MethodLattice + const MethodStream + func (m ExtractionMethod) String() string + type ExtractionOptions struct + MergeMultilineRows bool + Method ExtractionMethod + MinColumnWidth float64 + MinRowHeight float64 + Pages []int + func DefaultExtractionOptions() *ExtractionOptions + func (o *ExtractionOptions) WithMergeMultilineRows(merge bool) *ExtractionOptions + func (o *ExtractionOptions) WithMethod(method ExtractionMethod) *ExtractionOptions + func (o *ExtractionOptions) WithPages(pages ...int) *ExtractionOptions + type FormField struct + func (f *FormField) DefaultValue() interface{} + func (f *FormField) Flags() int + func (f *FormField) IsButton() bool + func (f *FormField) IsChoice() bool + func (f *FormField) IsReadOnly() bool + func (f *FormField) IsRequired() bool + func (f *FormField) IsTextField() bool + func (f *FormField) Name() string + func (f *FormField) Options() []string + func (f *FormField) Rect() [4]float64 + func (f *FormField) Type() string + func (f *FormField) Value() interface{} + type Image struct + func (img *Image) BitsPerComponent() int + func (img *Image) ColorSpace() string + func (img *Image) Filter() string + func (img *Image) Height() int + func (img *Image) Name() string + func (img *Image) SaveToFile(path string) error + func (img *Image) String() string + func (img *Image) ToGoImage() (image.Image, error) + func (img *Image) Width() int + type Page struct + func (p *Page) ExtractTables() []*Table + func (p *Page) ExtractTablesWithOptions(opts *ExtractionOptions) ([]*Table, error) + func (p *Page) ExtractText() string + func (p *Page) ExtractTextElements() ([]TextElement, error) + func (p *Page) GetImages() []*Image + func (p *Page) GetImagesWithError() ([]*Image, error) + func (p *Page) Index() int + func (p *Page) Number() int + type PaintMode int + const PaintModeFill + const PaintModeFillStroke + const PaintModeStroke + func (pm PaintMode) String() string + type PathVerb int + const PathVerbClose + const PathVerbCubicTo + const PathVerbLineTo + const PathVerbMoveTo + const PathVerbQuadTo + func (v PathVerb) String() string + type Table struct + func (t *Table) Cell(row, col int) string + func (t *Table) ColumnCount() int + func (t *Table) ExportCSV(w io.Writer) error + func (t *Table) ExportExcel(w io.Writer) error + func (t *Table) ExportJSON(w io.Writer) error + func (t *Table) Internal() *internaltable.Table + func (t *Table) IsEmpty() bool + func (t *Table) Method() string + func (t *Table) PageNumber() int + func (t *Table) RowCount() int + func (t *Table) Rows() [][]string + func (t *Table) String() string + func (t *Table) ToCSV() (string, error) + func (t *Table) ToJSON() (string, error) + type TextElement struct + FontName string + FontSize float64 + Height float64 + Text string + Width float64 + X float64 + Y float64 + type VectorPath struct + Coords []float64 + FillColor [4]float64 + LineCap int + LineJoin int + LineWidth float64 + MiterLimit float64 + Opacity float64 + PageNum int + PaintMode PaintMode + StrokeColor [4]float64 + Verbs []PathVerb + func (vp *VectorPath) String() string