Versions in this module Expand all Collapse all v1 v1.0.2 Sep 7, 2024 v1.0.1 Sep 7, 2024 Changes in this version + var ErrInvalidCSV = errors.New("pdfcpu: invalid csv input file") + var ErrInvalidJSON = errors.New("pdfcpu: invalid JSON encoding") + var ErrNoFormData = errors.New("pdfcpu: missing form data") + var ErrNoFormFieldsAffected = errors.New("pdfcpu: no form fields affected") + var ErrNoOp = errors.New("pdfcpu: no operation") + var ErrNoOutlines = errors.New("pdfcpu: no outlines available") + var ErrOutlines = errors.New("pdfcpu: existing outlines") + func AddAnnotations(rs io.ReadSeeker, w io.Writer, selectedPages []string, ...) error + func AddAnnotationsAsIncrement(rws io.ReadWriteSeeker, selectedPages []string, ar model.AnnotationRenderer, ...) error + func AddAnnotationsFile(inFile, outFile string, selectedPages []string, ar model.AnnotationRenderer, ...) (err error) + func AddAnnotationsMap(rs io.ReadSeeker, w io.Writer, m map[int][]model.AnnotationRenderer, ...) error + func AddAnnotationsMapAsIncrement(rws io.ReadWriteSeeker, m map[int][]model.AnnotationRenderer, ...) error + func AddAnnotationsMapFile(inFile, outFile string, m map[int][]model.AnnotationRenderer, ...) (err error) + func AddAttachments(rs io.ReadSeeker, w io.Writer, files []string, coll bool, ...) error + func AddAttachmentsFile(inFile, outFile string, files []string, coll bool, conf *model.Configuration) (err error) + func AddBookmarks(rs io.ReadSeeker, w io.Writer, bms []pdfcpu.Bookmark, replace bool, ...) error + func AddBookmarksFile(inFile, outFile string, bms []pdfcpu.Bookmark, replace bool, ...) (err error) + func AddBoxes(rs io.ReadSeeker, w io.Writer, selectedPages []string, ...) error + func AddBoxesFile(inFile, outFile string, selectedPages []string, pb *model.PageBoundaries, ...) (err error) + func AddImageWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, ...) error + func AddImageWatermarksForReaderFile(inFile, outFile string, selectedPages []string, onTop bool, r io.Reader, ...) error + func AddKeywords(rs io.ReadSeeker, w io.Writer, files []string, conf *model.Configuration) error + func AddKeywordsFile(inFile, outFile string, files []string, conf *model.Configuration) (err error) + func AddPDFWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, ...) error + func AddProperties(rs io.ReadSeeker, w io.Writer, properties map[string]string, ...) error + func AddPropertiesFile(inFile, outFile string, properties map[string]string, ...) (err error) + func AddTextWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, text, desc string, ...) error + func AddWatermarks(rs io.ReadSeeker, w io.Writer, selectedPages []string, wm *model.Watermark, ...) error + func AddWatermarksFile(inFile, outFile string, selectedPages []string, wm *model.Watermark, ...) (err error) + func AddWatermarksMap(rs io.ReadSeeker, w io.Writer, m map[int]*model.Watermark, ...) error + func AddWatermarksMapFile(inFile, outFile string, m map[int]*model.Watermark, conf *model.Configuration) (err error) + func AddWatermarksSliceMap(rs io.ReadSeeker, w io.Writer, m map[int][]*model.Watermark, ...) error + func AddWatermarksSliceMapFile(inFile, outFile string, m map[int][]*model.Watermark, ...) (err error) + func Annotations(rs io.ReadSeeker, selectedPages []string, conf *model.Configuration) (map[int]model.PgAnnots, error) + func Attachments(rs io.ReadSeeker, conf *model.Configuration) ([]model.Attachment, error) + func Booklet(rs io.ReadSeeker, w io.Writer, imgFiles, selectedPages []string, ...) error + func BookletFile(inFiles []string, outFile string, selectedPages []string, nup *model.NUp, ...) (err error) + func BookletFromImages(conf *model.Configuration, imageFileNames []string, nup *model.NUp) (*model.Context, error) + func Bookmarks(rs io.ReadSeeker, conf *model.Configuration) ([]pdfcpu.Bookmark, error) + func Box(s string, u types.DisplayUnit) (*model.Box, error) + func Boxes(rs io.ReadSeeker, selectedPages []string, conf *model.Configuration) ([]model.PageBoundaries, error) + func ChangeOwnerPassword(rs io.ReadSeeker, w io.Writer, pwOld, pwNew string, conf *model.Configuration) error + func ChangeOwnerPasswordFile(inFile, outFile string, pwOld, pwNew string, conf *model.Configuration) (err error) + func ChangeUserPassword(rs io.ReadSeeker, w io.Writer, pwOld, pwNew string, conf *model.Configuration) error + func ChangeUserPasswordFile(inFile, outFile string, pwOld, pwNew string, conf *model.Configuration) (err error) + func Collect(rs io.ReadSeeker, w io.Writer, selectedPages []string, ...) error + func CollectFile(inFile, outFile string, selectedPages []string, conf *model.Configuration) (err error) + func Create(rs io.ReadSeeker, rd io.Reader, w io.Writer, conf *model.Configuration) error + func CreateCheatSheetsUserFonts(fontNames []string) error + func CreateFile(inFilePDF, inFileJSON, outFilePDF string, conf *model.Configuration) (err error) + func CreatePDFFile(xRefTable *model.XRefTable, outFile string, conf *model.Configuration) error + func CreateUserFontDemoFiles(dir, fn string) error + func Crop(rs io.ReadSeeker, w io.Writer, selectedPages []string, b *model.Box, ...) error + func CropFile(inFile, outFile string, selectedPages []string, b *model.Box, ...) (err error) + func Cut(rs io.ReadSeeker, outDir, fileName string, selectedPages []string, ...) error + func CutFile(inFile, outDir, outFile string, selectedPages []string, cut *model.Cut, ...) error + func Decrypt(rs io.ReadSeeker, w io.Writer, conf *model.Configuration) error + func DecryptFile(inFile, outFile string, conf *model.Configuration) (err error) + func DisableConfigDir() + func DumpObject(rs io.ReadSeeker, mode, objNr int, conf *model.Configuration) error + func DumpObjectFile(inFile string, mode, objNr int, conf *model.Configuration) error + func Encrypt(rs io.ReadSeeker, w io.Writer, conf *model.Configuration) error + func EncryptFile(inFile, outFile string, conf *model.Configuration) (err error) + func EnsureDefaultConfigAt(path string) error + func ExportBookmarksFile(inFilePDF, outFileJSON string, conf *model.Configuration) (err error) + func ExportBookmarksJSON(rs io.ReadSeeker, w io.Writer, source string, conf *model.Configuration) error + func ExportForm(rs io.ReadSeeker, source string, conf *model.Configuration) (*form.FormGroup, error) + func ExportFormFile(inFilePDF, outFileJSON string, conf *model.Configuration) (err error) + func ExportFormJSON(rs io.ReadSeeker, w io.Writer, source string, conf *model.Configuration) error + func ExtractAttachments(rs io.ReadSeeker, outDir string, fileNames []string, conf *model.Configuration) error + func ExtractAttachmentsFile(inFile, outDir string, files []string, conf *model.Configuration) error + func ExtractAttachmentsRaw(rs io.ReadSeeker, outDir string, fileNames []string, conf *model.Configuration) ([]model.Attachment, error) + func ExtractContent(rs io.ReadSeeker, outDir, fileName string, selectedPages []string, ...) error + func ExtractContentFile(inFile, outDir string, selectedPages []string, conf *model.Configuration) error + func ExtractFonts(rs io.ReadSeeker, outDir, fileName string, selectedPages []string, ...) error + func ExtractFontsFile(inFile, outDir string, selectedPages []string, conf *model.Configuration) error + func ExtractImages(rs io.ReadSeeker, selectedPages []string, ...) error + func ExtractImagesFile(inFile, outDir string, selectedPages []string, conf *model.Configuration) error + func ExtractImagesRaw(rs io.ReadSeeker, selectedPages []string, conf *model.Configuration) ([]map[int]model.Image, error) + func ExtractMetadata(rs io.ReadSeeker, outDir, fileName string, conf *model.Configuration) error + func ExtractMetadataFile(inFile, outDir string, conf *model.Configuration) error + func ExtractPage(ctx *model.Context, pageNr int) (io.Reader, error) + func ExtractPages(rs io.ReadSeeker, outDir, fileName string, selectedPages []string, ...) error + func ExtractPagesFile(inFile, outDir string, selectedPages []string, conf *model.Configuration) error + func FillForm(rs io.ReadSeeker, rd io.Reader, w io.Writer, conf *model.Configuration) error + func FillFormFile(inFilePDF, inFileJSON, outFilePDF string, conf *model.Configuration) (err error) + func FormFields(rs io.ReadSeeker, conf *model.Configuration) ([]form.Field, error) + func GetPermissions(rs io.ReadSeeker, conf *model.Configuration) (*int16, error) + func GetPermissionsFile(inFile string, conf *model.Configuration) (*int16, error) + func HasWatermarks(rs io.ReadSeeker, conf *model.Configuration) (bool, error) + func HasWatermarksFile(inFile string, conf *model.Configuration) (bool, error) + func ImageBookletConfig(val int, desc string, conf *model.Configuration) (*model.NUp, error) + func ImageGridConfig(rows, cols int, desc string, conf *model.Configuration) (*model.NUp, error) + func ImageNUpConfig(val int, desc string, conf *model.Configuration) (*model.NUp, error) + func ImageWatermark(fileName, desc string, onTop, update bool, u types.DisplayUnit) (*model.Watermark, error) + func ImageWatermarkForReader(r io.Reader, desc string, onTop, update bool, u types.DisplayUnit) (*model.Watermark, error) + func Images(rs io.ReadSeeker, selectedPages []string, conf *model.Configuration) ([]map[int]model.Image, error) + func Import(s string, u types.DisplayUnit) (*pdfcpu.Import, error) + func ImportBookmarks(rs io.ReadSeeker, rd io.Reader, w io.Writer, replace bool, ...) error + func ImportBookmarksFile(inFilePDF, inFileJSON, outFilePDF string, replace bool, ...) (err error) + func ImportImages(rs io.ReadSeeker, w io.Writer, imgs []io.Reader, imp *pdfcpu.Import, ...) error + func ImportImagesFile(imgFiles []string, outFile string, imp *pdfcpu.Import, ...) (err error) + func InsertPages(rs io.ReadSeeker, w io.Writer, selectedPages []string, before bool, ...) error + func InsertPagesFile(inFile, outFile string, selectedPages []string, before bool, ...) (err error) + func InstallFonts(fileNames []string) error + func Keywords(rs io.ReadSeeker, conf *model.Configuration) ([]string, error) + func ListFonts() ([]string, error) + func ListPageLayout(rs io.ReadSeeker, conf *model.Configuration) ([]string, error) + func ListPageLayoutFile(inFile string, conf *model.Configuration) ([]string, error) + func ListPageMode(rs io.ReadSeeker, conf *model.Configuration) ([]string, error) + func ListPageModeFile(inFile string, conf *model.Configuration) ([]string, error) + func ListViewerPreferences(rs io.ReadSeeker, all bool, conf *model.Configuration) ([]string, error) + func ListViewerPreferencesFile(inFile string, all, json bool, conf *model.Configuration) ([]string, error) + func ListViewerPreferencesFileJSON(inFile string, all bool, conf *model.Configuration) ([]string, error) + func LoadConfiguration() *model.Configuration + func LockFormFields(rs io.ReadSeeker, w io.Writer, fieldIDsOrNames []string, ...) error + func LockFormFieldsFile(inFile, outFile string, fieldIDsOrNames []string, conf *model.Configuration) (err error) + func Merge(destFile string, inFiles []string, w io.Writer, conf *model.Configuration, ...) error + func MergeAppendFile(inFiles []string, outFile string, dividerPage bool, conf *model.Configuration) (err error) + func MergeCreateFile(inFiles []string, outFile string, dividerPage bool, conf *model.Configuration) (err error) + func MergeCreateZip(rs1, rs2 io.ReadSeeker, w io.Writer, conf *model.Configuration) error + func MergeCreateZipFile(inFile1, inFile2, outFile string, conf *model.Configuration) (err error) + func MergeRaw(rsc []io.ReadSeeker, w io.Writer, dividerPage bool, conf *model.Configuration) error + func MultiFillForm(inFilePDF string, rd io.Reader, outDir, fileName string, ...) error + func MultiFillFormFile(inFilePDF, inFileData, outDir, outFilePDF string, merge bool, ...) (err error) + func NDown(rs io.ReadSeeker, outDir, fileName string, selectedPages []string, n int, ...) error + func NDownFile(inFile, outDir, outFile string, selectedPages []string, n int, cut *model.Cut, ...) error + func NUp(rs io.ReadSeeker, w io.Writer, imgFiles, selectedPages []string, ...) error + func NUpFile(inFiles []string, outFile string, selectedPages []string, nup *model.NUp, ...) (err error) + func NUpFromImage(conf *model.Configuration, imageFileNames []string, nup *model.NUp) (*model.Context, error) + func Optimize(rs io.ReadSeeker, w io.Writer, conf *model.Configuration) error + func OptimizeContext(ctx *model.Context) error + func OptimizeFile(inFile, outFile string, conf *model.Configuration) (err error) + func PDFBookletConfig(val int, desc string, conf *model.Configuration) (*model.NUp, error) + func PDFGridConfig(rows, cols int, desc string, conf *model.Configuration) (*model.NUp, error) + func PDFInfo(rs io.ReadSeeker, fileName string, selectedPages []string, ...) (*pdfcpu.PDFInfo, error) + func PDFMultiWatermarkForReadSeeker(rs io.ReadSeeker, startPageNrSrc, startPageNrDest int, desc string, ...) (*model.Watermark, error) + func PDFNUpConfig(val int, desc string, conf *model.Configuration) (*model.NUp, error) + func PDFWatermark(fileName, desc string, onTop, update bool, u types.DisplayUnit) (*model.Watermark, error) + func PDFWatermarkForReadSeeker(rs io.ReadSeeker, pageNrSrc int, desc string, onTop, update bool, ...) (*model.Watermark, error) + func PageBoundaries(s string, unit types.DisplayUnit) (*model.PageBoundaries, error) + func PageBoundariesFromBoxList(s string) (*model.PageBoundaries, error) + func PageCount(rs io.ReadSeeker, conf *model.Configuration) (int, error) + func PageCountFile(inFile string) (int, error) + func PageDims(rs io.ReadSeeker, conf *model.Configuration) ([]types.Dim, error) + func PageDimsFile(inFile string) ([]types.Dim, error) + func PageLayout(rs io.ReadSeeker, conf *model.Configuration) (*model.PageLayout, error) + func PageLayoutFile(inFile string, conf *model.Configuration) (*model.PageLayout, error) + func PageMode(rs io.ReadSeeker, conf *model.Configuration) (*model.PageMode, error) + func PageModeFile(inFile string, conf *model.Configuration) (*model.PageMode, error) + func PagesForPageCollection(pageCount int, pageSelection []string) ([]int, error) + func PagesForPageRange(from, thru int) []int + func PagesForPageSelection(pageCount int, pageSelection []string, ensureAllforNone bool, log bool) (types.IntSet, error) + func ParsePageSelection(s string) ([]string, error) + func Permissions(rs io.ReadSeeker, conf *model.Configuration) (int, error) + func Poster(rs io.ReadSeeker, outDir, fileName string, selectedPages []string, ...) error + func PosterFile(inFile, outDir, outFile string, selectedPages []string, cut *model.Cut, ...) error + func Properties(rs io.ReadSeeker, conf *model.Configuration) (map[string]string, error) + func ReadAndValidate(rs io.ReadSeeker, conf *model.Configuration) (ctx *model.Context, err error) + func ReadContext(rs io.ReadSeeker, conf *model.Configuration) (*model.Context, error) + func ReadContextFile(inFile string) (*model.Context, error) + func ReadValidateAndOptimize(rs io.ReadSeeker, conf *model.Configuration) (ctx *model.Context, err error) + func RemainingPagesForPageRemoval(pageCount int, pageSelection []string, log bool) (types.IntSet, error) + func RemoveAnnotations(rs io.ReadSeeker, w io.Writer, selectedPages, idsAndTypes []string, ...) error + func RemoveAnnotationsAsIncrement(rws io.ReadWriteSeeker, selectedPages, idsAndTypes []string, objNrs []int, ...) error + func RemoveAnnotationsFile(inFile, outFile string, selectedPages, idsAndTypes []string, objNrs []int, ...) (err error) + func RemoveAttachments(rs io.ReadSeeker, w io.Writer, files []string, conf *model.Configuration) error + func RemoveAttachmentsFile(inFile, outFile string, files []string, conf *model.Configuration) (err error) + func RemoveBookmarks(rs io.ReadSeeker, w io.Writer, conf *model.Configuration) error + func RemoveBookmarksFile(inFile, outFile string, conf *model.Configuration) (err error) + func RemoveBoxes(rs io.ReadSeeker, w io.Writer, selectedPages []string, ...) error + func RemoveBoxesFile(inFile, outFile string, selectedPages []string, pb *model.PageBoundaries, ...) (err error) + func RemoveFormFields(rs io.ReadSeeker, w io.Writer, fieldIDsOrNames []string, ...) error + func RemoveFormFieldsFile(inFile, outFile string, fieldIDsOrNames []string, conf *model.Configuration) (err error) + func RemoveKeywords(rs io.ReadSeeker, w io.Writer, keywords []string, conf *model.Configuration) error + func RemoveKeywordsFile(inFile, outFile string, keywords []string, conf *model.Configuration) (err error) + func RemovePages(rs io.ReadSeeker, w io.Writer, selectedPages []string, ...) error + func RemovePagesFile(inFile, outFile string, selectedPages []string, conf *model.Configuration) (err error) + func RemoveProperties(rs io.ReadSeeker, w io.Writer, properties []string, conf *model.Configuration) error + func RemovePropertiesFile(inFile, outFile string, properties []string, conf *model.Configuration) (err error) + func RemoveWatermarks(rs io.ReadSeeker, w io.Writer, selectedPages []string, ...) error + func RemoveWatermarksFile(inFile, outFile string, selectedPages []string, conf *model.Configuration) (err error) + func ResetFormFields(rs io.ReadSeeker, w io.Writer, fieldIDsOrNames []string, ...) error + func ResetFormFieldsFile(inFile, outFile string, fieldIDsOrNames []string, conf *model.Configuration) (err error) + func ResetPageLayout(rs io.ReadSeeker, w io.Writer, conf *model.Configuration) error + func ResetPageLayoutFile(inFile, outFile string, conf *model.Configuration) (err error) + func ResetPageMode(rs io.ReadSeeker, w io.Writer, conf *model.Configuration) error + func ResetPageModeFile(inFile, outFile string, conf *model.Configuration) (err error) + func ResetViewerPreferences(rs io.ReadSeeker, w io.Writer, conf *model.Configuration) error + func ResetViewerPreferencesFile(inFile, outFile string, conf *model.Configuration) (err error) + func Resize(rs io.ReadSeeker, w io.Writer, selectedPages []string, resize *model.Resize, ...) error + func ResizeFile(inFile, outFile string, selectedPages []string, resize *model.Resize, ...) (err error) + func Rotate(rs io.ReadSeeker, w io.Writer, rotation int, selectedPages []string, ...) error + func RotateFile(inFile, outFile string, rotation int, selectedPages []string, ...) (err error) + func SetPageLayout(rs io.ReadSeeker, w io.Writer, val model.PageLayout, conf *model.Configuration) error + func SetPageLayoutFile(inFile, outFile string, val model.PageLayout, conf *model.Configuration) (err error) + func SetPageMode(rs io.ReadSeeker, w io.Writer, val model.PageMode, conf *model.Configuration) error + func SetPageModeFile(inFile, outFile string, val model.PageMode, conf *model.Configuration) (err error) + func SetPermissions(rs io.ReadSeeker, w io.Writer, conf *model.Configuration) error + func SetPermissionsFile(inFile, outFile string, conf *model.Configuration) (err error) + func SetViewerPreferences(rs io.ReadSeeker, w io.Writer, vp model.ViewerPreferences, ...) error + func SetViewerPreferencesFile(inFile, outFile string, vp model.ViewerPreferences, conf *model.Configuration) (err error) + func SetViewerPreferencesFileFromJSONBytes(inFile, outFile string, jsonBytes []byte, conf *model.Configuration) (err error) + func SetViewerPreferencesFileFromJSONFile(inFilePDF, outFilePDF, inFileJSON string, conf *model.Configuration) error + func SetViewerPreferencesFromJSONBytes(rs io.ReadSeeker, w io.Writer, jsonBytes []byte, conf *model.Configuration) error + func SetViewerPreferencesFromJSONReader(rs io.ReadSeeker, w io.Writer, rd io.Reader, conf *model.Configuration) error + func Split(rs io.ReadSeeker, outDir, fileName string, span int, conf *model.Configuration) error + func SplitByPageNr(rs io.ReadSeeker, outDir, fileName string, pageNrs []int, ...) error + func SplitByPageNrFile(inFile, outDir string, pageNrs []int, conf *model.Configuration) error + func SplitFile(inFile, outDir string, span int, conf *model.Configuration) error + func TextWatermark(text, desc string, onTop, update bool, u types.DisplayUnit) (*model.Watermark, error) + func Trim(rs io.ReadSeeker, w io.Writer, selectedPages []string, ...) error + func TrimFile(inFile, outFile string, selectedPages []string, conf *model.Configuration) (err error) + func UnlockFormFields(rs io.ReadSeeker, w io.Writer, fieldIDsOrNames []string, ...) error + func UnlockFormFieldsFile(inFile, outFile string, fieldIDsOrNames []string, conf *model.Configuration) (err error) + func UpdateImageWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, ...) error + func UpdatePDFWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, ...) error + func UpdateTextWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, text, desc string, ...) error + func Validate(rs io.ReadSeeker, conf *model.Configuration) error + func ValidateContext(ctx *model.Context) error + func ValidateFile(inFile string, conf *model.Configuration) error + func ValidateFiles(inFiles []string, conf *model.Configuration) error + func ViewerPreferences(rs io.ReadSeeker, conf *model.Configuration) (*model.ViewerPreferences, *model.Version, error) + func ViewerPreferencesFile(inFile string, all bool, conf *model.Configuration) (*model.ViewerPreferences, error) + func WatermarkContext(ctx *model.Context, selectedPages types.IntSet, wm *model.Watermark) error + func Write(ctx *model.Context, w io.Writer, conf *model.Configuration) error + func WriteContext(ctx *model.Context, w io.Writer) error + func WriteContextFile(ctx *model.Context, outFile string) error + func WriteIncr(ctx *model.Context, rws io.ReadWriteSeeker, conf *model.Configuration) error + func WriteIncrement(ctx *model.Context, w io.Writer) error + func WritePage(r io.Reader, outDir, fileName string, pageNr int) error + func Zoom(rs io.ReadSeeker, w io.Writer, selectedPages []string, zoom *model.Zoom, ...) error + func ZoomFile(inFile, outFile string, selectedPages []string, zoom *model.Zoom, ...) (err error) + type PageSpan struct + From int + Reader io.Reader + Thru int + func SplitRaw(rs io.ReadSeeker, span int, conf *model.Configuration) ([]*PageSpan, error)