Documentation
¶
Overview ¶
Package pdfenhancer provides PDF manipulation and OCR text layer addition.
Index ¶
- type Config
- type PDFEnhancer
- func (pe *PDFEnhancer) AddTextLayer(inputPath, outputPath string, ocrResults *ocr.DocumentOCR) error
- func (pe *PDFEnhancer) CompareCoordinateSystems(pageHeight int) string
- func (pe *PDFEnhancer) ExtractPageInfo(pdfPath string, pageNum int) (*PageInfo, error)
- func (pe *PDFEnhancer) GetPDFInfo(pdfPath string) (*PDFInfo, error)
- func (pe *PDFEnhancer) GetPageCount(pdfPath string) (int, error)
- func (pe *PDFEnhancer) MergePDFs(inputPaths []string, outputPath string) error
- func (pe *PDFEnhancer) OptimizePDF(inputPath, outputPath string) error
- func (pe *PDFEnhancer) SplitPDF(inputPath, outputDir string) error
- func (pe *PDFEnhancer) ValidatePDF(pdfPath string) error
- type PDFInfo
- type PageInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PDFEnhancer ¶
type PDFEnhancer struct {
// contains filtered or unexported fields
}
PDFEnhancer provides utilities for reading and enhancing PDF files
func (*PDFEnhancer) AddTextLayer ¶
func (pe *PDFEnhancer) AddTextLayer(inputPath, outputPath string, ocrResults *ocr.DocumentOCR) error
AddTextLayer adds an invisible OCR text layer to a PDF This makes the PDF searchable while preserving the original appearance
func (*PDFEnhancer) CompareCoordinateSystems ¶
func (pe *PDFEnhancer) CompareCoordinateSystems(pageHeight int) string
CompareCoordinateSystems returns information about coordinate system differences between OCR (top-left origin) and PDF (bottom-left origin)
func (*PDFEnhancer) ExtractPageInfo ¶
func (pe *PDFEnhancer) ExtractPageInfo(pdfPath string, pageNum int) (*PageInfo, error)
ExtractPageInfo extracts basic information about a PDF page
func (*PDFEnhancer) GetPDFInfo ¶
func (pe *PDFEnhancer) GetPDFInfo(pdfPath string) (*PDFInfo, error)
GetPDFInfo returns basic information about a PDF file
func (*PDFEnhancer) GetPageCount ¶
func (pe *PDFEnhancer) GetPageCount(pdfPath string) (int, error)
GetPageCount returns the number of pages in a PDF file
func (*PDFEnhancer) MergePDFs ¶
func (pe *PDFEnhancer) MergePDFs(inputPaths []string, outputPath string) error
MergePDFs merges multiple PDF files into a single output file
func (*PDFEnhancer) OptimizePDF ¶
func (pe *PDFEnhancer) OptimizePDF(inputPath, outputPath string) error
OptimizePDF optimizes a PDF file by compressing and removing unnecessary data
func (*PDFEnhancer) SplitPDF ¶
func (pe *PDFEnhancer) SplitPDF(inputPath, outputDir string) error
SplitPDF splits a PDF into individual pages
func (*PDFEnhancer) ValidatePDF ¶
func (pe *PDFEnhancer) ValidatePDF(pdfPath string) error
ValidatePDF checks if a file is a valid PDF