pdf

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddImageWatermark

func AddImageWatermark(input, output, imagePath string, pages []int, password string) error

AddImageWatermark adds an image watermark to a PDF

func AddWatermark

func AddWatermark(input, output, text string, pages []int, password string) error

AddWatermark adds a text watermark to a PDF

func Compress

func Compress(input, output, password string) error

Compress optimizes a PDF for file size

func Decrypt

func Decrypt(input, output, password string) error

Decrypt removes password protection from a PDF

func Encrypt

func Encrypt(input, output, userPW, ownerPW string) error

Encrypt adds password protection to a PDF

func ExtractImages

func ExtractImages(input, outputDir string, pages []int, password string) error

ExtractImages extracts images from a PDF

func ExtractPages

func ExtractPages(input, output string, pages []int, password string) error

ExtractPages extracts specific pages from a PDF into a new file

func ExtractText

func ExtractText(input string, pages []int, password string) (string, error)

ExtractText extracts text content from a PDF

func Merge

func Merge(inputs []string, output, password string) error

Merge combines multiple PDF files into one

func PageCount

func PageCount(path, password string) (int, error)

PageCount returns the number of pages in a PDF

func Rotate

func Rotate(input, output string, angle int, pages []int, password string) error

Rotate rotates pages in a PDF

func SetMetadata

func SetMetadata(input, output string, meta *Metadata, password string) error

SetMetadata sets metadata on a PDF

func Split

func Split(input, outputDir, password string) error

Split splits a PDF into individual pages

func SplitByPageCount

func SplitByPageCount(input, outputDir string, pageCount int, password string) error

SplitByPageCount splits a PDF into chunks of n pages

func Validate

func Validate(path, password string) error

Validate validates a PDF file

func ValidateToBuffer

func ValidateToBuffer(data []byte) error

ValidateToBuffer validates a PDF from bytes

Types

type Info

type Info struct {
	FilePath    string
	FileSize    int64
	Pages       int
	Version     string
	Title       string
	Author      string
	Subject     string
	Keywords    string
	Creator     string
	Producer    string
	CreatedDate string
	ModDate     string
	Encrypted   bool
}

Info holds PDF document information

func GetInfo

func GetInfo(path, password string) (*Info, error)

GetInfo returns information about a PDF file

type Metadata

type Metadata struct {
	Title       string
	Author      string
	Subject     string
	Keywords    string
	Creator     string
	Producer    string
	CreatedDate string
	ModDate     string
}

Metadata holds PDF metadata fields

func GetMetadata

func GetMetadata(input, password string) (*Metadata, error)

GetMetadata returns the metadata of a PDF

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL