Documentation
¶
Overview ¶
Package reader provides application-layer PDF reading functionality.
This package wraps the infrastructure-layer parser to provide a clean application-layer API for PDF document reading.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PdfReader ¶
type PdfReader struct {
// contains filtered or unexported fields
}
PdfReader is an application-layer wrapper around the infrastructure parser.Reader.
It provides a clean separation between infrastructure (low-level parsing) and application concerns (document structure navigation).
func NewPdfReader ¶
NewPdfReader creates a new PDF reader from a file path.
The file is opened and parsed immediately. Remember to call Close() when done to release resources.
Example:
reader, err := reader.NewPdfReader("document.pdf")
if err != nil {
log.Fatal(err)
}
defer reader.Close()
func NewPdfReaderWithPassword ¶ added in v0.6.0
NewPdfReaderWithPassword creates a new PDF reader from a password-protected file.
Use this for encrypted PDFs that require a non-empty password. For PDFs with empty user password, NewPdfReader handles them transparently.
func (*PdfReader) GetPage ¶
func (r *PdfReader) GetPage(pageIndex int) (*parser.Dictionary, error)
GetPage returns the page dictionary for the specified page index (0-based).
func (*PdfReader) GetParserReader ¶
GetParserReader returns the underlying parser.Reader for advanced operations.
This is used internally by extractors that need direct access to the parser. Most users should not need this method - use the higher-level methods instead.