Documentation
¶
Index ¶
- func DeleteFiles(paths []string) error
- func Exists(path string) (bool, error)
- func FlattenPDF(opts FlattenPDFOptions) ([]string, error)
- func ImagesToPdf(imagePaths []string, outputPath string, pdfName string, pageSize string) (flattenedPath string, err error)
- func PdfToImages(filePath string, tempDir string, opts FlattenPDFOptions) (imagePaths []string, err error)
- func ValidatePDFPaths(paths []string) error
- type FlattenPDFOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenPDF ¶
func FlattenPDF(opts FlattenPDFOptions) ([]string, error)
FlattenPDF takes a slice of PDF file paths, validates them and flattens them to make them read-only. It returns the paths of the flattened PDF files.
func ImagesToPdf ¶
func ImagesToPdf(imagePaths []string, outputPath string, pdfName string, pageSize string) (flattenedPath string, err error)
Check pdfcpu for valid pageSize strings
func PdfToImages ¶
func PdfToImages(filePath string, tempDir string, opts FlattenPDFOptions) (imagePaths []string, err error)
Renders a pdf file into images
func ValidatePDFPaths ¶
ValidatePDFPaths validates the given paths to ensure they are valid PDF paths
Types ¶
type FlattenPDFOptions ¶
type FlattenPDFOptions struct {
InputFiles []string // list of pdf files to process
OutputDir string // optional directory to save processed files.
ImageDensity int // recommended: 200-300 (low) or 600 (medium) or 1200 (high)
ImageQuality int // recommended: 80-100, only for jpg encoding
RequiresFlatSuffix bool // whether to add _flat suffix to the output file name
}
Click to show internal directories.
Click to hide internal directories.