Documentation
¶
Overview ¶
Package pdftext extracts the text layer of a pdf, decoding composite font strings through each font's ToUnicode map
It exists because uploads are validated locally before any model call, and pdfcpu parses a pdf without extracting text. Reading the string operands directly is not enough: a report exported from Word uses subset fonts with Identity-H encoding, so its content streams carry two byte glyph ids rather than characters, and only the font's ToUnicode map turns those back into text
Index ¶
Constants ¶
const ContentType = "application/pdf"
ContentType is the mime type of a pdf
Variables ¶
This section is empty.
Functions ¶
func IsContentType ¶
IsContentType reports whether a mime or content type is a pdf, ignoring parameters and case
Types ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document is an opened pdf with its page count and per-page text extraction
func Open ¶
Open reads and validates the pdf once so page counting and text extraction share the parse